html, body {
	padding: 0;
	margin: 0;
	font-family: sans-serif;
}

body {
	max-width: 1280px;
	margin: 0 auto;
}

.header {
	padding-top: 1em;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}

.header > * {
	margin: .5em 1em;
}

.header .spacer {
	flex-grow: 1;
}

.header .logos {
	white-space: nowrap;
}

.header .logos img + img {
	margin-left: 5px;
}

.header .lang {
	font-size: .8em;
	list-style-type: none;
	display: flex;
	margin-top: 1em;
	align-items: center;
	padding: 0;
}

.header .lang li {
	padding: .1em 0;
}

.header .lang li + li {
	border-left: 1px solid;
	padding-left: .5em;
	margin-left: .5em;
}

.hidden {
	display: none !important;
}

.collapsed {
	visibility: collapse !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
}

label {
	font-weight: normal;
	display: inline-block;
}

label[disabled],
li[disabled] {
	color: gray;
}

form > ol > li {
	margin: 1em 0;
}

form quest + ul {
	padding: 0;
}

form quest + ul li {
	list-style: none;
	padding: .2em 0;
}

form quest + ul li * {
	vertical-align: middle;
}

form input[type=radio],
form input[type=checkbox]	{
	margin: 0 1.2em 0 0;
	transform: scale(2);
	flex-shrink: 0;
}

form input:not([type=radio]):not([type=checkbox]),
form textarea {
	font: inherit;
	max-width: 100%;
}

form input[type=number] {
	text-align: right;
}

form input[type=number]:not([size]) {
	width: 8em;
}

form input:not([type]),
form input[type=text],
form input[type=number],
form input[type=tel] {
	margin: 0 .2em;
}

form textarea {
	display: block;
}

form .mainTable {
	border-collapse: collapse;
	font-size: inherit;
	margin: .5em 0;
	width: 100%;
}

form td {
	padding: .5em;
	font-size: inherit;
	color: inherit;
}

.submitGroup {
	margin-top: 1em;
	margin: 0 .5em;
}
.ie form textarea,
.ios form textarea {
	height: 4em;
}

hr {
	border: 0;
	height: 1px;
	margin: 2em 0;
	position: relative;
}

hr::before {
    content: "";
    border: 0;
    height: 1px;
    background-color: rgb(204, 204, 204);
    width: calc(100% + 1em);
    display: block;
    margin: 0 -.5em;
    position: absolute;
    left: -.5em;
}

@media (min-width:769px) {
	form {
		margin: 1em 2em;
	}

	.submitGroup > p {
		display: inline-block;
	}

	.header .rightGroup {
		text-align: right;
	}
}

@media (max-width:768px) {
	form tbody td {
		display: flex;
		flex-direction: column;
		width: auto;
	}
	
	.header {
		flex-direction: column;
		align-items: center;
	}

	.submitGroup {
		text-align: center;
		padding-bottom: 2em;
	}

	#nextStep,
	.submitGroup [type=submit] {
		padding: .75em 1.5em;
	}

	.header .rightGroup {
		text-align: center;
	}
}

* {
	box-sizing: border-box;
}

:lang(zh-hant), :lang(zh-hans) {
	letter-spacing: .05em;
}

form {
	padding: 0 .5em;
}

input:not([type=radio]):not([disabled])[required],
select:not([disabled])[required] {
	--outline: 2px solid darkred;
}

.main-title {
	font-size: 1.6em;
	line-height: 1.5em;
	text-wrap: balance;
}

.main-desc {
	font-size: 1.1em;
	margin: 2em 0;
	line-height: 1.5em;
}

.q-block {
	margin: 2em 0;
}

.q-block .q-block {
	margin: .5em 0;
}

.q-text {
	font-weight: bold;
	color: darkred;
	position: relative;
}

.q-block > .q-text::before {
	content: "Q. ";
	margin-right: .2em;
}

.q-answer > .q-text {
	margin: .25em 0;
	margin-left: -1.5em;
}

.q-answer.horizontal > .q-text {
	width: 100%;
}

.q-text,
.q-choice {
	display: flex;
	display: inline-flex;
	align-items: baseline;
}

.q-choice {
	flex-wrap: wrap;
}

.q-choice > label {
	display: flex;
	align-items: baseline;
}

.q-choice.complex > label {
	flex-wrap: wrap;
	line-height: 1.5;
}

.q-choice > label:first-child:last-child {
	flex: 1 0 auto;
	max-width: 100%;
	align-items: baseline;
}

.q-text[data-text]::after,
.q-choice > label[data-text]::after {
	content: attr(data-text);
	display: inline-block;
}

.q-choice > label[data-text] + input {
	margin-left: .5em;
}

.q-answer {
	margin: .25em 0 .5em;
	padding-left: 1.5em;
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	align-items: baseline;
	width: 100%;
}

.ie .q-answer {
	align-items: flex-start;
}

.q-choice {
	padding: .5em 0;
}

.q-answer.flex > .q-choice {
	width: 100%;
}

/* .q-choice[data-text].vertical { */
	/* flex-direction: column; */
	/* width: 100%; */
/* } */

/* .q-choice[data-text].vertical::after { */
	/* order: -1; */
/* } */

.max-grow {
	width: 100%;
}

textarea {
	width: 60%;
	height: 4em;
}

select {
	height: 2em;
}

.remark {
	font-size: .8em;
	color: dimgrey;
}

[name=tel] {
	width: 4em;
}

[type=button] {
	margin: 1em 0;
}

#souvenirGroup {
	border: 1px solid;
	text-align: center;
	padding: .25em 1em;
	margin: 1em 0;
}

#souvenirGroup img {
	max-width: 60%;
	max-height: 100vw;
}

#timerWrapper {
	position: fixed;
	position: sticky;
	bottom: 0;
	right: .5em;
	text-align: right;
	pointer-events: none;
}

#timer {
	color: green;
	display: inline-flex;
	padding: .5em;
	margin-bottom: .5em;
	background: white;
	border: 1px solid;
	border-radius: .5em;
	font-family: Courier, "Droid Sans Mono", monospace;
	align-items: center;
}

#timer.warning {
	color: darkorange;
}

#timer.danger {
	color: red;
}

#timer svg {
	height: 1em;
	width: 1em;
	margin-right: .25em;
}

#timer.danger svg {
	animation: .7s infinite linear wiggle;
}

@keyframes wiggle {
	0% {transform: rotate(5deg);}
	25% {transform: rotate(-10deg);}
	50% {transform: rotate(10deg);}
	75% {transform: rotate(-5deg);}
	100% {transform: rotate(0deg);}
}

@media (min-width:769px) {
	.q-answer.block,
	.q-answer.horizontal,
	.q-answer.reversed {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: baseline;
	}
	.q-answer.reversed {
		flex-direction: row-reverse;
	}
	.q-answer.horizontal {
		transform: translateX(-2em);
	}
	.q-answer.horizontal > .q-choice,
	.q-answer.horizontal > .q-answer,
	.q-answer.horizontal > .q-text {
		padding-left: 2em;
	}
}



@media (max-width:768px) {
	.main-desc {
		font-size: 1.1em;
	}
	
	.q-answer.reversed {
		flex-direction: column-reverse;
	}
	
	.q-answer > .q-choice {
		width: 100%;
	}

	.q-score {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-auto-flow: column;
	}

	.q-score > .q-text {
		grid-column: 1 / 3;
	}

	.q-score > .q-choice:first-child .q-choice:nth-child(5) ~ *,
	.q-score > .q-text ~ .q-choice:nth-child(6) ~ * {
		grid-column-start: 2;
	}
	
	#souvenirGroup img {
	  max-width: 100%;
	}
	textarea {
		width: 90%;
	}

	.q-choice.complex > * {
		margin-right: -1.8em;
	}

	.q-choice.complex > :not(:first-child) {
		margin-left: 1.8em;
	}

	.q-choice.complex {
		padding-right: 1.8em;
	}
}

:root[debug] .q-block::before {
    content: attr(data-q);
    color: red;
    font-weight: bold;
    margin-right: 1em;
}
	
.q-group-title {
	color: darkred;
	font-weight: bold;
	text-decoration: underline;
	font-size: 1.1em;
}


form.readyToSubmit textarea:invalid,
form.readyToSubmit input:invalid,
form.readyToSubmit select:invalid {
	box-shadow: 0 0 0 1px red;
}