/*
 * RE Auth — split-screen editorial design system for /login/ and /sign-up/.
 * Loaded via odr_login_assets_enqueue / odr_signup_assets_enqueue.
 *
 * Everything is scoped under .odr-auth so it never bleeds into the rest of
 * the dashboard. The parent's Bootstrap login chrome is overridden here.
 *
 * Restraint: brand green (--re-primary) appears ONLY on the primary action
 * button + tiny accents (focus rings, brand dot, footer underline). Links
 * and secondary text stay neutral.
 */

.odr-auth {
	/* brand palette — mirrors the approved mockup */
	--re-primary: #0cbd18;
	--re-primary-hover: #0aa215;
	--re-primary-tint: rgba(12, 189, 24, 0.10);

	--ink: #15201b;
	--ink-2: #36433c;
	--paper: #f7f6f1;
	--paper-2: #ffffff;
	--line: #e3e1d8;
	--muted: #6c736c;
	--panel: #16201b;
	--field-radius: 11px;

	/* keep the parent pw-meter's strongest tier on RE green */
	--rel-login-pw-strong: var(--re-primary);
}

/* ---------- shell / reset within scope ---------- */
.odr-auth {
	font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
	color: var(--ink);
	background: var(--paper);
	min-height: 100vh;
	min-height: 100dvh;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.odr-auth *,
.odr-auth *::before,
.odr-auth *::after {
	box-sizing: border-box;
}

.odr-auth__grid {
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	grid-template-columns: 1.05fr 1fr;
}

/* ---------- left brand panel ---------- */
.odr-brand {
	position: relative;
	background: var(--panel);
	color: #eef0ea;
	padding: 54px 56px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	isolation: isolate;
}

.odr-brand::before { /* faint research grid motif */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
	background-size: 34px 34px;
	-webkit-mask-image: radial-gradient(120% 90% at 20% 10%, #000 35%, transparent 78%);
	        mask-image: radial-gradient(120% 90% at 20% 10%, #000 35%, transparent 78%);
}

.odr-brand::after { /* single quiet green arc — the one brand flourish */
	content: "";
	position: absolute;
	z-index: -1;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	right: -200px;
	bottom: -220px;
	background: radial-gradient(circle at center, var(--re-primary-tint), transparent 62%);
}

.odr-brand__logo {
	display: flex;
	align-items: center;
	gap: 11px;
	font-weight: 600;
	letter-spacing: 0.2px;
}
.odr-brand__dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--re-primary);
	box-shadow: 0 0 0 4px var(--re-primary-tint);
}
.odr-brand__mark {
	font-family: "Fraunces", Georgia, serif;
	font-size: 1.18rem;
	color: #eef0ea;
}

.odr-brand__lead {
	max-width: 32ch;
}
.odr-brand__eyebrow {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #9aa49c;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.odr-brand__eyebrow::before {
	content: "";
	width: 26px;
	height: 1px;
	background: #56615a;
}
.odr-brand__title {
	font-family: "Fraunces", Georgia, serif;
	font-weight: 500;
	font-size: clamp(2.1rem, 3.4vw, 3rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: #eef0ea;
	margin: 0;
}
.odr-brand__title em {
	font-style: italic;
	color: var(--re-primary);
}
.odr-brand__sub {
	margin-top: 18px;
	color: #b9c0b8;
	font-size: 1.02rem;
	line-height: 1.55;
	max-width: 34ch;
}

.odr-brand__cta {
	border-top: 1px solid rgba(255, 255, 255, 0.10);
	padding-top: 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}
.odr-brand__k {
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8b948c;
	margin-bottom: 6px;
}
.odr-brand__cta a {
	color: #eef0ea;
	text-decoration: none;
	font-weight: 500;
	font-size: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	transition: gap 0.2s ease, color 0.2s ease;
}
.odr-brand__cta a .odr-arw {
	color: var(--re-primary);
	transition: transform 0.2s ease;
}
.odr-brand__cta a:hover {
	gap: 13px;
}
.odr-brand__cta a:hover .odr-arw {
	transform: translateX(3px);
}

/* ---------- right form panel ---------- */
.odr-form-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 40px;
	background: var(--paper);
}

.odr-card {
	width: 100%;
	max-width: 392px;
	animation: odr-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* signup form is wider (two-column rows) */
.odr-card.registration {
	max-width: 460px;
}

.odr-card__head {
	margin-bottom: 26px;
}
.odr-card__kicker {
	color: var(--muted);
	font-size: 0.86rem;
	margin-bottom: 8px;
}
.odr-card__title {
	font-family: "Fraunces", Georgia, serif;
	font-weight: 500;
	font-size: 2rem;
	letter-spacing: -0.01em;
	color: var(--ink);
	margin: 0;
}

/* ---------- google button (standard, colorful G) ---------- */
.odr-btn-google {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--field-radius);
	padding: 13px 16px;
	font-weight: 500;
	font-size: 1rem;
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.04s ease;
	box-shadow: 0 1px 2px rgba(20, 32, 27, 0.04);
}
.odr-btn-google:hover {
	border-color: #cfd3c8;
	box-shadow: 0 4px 14px -6px rgba(20, 32, 27, 0.18);
	color: var(--ink);
	text-decoration: none;
}
.odr-btn-google:focus-visible {
	outline: none;
	border-color: var(--re-primary);
	box-shadow: 0 0 0 3px var(--re-primary-tint);
}
.odr-btn-google:active {
	transform: translateY(1px);
}
.odr-gmark {
	width: 18px;
	height: 18px;
	flex: none;
}

/* ---------- app download buttons (RE-specific) ---------- */
.odr-app-row {
	display: flex;
	gap: 10px;
	margin-bottom: 16px;
}
.odr-app-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 10px 8px;
	font-size: 0.86rem;
	font-weight: 500;
	color: var(--ink-2);
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--field-radius);
	cursor: pointer;
	transition: border-color 0.16s ease, color 0.16s ease;
}
.odr-app-btn:hover {
	border-color: #cfd3c8;
	color: var(--ink);
}

/* ---------- divider ---------- */
.odr-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	color: var(--muted);
	font-size: 0.82rem;
	margin: 22px 0;
}
.odr-divider::before,
.odr-divider::after {
	content: "";
	height: 1px;
	background: var(--line);
	flex: 1;
}

/* ---------- fields ---------- */
.odr-field {
	position: relative;
	margin-bottom: 14px;
}
.odr-field label,
.odr-field > label {
	display: block;
	font-size: 0.8rem;
	color: var(--muted);
	margin-bottom: 7px;
	font-weight: 500;
}
.odr-field-row {
	display: flex;
	gap: 14px;
}
.odr-field-row > .odr-field {
	flex: 1;
}

.odr-control {
	width: 100%;
	padding: 13px 14px;
	font-family: inherit;
	font-size: 1rem;
	color: var(--ink);
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-radius: var(--field-radius);
	transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea.odr-control {
	min-height: 48px;
	resize: vertical;
}
.odr-control::placeholder {
	color: #aeb3aa;
}
.odr-control:focus {
	outline: none;
	border-color: var(--re-primary);
	box-shadow: 0 0 0 3px var(--re-primary-tint);
}

/* password field + eye toggle */
.odr-field--pw .odr-control {
	padding-right: 44px;
}
.odr-eye {
	position: absolute;
	right: 8px;
	bottom: 7px;
	width: 34px;
	height: 34px;
	border: none;
	background: none;
	display: grid;
	place-items: center;
	color: var(--muted);
	cursor: pointer;
	border-radius: 8px;
	padding: 0;
	transition: color 0.14s ease, background 0.14s ease;
}
.odr-eye:hover {
	color: var(--ink);
	background: var(--line);
}
.odr-eye:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--re-primary-tint);
}

/* ---------- OTP (single clean input, centered) ---------- */
.otp-div {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin-bottom: 12px;
}
.odr-field--otp {
	flex: 1;
	margin-bottom: 0;
}
.odr-field--otp .odr-control {
	text-align: center;
	letter-spacing: 0.5em;
	font-size: 1.2rem;
	font-weight: 600;
	padding-left: 1em; /* offset letter-spacing so text stays centered */
}
.odr-otp-action {
	flex: none;
	display: flex;
	align-items: center;
	gap: 6px;
	padding-bottom: 1px;
}
.odr-otp-action .btn {
	border-radius: var(--field-radius);
	white-space: nowrap;
}

/* OTP receive-on options */
.odr-otp-options {
	color: var(--muted);
	font-size: 0.84rem;
	margin-bottom: 14px;
	line-height: 1.8;
}
.odr-otp-options label {
	font-weight: 500;
	margin-right: 4px;
}
.odr-otp-options input[type="checkbox"] {
	margin-left: 10px;
	margin-right: 3px;
	vertical-align: middle;
}

/* phone row (signup) */
.odr-phone-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin-bottom: 14px;
}
.odr-field--phone {
	flex: 1;
	margin-bottom: 0;
}
.odr-phone-row .odr-otp-action {
	padding-bottom: 1px;
}

/* terms checkbox */
.odr-terms {
	margin: 16px 0 18px;
	font-size: 0.9rem;
	color: var(--ink-2);
}
.odr-terms a {
	color: var(--ink);
	border-bottom: 1px solid var(--re-primary);
	text-decoration: none;
}

/* ---------- primary action — the only strong green ---------- */
.odr-btn-primary {
	width: 100%;
	padding: 14px 16px;
	font-family: inherit;
	font-weight: 600;
	font-size: 1rem;
	color: #fff;
	background: var(--re-primary);
	border: none;
	border-radius: var(--field-radius);
	cursor: pointer;
	transition: background 0.16s ease, transform 0.04s ease, box-shadow 0.16s ease;
	box-shadow: 0 6px 18px -8px rgba(12, 189, 24, 0.6);
}
.odr-btn-primary:hover,
.odr-btn-primary:focus {
	background: var(--re-primary-hover);
	color: #fff;
}
.odr-btn-primary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--re-primary-tint), 0 6px 18px -8px rgba(12, 189, 24, 0.6);
}
.odr-btn-primary:active {
	transform: translateY(1px);
}
.odr-btn-primary.btn-disabled,
.odr-btn-primary:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
}

/* ---------- secondary / quiet links ---------- */
.odr-row-alt {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}
.odr-inline-links {
	display: flex;
	justify-content: space-between;
	margin: 4px 0 16px;
}
.odr-link-quiet {
	background: none;
	border: none;
	font-family: inherit;
	font-size: 0.92rem;
	color: var(--muted);
	cursor: pointer;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding: 0 0 1px;
	transition: color 0.16s ease, border-color 0.16s ease;
}
.odr-link-quiet:hover,
.odr-link-quiet:focus {
	color: var(--ink);
	border-color: var(--ink);
	text-decoration: none;
}

/* ---------- footer ---------- */
.odr-foot {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	text-align: center;
	color: var(--muted);
	font-size: 0.92rem;
}
.odr-foot a {
	color: var(--ink);
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px solid var(--re-primary);
}
.odr-foot a:hover {
	color: var(--re-primary-hover);
}

.odr-back-site {
	margin-top: 20px;
	text-align: center;
	font-size: 0.86rem;
}
.odr-back-site a {
	color: var(--muted);
	text-decoration: none;
}
.odr-back-site a:hover {
	color: var(--ink);
}

/* ---------- ajax-result / alerts inside scope ---------- */
.odr-auth .ajax-result {
	border-radius: var(--field-radius);
	font-size: 0.9rem;
	margin-bottom: 14px;
}
/* Override Bootstrap's default .alert-success (pale mint text on pale mint
   fill) — unreadable against this page's cream background. Same brand green
   already used deliberately for the primary button, at readable strength:
   dark ink text (not colour-on-colour), a solid readable border, faint tint
   fill. Not introducing a new colour, just applying the existing one properly. */
.odr-auth .ajax-result.alert-success {
	color: var(--ink);
	background: var(--re-primary-tint);
	border: 1px solid var(--re-primary);
}

/* turnstile spacing */
.odr-auth .cf-turnstile {
	margin-bottom: 14px;
}

/* ---------- OTP verify: full-width input + full-width button below ---------- */
/* Stack the OTP field and its Verify button vertically. Auto-submit fires on
   the 4th digit, so Verify is a fallback — placed below, full width, the
   conventional layout. */
.odr-field--otp-block {
	width: 100%;
	margin-bottom: 10px;
}
.odr-otp-action--block {
	display: block;
	padding: 0;
	margin-bottom: 14px;
}
.odr-otp-action--block .btn-verify-otp {
	width: 100%;
	padding: 12px 16px;
	font-size: 0.95rem;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
/* The two --block rules above only style THEIR OWN box — the shared parent,
   .otp-div, was still the plain side-by-side flex row (see .otp-div below),
   so "full width" just meant full width of whatever sliver of the row each
   child flex-shrank into, not the actual page width. Stack the parent too
   whenever it holds the block variant, so the field and button really do
   land on their own lines. */
.otp-div:has(.odr-field--otp-block) {
	flex-direction: column;
	align-items: stretch;
}

/* ---------- Resend OTP: quiet plain-text link, not a CTA button ---------- */
/* After Send OTP, the button is re-labelled "Resend OTP (in Ns)". Once it is
   no longer the primary action, strip the button chrome down to a muted text
   link with a countdown. We only style the resend state (it gains .disabled
   then .btn-primary when ready); the initial Send-OTP keeps full CTA styling. */
.odr-auth .btn-send-otp.is-resend {
	width: auto;
	display: inline-block;
	padding: 2px 0;
	margin: 4px 0 8px;
	background: none;
	box-shadow: none;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 500;
	border: none;
}
.odr-auth .btn-send-otp.is-resend:hover,
.odr-auth .btn-send-otp.is-resend:focus {
	background: none;
	color: var(--ink);
	text-decoration: underline;
}
.odr-auth .btn-send-otp.is-resend.btn-disabled,
.odr-auth .btn-send-otp.is-resend.disabled {
	opacity: 1;            /* countdown text should be readable, not dimmed */
	cursor: default;
	color: var(--muted);
}
.odr-auth .btn-send-otp.is-resend .countdown_timer_container {
	color: var(--muted);
}

/* ---------- Turnstile gating: "Verifying…" affordance on disabled button -- */
.odr-auth .odr-btn-primary.odr-verifying {
	position: relative;
}
.odr-auth .odr-btn-primary.odr-verifying::after {
	content: " — verifying…";
	font-weight: 500;
	opacity: 0.85;
}

/* ---------- Email-mode collapse of intlTelInput country/flag selector ------ */
/* When the OTP-login identifier looks like an email (or any non-dial value),
   hide the country/flag chooser and reclaim intl-tel-input's left padding so
   the email reads naturally. Class is toggled in login.js on input. */
.iti--email-mode .iti__flag-container,
.iti--email-mode .iti__country-container,
.iti--email-mode .iti__selected-country,
.iti--email-mode .iti__selected-dial-code {
	display: none !important;
}
.iti--email-mode .iti__tel-input,
.iti--email-mode input#login-user {
	padding-left: 12px !important;
}

/* ---------- motion ---------- */
@keyframes odr-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.odr-card { animation: none; }
	.odr-auth * { transition: none !important; }
}

/* ---------- responsive: brand panel collapses to a slim header ---------- */
@media (max-width: 880px) {
	.odr-auth__grid {
		grid-template-columns: 1fr;
	}
	.odr-brand {
		padding: 26px 24px;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
	}
	.odr-brand__lead,
	.odr-brand__cta {
		display: none;
	}
	.odr-form-wrap {
		padding: 36px 22px;
	}
}

@media (max-width: 575.98px) {
	.odr-field-row {
		flex-direction: column;
		gap: 0;
	}
	.odr-app-row {
		flex-direction: column;
	}
	.odr-form-wrap {
		padding: 28px 18px;
	}
	.odr-card,
	.odr-card.registration {
		max-width: 100%;
	}
}
