/**
 * Redtooth TD Assistant — frontend qualification form.
 *
 * All styles are scoped to .rtd-app so themes are not affected.
 */

.rtd-app {
	--rtd-accent: #ef4444;
	--rtd-accent-dark: #dc2626;
	--rtd-accent-soft: rgba(239, 68, 68, 0.14);
	--rtd-text: #e5e7eb;
	--rtd-muted: #94a3b8;
	--rtd-border: #2a3444;
	--rtd-surface: #151c26;
	--rtd-bg: #0f1620;
	--rtd-radius: 18px;
	--rtd-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);

	box-sizing: border-box;
	color-scheme: dark;
	display: grid;
	gap: 1rem;
	max-width: 44rem;
	margin: 0 auto;
	color: var(--rtd-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
}

.rtd-app *,
.rtd-app *::before,
.rtd-app *::after {
	box-sizing: border-box;
}

.rtd-app [hidden] {
	display: none !important;
}

.rtd-app p,
.rtd-app ul,
.rtd-app li {
	margin-top: 0;
}

.rtd-app h2,
.rtd-app h3 {
	margin: 0;
	color: var(--rtd-text);
	line-height: 1.25;
}

/* Hero */
.rtd-hero {
	position: relative;
	overflow: hidden;
	padding: 1.5rem;
	border: 1px solid rgba(239, 68, 68, 0.28);
	border-radius: var(--rtd-radius);
	background: linear-gradient(135deg, #2b0909 0%, #6b1212 55%, #991b1b 100%);
	box-shadow: var(--rtd-shadow);
	color: #fff;
}

/*rtd-hero::after {
	position: absolute;
	top: -3.5rem;
	right: -3rem;
	width: 11rem;
	height: 11rem;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	content: "";
	pointer-events: none;
}*/

.rtd-eyebrow {
	margin: 0 0 0.4rem;
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.rtd-app .rtd-hero__title {
	color: #fff;
	font-size: clamp(1.35rem, 4vw, 1.85rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.rtd-app .rtd-hero__venue {
	margin: 0.45rem 0 0;
	color: rgba(255, 255, 255, 0.88);
	font-weight: 600;
}

.rtd-app .rtd-hero__lead {
	max-width: 34rem;
	margin: 0.9rem 0 0;
	color: rgba(255, 255, 255, 0.94);
	font-size: 0.95rem;
}

/* Hero dates: stacked on phones, columns from 37.5em up. The hero only ever
   holds the registration close date, and only while registration is open. */
.rtd-app .rtd-hero__dates {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1.15rem 0 0;
}

.rtd-app .rtd-hero__date {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.rtd-app .rtd-hero__date-label {
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.rtd-app .rtd-hero__date-value,
.rtd-app .rtd-hero__date-time {
	color: #fff;
	font-size: 0.9rem;
	font-weight: 700;
}

/* The date and time share one line at every width: "Monday, 18 Jan 2027, 7:30pm". */
.rtd-app .rtd-hero__date-time::before {
	content: ", ";
}

/* Cards */
.rtd-card {
	padding: 1.25rem;
	border: 1px solid var(--rtd-border);
	border-radius: var(--rtd-radius);
	background: var(--rtd-surface);
	box-shadow: var(--rtd-shadow);
}

.rtd-card h3,
.rtd-card p,
.rtd-card label,
.rtd-card legend {
	color: inherit;
}

.rtd-card h3 {
	margin-bottom: 0.4rem;
	font-size: 1.1rem;
	font-weight: 700;
}

.rtd-card > p:last-child {
	margin-bottom: 0;
}

.rtd-muted {
	margin: 0.35rem 0 0;
	color: var(--rtd-muted);
	font-size: 0.92rem;
}

.rtd-hint {
	margin: 0.5rem 0 0;
	color: var(--rtd-muted);
	font-size: 0.82rem;
}

.rtd-footnote {
	margin: 0;
	color: var(--rtd-muted);
	font-size: 0.82rem;
	text-align: center;
}

.rtd-label {
	display: block;
	color: var(--rtd-muted);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Notices */
.rtd-notice-card {
	border-left: 5px solid var(--rtd-accent);
}

.rtd-notice-card h3 {
	font-size: 1.15rem;
}

.rtd-notice-card p {
	margin: 0.5rem 0 0;
	color: var(--rtd-muted);
}

.rtd-notice-icon {
	display: inline-grid;
	width: 2.5rem;
	height: 2.5rem;
	margin-bottom: 0.75rem;
	place-items: center;
	border-radius: 50%;
	background: var(--rtd-accent-soft);
	color: var(--rtd-accent);
	font-size: 1.2rem;
}

/* Combobox */
.rtd-combobox {
	margin-top: 1rem;
}

.rtd-combobox > .rtd-label {
	margin-bottom: 0.4rem;
}

.rtd-input-wrap {
	position: relative;
}

.rtd-input {
	width: 100%;
	min-height: 3.25rem;
	padding: 0.85rem 2.75rem 0.85rem 1rem;
	border: 2px solid var(--rtd-border);
	border-radius: 12px;
	background: #0c121a;
	color: var(--rtd-text);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	scroll-margin-top: 1rem;
	scroll-margin-bottom: 45vh;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rtd-input::placeholder {
	color: #64748b;
}

.rtd-input:focus {
	border-color: var(--rtd-accent);
	box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
	outline: none;
}

.rtd-spinner {
	position: absolute;
	top: 50%;
	right: 1rem;
	width: 1.15rem;
	height: 1.15rem;
	margin-top: -0.575rem;
	border: 2px solid rgba(239, 68, 68, 0.25);
	border-top-color: var(--rtd-accent);
	border-radius: 50%;
	animation: rtd-spin 0.8s linear infinite;
}

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

.rtd-results {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	max-height: 17rem;
	margin: 0.4rem 0 0;
	padding: 0.35rem;
	overflow-y: auto;
	border: 1px solid var(--rtd-border);
	border-radius: 12px;
	background: #131a24;
	box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
	list-style: none;
	-webkit-overflow-scrolling: touch;
}

.rtd-combobox {
	position: relative;
}

.rtd-result {
	margin: 0;
	padding: 0.75rem 0.85rem;
	border-radius: 8px;
	color: var(--rtd-text);
	cursor: pointer;
	font-size: 0.98rem;
	list-style: none;
}

.rtd-result:hover,
.rtd-result.is-active {
	background: var(--rtd-accent-soft);
	color: #fecaca;
}

.rtd-result[aria-selected="true"] {
	background: var(--rtd-accent-soft);
}

/* Events */
.rtd-events {
	display: grid;
	gap: 0.75rem;
	margin: 1rem 0;
}

.rtd-event {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 1rem;
	border: 1px solid var(--rtd-border);
	border-radius: 14px;
	background: linear-gradient(180deg, #1a232e 0%, #121922 100%);
}

.rtd-event__label {
	color: var(--rtd-accent);
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.rtd-event__date {
	font-size: 1.02rem;
	font-weight: 700;
}

.rtd-event__time {
	color: var(--rtd-muted);
	font-size: 0.92rem;
	font-weight: 600;
}

.rtd-event__location {
	margin-top: 0.15rem;
	color: var(--rtd-muted);
	font-size: 0.88rem;
}

.rtd-choice {
	margin: 0.85rem 0 0;
	padding: 0;
	border: 0;
}

.rtd-choice__legend {
	padding: 0;
	color: var(--rtd-muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rtd-choice__options {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.4rem;
}

.rtd-choice__option {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 1rem;
	border: 1px solid var(--rtd-border);
	border-radius: 999px;
	background: #0c121a;
	color: var(--rtd-text);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.rtd-choice__option:has( input:checked ) {
	border-color: var(--rtd-accent);
	background: var(--rtd-accent-soft);
	color: #fecaca;
}

.rtd-choice__option input {
	margin: 0;
	accent-color: var(--rtd-accent);
}

/* Player chip */
.rtd-player-chip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.9rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--rtd-border);
	border-radius: 12px;
	background: var(--rtd-bg);
}

.rtd-player-chip strong {
	display: block;
	font-size: 1.05rem;
}

.rtd-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--rtd-accent);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: underline;
}

.rtd-link:hover {
	color: var(--rtd-accent-dark);
}

/* Form */
.rtd-fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.rtd-legend {
	margin: 0 0 0.35rem;
	padding: 0;
	color: var(--rtd-text);
	font-size: 1.12rem;
	font-weight: 700;
}

.rtd-check {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
	margin: 0.75rem 0 0;
	padding: 1rem;
	border: 2px solid var(--rtd-border);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.rtd-check:hover {
	border-color: #fca5a5;
	background: #fffafa;
}

.rtd-check input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.rtd-check__box {
	position: relative;
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	margin-top: 0.1rem;
	border: 2px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.rtd-check input:checked + .rtd-check__box {
	border-color: var(--rtd-accent);
	background: var(--rtd-accent);
}

.rtd-check input:checked + .rtd-check__box::after {
	position: absolute;
	top: 0.1rem;
	left: 0.42rem;
	width: 0.4rem;
	height: 0.75rem;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	content: "";
	transform: rotate(45deg);
}

.rtd-check input:focus-visible + .rtd-check__box {
	outline: 3px solid rgba(185, 28, 28, 0.35);
	outline-offset: 2px;
}

.rtd-check__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.rtd-check__text strong {
	font-size: 0.98rem;
}

.rtd-check input:checked ~ .rtd-check__text strong {
	color: var(--rtd-accent-dark);
}

.rtd-check__text span {
	color: var(--rtd-muted);
	font-size: 0.88rem;
}

/* Feedback */
.rtd-app .rtd-error,
.rtd-app .rtd-status.is-error {
	margin: 0.9rem 0 0;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--rtd-accent);
	border-radius: 8px;
	background: rgba(239, 68, 68, 0.12);
	color: #fca5a5;
	font-size: 0.9rem;
	font-weight: 600;
}

.rtd-banner {
	margin: 0 0 1rem;
	padding: 1rem 1.15rem 1rem 2.85rem;
	border: 1px solid transparent;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
	position: relative;
}

.rtd-banner::before {
	position: absolute;
	top: 50%;
	left: 1.05rem;
	transform: translateY(-50%);
	font-size: 1.05rem;
	line-height: 1;
}

.rtd-banner a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.rtd-banner a:hover,
.rtd-banner a:focus {
	opacity: 0.85;
}

.rtd-banner--success {
	border-color: #14532d;
	background: #06281a;
	color: #86efac;
}

.rtd-banner--success::before {
	content: "\2713";
}

.rtd-banner--info {
	border-color: #1e3a8a;
	background: #0b1c33;
	color: #bfdbfe;
}

.rtd-banner--info::before {
	content: "i";
	font-family: Georgia, serif;
	font-weight: 700;
}

.rtd-banner--error {
	border-color: #7f1d1d;
	background: #2a0f0f;
	color: #fca5a5;
}

.rtd-banner--error::before {
	content: "!";
	font-weight: 800;
}

.rtd-status {
	min-height: 1.25rem;
	margin: 0.75rem 0 0;
	color: var(--rtd-muted);
	font-size: 0.88rem;
}

.rtd-status.is-success {
	color: #4ade80;
	font-weight: 600;
}

.rtd-loading {
	margin: 0.5rem 0 0.9rem;
	color: var(--rtd-muted);
	font-size: 0.88rem;
}

/* Actions */
.rtd-actions {
	display: grid;
	gap: 0.65rem;
	margin-top: 1rem;
}

.rtd-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	width: 100%;
	min-height: 3rem;
	padding: 0.9rem 1.4rem;
	border: 0;
	border-radius: 12px;
	background: var(--rtd-accent);
	box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25);
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.rtd-button:hover {
	background: var(--rtd-accent-dark);
	box-shadow: 0 10px 22px rgba(239, 68, 68, 0.32);
	color: #fff;
}

.rtd-button:active {
	transform: translateY(1px);
}

.rtd-button:focus-visible {
	outline: 3px solid rgba(239, 68, 68, 0.45);
	outline-offset: 3px;
}

.rtd-button:disabled {
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.6;
}

.rtd-button--ghost {
	border: 1px solid var(--rtd-border);
	background: transparent;
	box-shadow: none;
	color: var(--rtd-muted);
	font-weight: 600;
}

.rtd-button--ghost:hover {
	border-color: #3b4a5f;
	background: #0f1620;
	box-shadow: none;
	color: var(--rtd-text);
}

.rtd-button.is-loading::before {
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	content: "";
	animation: rtd-spin 0.8s linear infinite;
}

/* Larger screens */
@media (min-width: 37.5em) {
	.rtd-hero {
		padding: 1.9rem;
	}

	.rtd-app .rtd-hero__dates {
		flex-direction: row;
		justify-content: space-between;
		gap: 1.25rem;
		margin-top: 1.35rem;
	}

	.rtd-app .rtd-hero__date {
		flex: 1 1 0;
		/* Never squeeze a date onto a second line on narrow desktop widths. */
		min-width: max-content;
		align-items: flex-start;
		gap: 0.2rem;
		text-align: left;
	}

	.rtd-card {
		padding: 1.65rem;
	}

	.rtd-events {
		grid-template-columns: 1fr 1fr;
	}

	.rtd-actions {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.rtd-button {
		width: auto;
		min-width: 13rem;
	}
}

/* Confirmation modal */
.rtd-app .rtd-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.rtd-app .rtd-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 3, 7, 13, 0.72 );
	backdrop-filter: blur( 2px );
}

.rtd-app .rtd-modal__dialog {
	position: relative;
	width: min( 27rem, 100% );
	padding: 1.4rem;
	border: 1px solid var(--rtd-border);
	border-radius: 1rem;
	background: var(--rtd-surface);
	box-shadow: var(--rtd-shadow);
	color: var(--rtd-text);
}

.rtd-app .rtd-modal__title {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
}

.rtd-app .rtd-modal__message {
	margin: 0;
	color: var(--rtd-muted);
	font-size: 0.92rem;
	line-height: 1.5;
}

.rtd-app .rtd-modal__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.6rem;
	margin-top: 1.2rem;
}

.rtd-app .rtd-modal__actions .rtd-button {
	width: auto;
	min-height: 2.6rem;
	padding: 0.7rem 1.1rem;
}

/* Full-page route */
body.rtd-standalone {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	background: #080c12 radial-gradient( 70rem 32rem at 50% -12rem, #1b2534 0%, #0b1119 62%, #080c12 100% ) no-repeat;
	color: #e5e7eb;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
}

body.rtd-standalone .rtd-public-page {
	flex: 1;
}

.rtd-noscript {
	max-width: 44rem;
	margin: 0 auto 1rem;
	padding: 0.85rem 1rem;
	border: 1px solid #7f1d1d;
	border-radius: 0.75rem;
	background: #2a0f0f;
	color: #fca5a5;
}

.rtd-public-page {
	padding: 2.5rem 1rem 3.5rem;
}

.rtd-public-page__inner {
	width: 100%;
	max-width: 44rem;
	margin: 0 auto;
}

@media (min-width: 48em) {
	.rtd-public-page {
		padding-top: 3.5rem;
	}
}

/* Keep the name field above the on-screen keyboard on phones. */
@media (max-width: 48em) {
	.rtd-app {
		gap: 0.85rem;
	}

	.rtd-public-page {
		padding-top: 1.25rem;
		padding-bottom: 5rem;
	}

	body.rtd-standalone.rtd-keyboard-space .rtd-public-page {
		padding-bottom: 60vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rtd-app *,
	.rtd-app *::before,
	.rtd-app *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
