/**
 * Ticket tiers on an event page.
 *
 * Tokens with fallbacks, so it reads as part of the missionOS theme and as
 * something deliberate in anybody else's.
 */

.cong-tickets__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cong-tickets__tier {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 1rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
}

.cong-tickets__tier:last-child {
	border-bottom: 0;
}

.cong-tickets__name {
	flex: 1 1 12rem;
	font-weight: 600;
}

.cong-tickets__price {
	font-variant-numeric: tabular-nums;
}

.cong-tickets__state {
	color: var(--wp--preset--color--ink-muted, #5b6b78);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

/* Sold out is information, so it stays legible rather than being dimmed
   into illegibility. */
.cong-tickets__tier.is-closed .cong-tickets__name,
.cong-tickets__tier.is-closed .cong-tickets__price {
	opacity: 0.55;
	text-decoration: line-through;
}

.cong-tickets__about {
	display: block;
	font-weight: 400;
	color: var(--wp--preset--color--ink-muted, #5b6b78);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

.cong-tickets__how-many {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.cong-tickets__how-many label {
	color: var(--wp--preset--color--ink-muted, #5b6b78);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

.cong-tickets__over {
	font-style: italic;
	color: var(--wp--preset--color--ink-muted, #5b6b78);
}

.cong-tickets__you {
	border: 0;
	margin: 1.5rem 0 0;
	padding: 0;
}

.cong-tickets__you legend {
	font-weight: 600;
	padding: 0;
}

.cong-tickets__you p,
.cong-checkout__q,
.cong-checkout__form p {
	margin: 0 0 1rem;
}

.cong-tickets__you label,
.cong-checkout__form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.cong-tickets__you input,
.cong-checkout__form input[type="text"],
.cong-checkout__form input[type="email"],
.cong-checkout__form input[type="tel"],
.cong-checkout__form input[type="date"],
.cong-checkout__form select,
.cong-checkout__form textarea {
	width: 100%;
	max-width: 26rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
	border-radius: var(--wp--custom--radius--sm, 4px);
	font: inherit;
}

.cong-tickets__hint,
.cong-checkout__hint {
	display: block;
	margin-top: 0.25rem;
	font-weight: 400;
	color: var(--wp--preset--color--ink-muted, #5b6b78);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

.cong-checkout__box {
	display: flex !important;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400 !important;
}

.cong-checkout__box input {
	width: auto !important;
	margin-top: 0.2rem;
}

.cong-tickets__hold-note,
.cong-checkout__hold {
	color: var(--wp--preset--color--ink-muted, #5b6b78);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

.cong-tickets__code {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.cong-tickets__code input {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
	border-radius: var(--wp--custom--radius--sm, 4px);
	font: inherit;
}

/* ---- Checkout ---- */

.cong-checkout__seat {
	border: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
	border-radius: var(--wp--custom--radius--md, 8px);
	padding: 1.2rem;
	margin: 0 0 1.2rem;
}

.cong-checkout__seat legend {
	font-weight: 600;
	padding: 0 0.4rem;
}

.cong-checkout__total {
	font-size: 1.15rem;
}

/*
 * Test mode has to be impossible to miss. A church that runs its Christmas
 * concert in test mode for a week and wonders where the money went is the
 * failure this banner exists to prevent.
 */
.cong-checkout__test {
	background: #fff6e0;
	border-left: 4px solid #b8860b;
	padding: 0.8rem 1rem;
}

.cong-checkout__gaps {
	background: #fdeceb;
	border-left: 4px solid #b32d2e;
	padding: 0.8rem 1rem;
}

.cong-checkout__gaps ul {
	margin: 0.4rem 0 0 1.2rem;
}

.cong-pay {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
}

.cong-pay__error {
	color: #b32d2e;
	min-height: 1.4em;
}

/* ---- The tickets themselves ---- */

.cong-tickets__done {
	font-size: 1.1rem;
	font-weight: 600;
}

.cong-ticket {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
}

.cong-ticket__name {
	display: block;
	font-weight: 600;
	font-size: 1.1rem;
}

.cong-ticket__tier {
	display: block;
	color: var(--wp--preset--color--ink-muted, #5b6b78);
}

/*
 * The code, large and spaced. It is read aloud across a foyer far more often
 * than the QR is scanned, so it is the primary thing on a ticket, not a
 * fallback in small print.
 */
.cong-ticket__code {
	display: inline-block;
	margin-top: 0.4rem;
	font-size: 1.15rem;
	letter-spacing: 0.12em;
	background: none;
	padding: 0;
}

/*
 * Sized here rather than left to the SVG's own width and height attributes.
 * Block themes commonly set a global `svg { width: 1em }` for their icons, and
 * a QR code shrunk to the size of a letter is a QR code no phone can read.
 */
.cong-qr {
	flex: 0 0 auto;
	width: 7.5rem !important;
	height: 7.5rem !important;
	max-width: 7.5rem;
}

@media (max-width: 480px) {
	.cong-ticket {
		flex-wrap: wrap;
	}
}

@media print {
	.cong-tickets__back,
	.cong-checkout__test {
		display: none;
	}

	.cong-ticket {
		page-break-inside: avoid;
	}
}

/* ---- The door ---- */

/*
 * A volunteer holding a phone in a foyer with a queue. Everything is oversized
 * on purpose: this gets read at arm's length, in a hurry, in bad light.
 */
.cong-door {
	max-width: 32rem;
	margin: 0 auto;
}

.cong-door__count {
	font-size: 1.2rem;
	font-weight: 600;
	text-align: center;
}

/*
 * Collapsed until there is something to say. Reserving the space avoids a
 * layout jump, but on a phone it pushed the input below the fold — and a
 * volunteer with a queue in front of them should not have to scroll to reach
 * the box they type into. The jump happens once, at the first scan.
 */
.cong-door__answer:empty {
	min-height: 0;
	padding: 0;
	margin: 0;
}

.cong-door__answer {
	min-height: 6rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	border-radius: var(--wp--custom--radius--md, 8px);
	padding: 1.2rem;
	margin: 0 0 1rem;
	text-align: center;
}

.cong-door__answer strong {
	font-size: 1.8rem;
	line-height: 1.1;
}

.cong-door__answer.is-yes {
	background: #e3f3e0;
	color: #14481b;
}

.cong-door__answer.is-no {
	background: #fdeceb;
	color: #7a1d1e;
}

/* Already checked in is neither good nor bad news, and a red screen would send
   the volunteer hunting for a problem that is not there. */
.cong-door__answer.is-again {
	background: #fff6e0;
	color: #6b4e00;
}

.cong-door__answer.is-many {
	background: var(--wp--preset--color--sky-light, #f3f8fb);
	display: block;
}

.cong-door__pick {
	display: block;
	width: 100%;
	text-align: left;
	margin: 0 0 0.4rem;
	padding: 0.8rem;
	font: inherit;
}

.cong-door__find {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: flex-end;
}

.cong-door__find label {
	flex: 1 1 100%;
	font-weight: 600;
}

.cong-door__find input {
	flex: 1 1 12rem;
	padding: 0.8rem;
	font-size: 1.3rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
	border-radius: var(--wp--custom--radius--sm, 4px);
}

.cong-door__find button,
.cong-door__scan button {
	padding: 0.8rem 1.2rem;
	font-size: 1.05rem;
}

.cong-door__scan {
	margin: 1rem 0;
}

.cong-door__scan video {
	width: 100%;
	max-height: 60vh;
	margin-top: 0.8rem;
	border-radius: var(--wp--custom--radius--md, 8px);
}

.cong-door__recent {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	color: var(--wp--preset--color--ink-muted, #5b6b78);
}

.cong-door__recent li {
	padding: 0.3rem 0;
	border-bottom: 1px solid var(--wp--preset--color--sky-mid, #d8e3ea);
}

/* ---------- Door: scanner mode ------------------------------------------- */

.cong-door__event {
	margin: 0 0 0.25rem;
	font-weight: 700;
	text-align: center;
}

.cong-door__seat {
	display: block;
	margin: 0.4rem 0 0.2rem;
	font-size: 1.6rem;
	line-height: 1.15;
}

.cong-door__answer.is-many p {
	margin: 0 0 0.6rem;
	font-weight: 600;
}

.cong-door__scan {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cong-door__scan video {
	flex: 1 1 100%;
}

#cong-door-mode[aria-pressed="true"] {
	background: var(--wp--preset--color--lime, #aebc21);
	color: var(--wp--preset--color--navy, #0b2a42);
}

html.cong-door-scanning,
html.cong-door-scanning body {
	overflow: hidden;
}

/*
 * On a scanner the door screen is the whole screen: no site header or
 * footer, the answer as big as the display allows, and the box still there
 * (it has to be, to keep focus) but out of the way.
 */
.cong-door.is-scanner {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	max-width: none;
	margin: 0;
	padding: 12px 16px;
	overflow-y: auto;
	background: #fff;
}

.cong-door.is-scanner .cong-door__answer {
	flex: 1 1 auto;
	min-height: 50vh;
	margin: 0.5rem 0;
	justify-content: center;
	text-align: center;
}

.cong-door.is-scanner .cong-door__answer strong {
	font-size: clamp(2rem, 9vw, 3.2rem);
}

.cong-door.is-scanner .cong-door__seat {
	font-size: clamp(1.6rem, 7vw, 2.6rem);
}

.cong-door.is-scanner .cong-door__answer span {
	font-size: 1.2rem;
}

.cong-door__answer.is-ready {
	background: var(--wp--preset--color--sky-light, #f3f8fb);
	color: var(--wp--preset--color--navy, #0b2a42);
}

.cong-door__answer.is-yes {
	background: #1f7a2e;
	color: #fff;
}

.cong-door__answer.is-again {
	background: #f2b705;
	color: #2b2000;
}

.cong-door__answer.is-no {
	background: #b32d2e;
	color: #fff;
}

.cong-door:not(.is-scanner) .cong-door__answer.is-yes {
	background: #e3f3e0;
	color: #14481b;
}

.cong-door:not(.is-scanner) .cong-door__answer.is-again {
	background: #fff6e0;
	color: #6b4e00;
}

.cong-door:not(.is-scanner) .cong-door__answer.is-no {
	background: #fdeceb;
	color: #7a1d1e;
}

.cong-door.is-scanner .cong-door__find input {
	font-size: 1rem;
	padding: 0.5rem;
}

.cong-door.is-scanner .cong-door__recent {
	margin-top: 0.5rem;
	font-size: 0.9rem;
}

.cong-door.is-scanner .cong-door__recent li:nth-child(n+4) {
	display: none;
}

/* The buttons: the site's own, big enough to press on a phone, plainly off when they cannot be used yet. */
.cong-tickets__button {
	min-height: 52px;
	padding-inline: 28px;
	font-size: 1.05rem;
	cursor: pointer;
}

.cong-tickets__go .cong-tickets__button,
.cong-checkout__go {
	min-width: min(100%, 18rem);
}

.cong-tickets__button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

@media (max-width: 600px) {
	.cong-tickets__go .cong-tickets__button,
	.cong-checkout__go {
		width: 100%;
	}
}

/* Paying: the form stays where it is, quietly busy, until Stripe answers. */
.cong-pay.is-working #cong-pay-element {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 150ms ease;
}

.cong-pay__status {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 12px 0;
	padding: 14px 16px;
	border-radius: 10px;
	background: #f4f8fb;
	color: #0b2a42;
	font-weight: 600;
}

.cong-pay__status[hidden] { display: none; }

.cong-pay__spinner {
	flex: none;
	width: 22px;
	height: 22px;
	border: 3px solid #c9d6e0;
	border-top-color: #04436a;
	border-radius: 50%;
	animation: cong-pay-spin 0.8s linear infinite;
}

@keyframes cong-pay-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.cong-pay__spinner { animation-duration: 2.4s; }
}

.cong-pay__note { margin: 4px 0 0; color: #4a6a7e; font-weight: 400; font-size: 0.95rem; }

/* Save as PDF: green, so it is the first thing seen once booked. */
.cong-tickets__print {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cong-tickets__pdf.wp-element-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--wp--preset--color--leaf, #637800);
	color: #fff;
}

.cong-tickets__pdf.wp-element-button:hover,
.cong-tickets__pdf.wp-element-button:focus-visible {
	background: #4f6000;
	color: #fff;
}

@media (max-width: 600px) {
	.cong-tickets__print .wp-element-button {
		flex: 1 1 100%;
		justify-content: center;
	}
}

