/**
 * RA (Registo de Atleta) front-end styles.
 *
 * Palette is deliberately federation-neutral (navy / steel / teal) —
 * NOT the Hardbody black+orange/gold brand, so this form (and its CSS)
 * can be reused unchanged for Hardbody 2027 or any other competition.
 */

.fed-reg-ra {
	--fed-navy: #12253f;
	--fed-navy-deep: #0a1830;
	--fed-steel: #5c7288;
	--fed-steel-light: #a9b7c4;
	--fed-teal: #12847d; /* darkened from initial #1fa8a0 — that failed WCAG AA (2.93:1) for the white CTA text */
	--fed-teal-deep: #0e7a74;
	--fed-paper: #f7f5f0;
	--fed-paper-dim: #ece8df;
	--fed-ink: #17202b;
	--fed-error-bg: #fff3b0;
	--fed-error-text: #7a5300;
	--fed-radius: 14px;

	max-width: 640px;
	margin: 0 auto;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	color: var(--fed-ink);
	box-sizing: border-box;
}

.fed-reg-ra *,
.fed-reg-ra *::before,
.fed-reg-ra *::after {
	box-sizing: inherit;
}

.fed-reg-ra__form {
	background: linear-gradient(165deg, var(--fed-paper) 0%, var(--fed-paper-dim) 100%);
	border: 1px solid rgba(18, 37, 63, 0.08);
	border-radius: var(--fed-radius);
	padding: 2rem;
	box-shadow: 0 20px 45px -25px rgba(10, 24, 48, 0.35);
}

/* Federation header — AFHCM + title + MOZ-BB, flanking the title the
   same way both logos flank the CATEGORIA box on the printed LineUps
   scoring sheets. */
.fed-reg-ra__header {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-bottom: 1.5rem;
	text-align: center;
}
.fed-reg-ra__logo {
	flex: none;
	max-height: 56px;
	width: auto;
}
.fed-reg-ra__title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--fed-navy);
	letter-spacing: 0.01em;
}
.fed-reg-ra__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem 1.25rem;
	margin-bottom: 1.5rem;
}

@media (max-width: 560px) {
	.fed-reg-ra__form {
		padding: 1.25rem;
	}
	.fed-reg-ra__grid {
		grid-template-columns: 1fr;
	}
	.fed-reg-ra__logo {
		max-height: 40px;
	}
	.fed-reg-ra__title {
		/* Forces its own line below both logos instead of the three
		   items fighting for space in one cramped row. */
		order: 1;
		width: 100%;
		font-size: 1.15rem;
	}
}

/* Floating-label field */
.fed-reg-field {
	position: relative;
}

.fed-reg-field__input {
	width: 100%;
	padding: 1.35rem 0.9rem 0.55rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--fed-ink);
	background: #fff;
	border: 1.5px solid var(--fed-steel-light);
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fed-reg-field__input:focus {
	outline: none;
	border-color: var(--fed-teal);
	box-shadow: 0 0 0 3px rgba(31, 168, 160, 0.18);
}

.fed-reg-field__label {
	position: absolute;
	left: 0.9rem;
	top: 0.95rem;
	font-size: 1rem;
	color: var(--fed-steel);
	pointer-events: none;
	transition: transform 0.15s ease, font-size 0.15s ease, color 0.15s ease, top 0.15s ease;
	transform-origin: left top;
}

.fed-reg-field__input:focus + .fed-reg-field__label,
.fed-reg-field__input:not(:placeholder-shown) + .fed-reg-field__label {
	top: 0.5rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--fed-teal-deep);
}

/* Static (non-floating) label variant — used for the date field, since
   <input type="date"> can't reliably report :placeholder-shown across browsers. */
.fed-reg-field__label--static {
	position: static;
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--fed-steel);
}
.fed-reg-field__input--static {
	padding: 0.75rem 0.9rem;
}

.fed-reg-field__note {
	margin: 0.35rem 0 0;
	font-size: 0.8rem;
	color: var(--fed-error-text);
	min-height: 1em;
}

.fed-reg-field.has-error .fed-reg-field__input,
.fed-reg-field--sexo.has-error {
	background-color: var(--fed-error-bg);
	border-color: #d3a400;
}
.fed-reg-field.has-error .fed-reg-field__input {
	background-color: var(--fed-error-bg);
}

/* Sexo fieldset */
.fed-reg-field--sexo {
	border: none;
	padding: 0;
	margin: 0;
}
.fed-reg-field__legend {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--fed-steel);
	margin-bottom: 0.5rem;
}
.fed-reg-field__options {
	display: flex;
	gap: 1.25rem;
	padding: 0.7rem 0.2rem;
}
.fed-reg-radio {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.95rem;
	cursor: pointer;
}
.fed-reg-field--sexo.has-error {
	border-radius: 10px;
	padding: 0.3rem 0.5rem;
	margin: -0.3rem -0.5rem;
}

/* Checkboxes */
.fed-reg-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	font-size: 0.88rem;
	color: var(--fed-navy);
	cursor: pointer;
	line-height: 1.35;
}
.fed-reg-checkbox input {
	margin-top: 0.2rem;
	accent-color: var(--fed-teal-deep);
	width: 1.05rem;
	height: 1.05rem;
	flex: none;
}
.fed-reg-checkbox--inline {
	margin-top: 0.5rem;
	font-size: 0.82rem;
}
.fed-reg-consent {
	margin-bottom: 0.3rem;
}

.fed-reg-field--honeypot {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* CTA */
.fed-reg-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.95rem 1.5rem;
	margin-top: 0.75rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	background: linear-gradient(120deg, var(--fed-teal) 0%, var(--fed-teal-deep) 100%);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 12px 24px -12px rgba(14, 122, 116, 0.65);
	transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.fed-reg-cta:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 16px 28px -12px rgba(14, 122, 116, 0.75);
}
.fed-reg-cta:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}
.fed-reg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1.4rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 999px;
	cursor: pointer;
	border: 1.5px solid var(--fed-steel-light);
	background: transparent;
	color: var(--fed-navy);
}
.fed-reg-btn--ghost:hover {
	background: rgba(18, 37, 63, 0.05);
}

/* Modals (RA.1 confirm / RA.2 success) */
.fed-reg-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.fed-reg-modal[hidden] {
	display: none;
}
.fed-reg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 120% at 50% 0%, rgba(18, 37, 63, 0.55), rgba(10, 24, 48, 0.8));
	backdrop-filter: blur(3px);
}
.fed-reg-modal__panel {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	border-radius: var(--fed-radius);
	padding: 1.75rem;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}
.fed-reg-modal__panel h2 {
	margin: 0 0 1rem;
	font-family: inherit;
	font-size: 1.3rem;
	color: var(--fed-navy);
}
.fed-reg-summary {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.4rem 1rem;
	margin: 0 0 1.25rem;
	font-size: 0.9rem;
}
.fed-reg-summary dt {
	font-weight: 600;
	color: var(--fed-steel);
}
.fed-reg-summary dd {
	margin: 0;
	color: var(--fed-ink);
}
.fed-reg-modal__actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.25rem;
}
.fed-reg-modal__actions .fed-reg-cta,
.fed-reg-modal__actions .fed-reg-btn {
	width: auto;
	flex: 1;
	margin-top: 0;
}

/* Toast (used for the "Estes campos são de preenchimento obrigatório!" popup and errors) */
.fed-reg-toast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	transform: translate(-50%, 10px);
	max-width: 90vw;
	background: var(--fed-navy);
	color: #fff;
	padding: 0.85rem 1.25rem;
	border-radius: 10px;
	font-size: 0.9rem;
	box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 1100;
}
.fed-reg-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
	.fed-reg-ra * {
		transition-duration: 0.001ms !important;
		animation-duration: 0.001ms !important;
	}
}
