/*
 * NextEG auth pages: login (application/views/login_view.php) and splash (logo_view.php).
 * Standalone: the shell stylesheet logo/css/nexteg-brand.css is not loaded here.
 * Brand: navy #0c1a31 + orange #fe5903 (sampled from the NextEG logo).
 * Theme: <html data-theme="dark|light"> from the neg_theme cookie, else the device (prefers-color-scheme).
 */

/* ------------------------------------------------------------------ tokens */
:root {
	--brand-navy: #0c1a31;
	--brand-orange: #fe5903;
	--font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--radius: 22px;
	--radius-md: 14px;
	--radius-sm: 10px;
	--ease: cubic-bezier(.2, .8, .2, 1);
	--ease-spring: cubic-bezier(.34, 1.56, .64, 1);

	/* dark (default) */
	--bg: #070d1a;
	--bg-2: #0b1528;
	--surface: rgba(14, 24, 44, .78);
	--surface-solid: #0e182c;
	--surface-2: rgba(255, 255, 255, .04);
	--border: rgba(148, 163, 184, .16);
	--border-strong: rgba(148, 163, 184, .30);
	--text: #eef2f8;
	--muted: #9aa8bd;
	--link: #ff8a4c;
	--accent: #fe5903;
	--btn-1: #d24607;
	--btn-2: #b93c05;
	--btn-text: #ffffff;
	--focus: rgba(254, 89, 3, .55);
	--input-bg: rgba(7, 13, 26, .55);
	--error-bg: rgba(255, 107, 107, .10);
	--error-border: rgba(255, 107, 107, .35);
	--error-text: #ffb4b4;
	--ok: #34d399;
	--ok-soft: rgba(52, 211, 153, .14);
	--warn-text: #fcd34d;
	--shadow: 0 30px 60px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .03) inset;
	--orb-1: rgba(254, 89, 3, .32);
	--orb-2: rgba(37, 99, 235, .22);
	--orb-3: rgba(254, 140, 60, .18);
	--grid: rgba(148, 163, 184, .07);
	--panel-tint: linear-gradient(160deg, rgba(254, 89, 3, .10) 0%, rgba(12, 26, 49, 0) 55%);
	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		--bg: #f4f6fb;
		--bg-2: #e9eef7;
		--surface: rgba(255, 255, 255, .86);
		--surface-solid: #ffffff;
		--surface-2: rgba(12, 26, 49, .035);
		--border: rgba(12, 26, 49, .10);
		--border-strong: rgba(12, 26, 49, .22);
		--text: #0c1a31;
		--muted: #55657c;
		--link: #c2410c;
		--focus: rgba(210, 70, 7, .45);
		--input-bg: #ffffff;
		--error-bg: #fff1f1;
		--error-border: #f5b5b5;
		--error-text: #b42318;
		--ok: #0f8a5f;
		--ok-soft: rgba(15, 138, 95, .10);
		--warn-text: #8a5a00;
		--shadow: 0 30px 60px -28px rgba(12, 26, 49, .35), 0 0 0 1px rgba(12, 26, 49, .04);
		--orb-1: rgba(254, 89, 3, .20);
		--orb-2: rgba(37, 99, 235, .14);
		--orb-3: rgba(254, 140, 60, .16);
		--grid: rgba(12, 26, 49, .05);
		--panel-tint: linear-gradient(160deg, rgba(254, 89, 3, .08) 0%, rgba(255, 255, 255, 0) 60%);
		color-scheme: light;
	}
}

:root[data-theme="light"] {
	--bg: #f4f6fb;
	--bg-2: #e9eef7;
	--surface: rgba(255, 255, 255, .86);
	--surface-solid: #ffffff;
	--surface-2: rgba(12, 26, 49, .035);
	--border: rgba(12, 26, 49, .10);
	--border-strong: rgba(12, 26, 49, .22);
	--text: #0c1a31;
	--muted: #55657c;
	--link: #c2410c;
	--focus: rgba(210, 70, 7, .45);
	--input-bg: #ffffff;
	--error-bg: #fff1f1;
	--error-border: #f5b5b5;
	--error-text: #b42318;
	--ok: #0f8a5f;
	--ok-soft: rgba(15, 138, 95, .10);
	--warn-text: #8a5a00;
	--shadow: 0 30px 60px -28px rgba(12, 26, 49, .35), 0 0 0 1px rgba(12, 26, 49, .04);
	--orb-1: rgba(254, 89, 3, .20);
	--orb-2: rgba(37, 99, 235, .14);
	--orb-3: rgba(254, 140, 60, .16);
	--grid: rgba(12, 26, 49, .05);
	--panel-tint: linear-gradient(160deg, rgba(254, 89, 3, .08) 0%, rgba(255, 255, 255, 0) 60%);
	color-scheme: light;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body.auth {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	transition: background-color .35s var(--ease), color .35s var(--ease);
}

[hidden] {
	display: none !important;
}

button,
input {
	font: inherit;
	color: inherit;
}

.ic {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.skip-link {
	position: absolute;
	inset-inline-start: 12px;
	top: -60px;
	z-index: 50;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--surface-solid);
	color: var(--text);
	box-shadow: var(--shadow);
	transition: top .2s var(--ease);
}

.skip-link:focus {
	top: 12px;
}

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ animated background */
.auth-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

.orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	will-change: transform;
}

.orb-1 {
	width: 46vmax;
	height: 46vmax;
	inset-inline-end: -12vmax;
	top: -14vmax;
	background: radial-gradient(circle, var(--orb-1) 0%, transparent 65%);
	animation: drift-1 22s ease-in-out infinite alternate;
}

.orb-2 {
	width: 40vmax;
	height: 40vmax;
	inset-inline-start: -14vmax;
	bottom: -16vmax;
	background: radial-gradient(circle, var(--orb-2) 0%, transparent 65%);
	animation: drift-2 26s ease-in-out infinite alternate;
}

.orb-3 {
	width: 26vmax;
	height: 26vmax;
	inset-inline-start: 30%;
	top: 35%;
	background: radial-gradient(circle, var(--orb-3) 0%, transparent 65%);
	animation: drift-3 30s ease-in-out infinite alternate;
}

.grid-veil {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 44px 44px;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

@keyframes drift-1 {
	to {
		transform: translate3d(-6vmax, 5vmax, 0) scale(1.08);
	}
}

@keyframes drift-2 {
	to {
		transform: translate3d(5vmax, -4vmax, 0) scale(1.1);
	}
}

@keyframes drift-3 {
	to {
		transform: translate3d(-4vmax, -5vmax, 0) scale(.92);
	}
}

/* ------------------------------------------------------------------ theme toggle */
.theme-toggle {
	position: fixed;
	top: max(14px, env(safe-area-inset-top));
	inset-inline-end: max(14px, env(safe-area-inset-left));
	z-index: 20;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transition: transform .25s var(--ease), border-color .2s, background-color .35s;
}

.theme-toggle:hover {
	transform: rotate(-12deg) scale(1.05);
	border-color: var(--border-strong);
}

.theme-toggle .ic {
	width: 20px;
	height: 20px;
}

.theme-ic {
	grid-area: 1 / 1;
	display: grid;
	transition: opacity .3s var(--ease), transform .45s var(--ease-spring);
}

/* dark → show the sun (switch to light); light → show the moon */
.theme-ic-moon {
	opacity: 0;
	transform: rotate(-90deg) scale(.5);
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) .theme-ic-sun {
		opacity: 0;
		transform: rotate(90deg) scale(.5);
	}

	:root:not([data-theme="dark"]) .theme-ic-moon {
		opacity: 1;
		transform: none;
	}
}

:root[data-theme="light"] .theme-ic-sun {
	opacity: 0;
	transform: rotate(90deg) scale(.5);
}

:root[data-theme="light"] .theme-ic-moon {
	opacity: 1;
	transform: none;
}

/* ------------------------------------------------------------------ layout */
.auth-layout {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	min-height: 100vh;
	min-height: 100dvh;
}

/* brand panel */
.brand-panel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 48px;
	background: var(--panel-tint);
	border-inline-end: 1px solid var(--border);
	overflow: hidden;
}

.brand-inner {
	position: relative;
	max-width: 460px;
	width: 100%;
	animation: rise .8s var(--ease) both;
}

.brand-logo img {
	display: block;
	width: min(320px, 80%);
	height: auto;
	margin-bottom: 26px;
	filter: drop-shadow(0 10px 30px rgba(254, 89, 3, .18));
}

.brand-subtitle {
	margin: 0 0 6px;
	font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem);
	font-weight: 800;
	line-height: 1.35;
	color: var(--text);
}

.brand-tagline {
	margin: 0 0 28px;
	color: var(--muted);
	font-size: 1.02rem;
}

.brand-points {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	gap: 12px;
}

.brand-points li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
	animation: rise .7s var(--ease) both;
}

.brand-points li:nth-child(1) {
	animation-delay: .15s;
}

.brand-points li:nth-child(2) {
	animation-delay: .25s;
}

.brand-points li:nth-child(3) {
	animation-delay: .35s;
}

.pt-ic {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	color: var(--accent);
	background: rgba(254, 89, 3, .12);
	border: 1px solid rgba(254, 89, 3, .22);
}

.brand-tagline-en {
	margin: 0;
	color: var(--muted);
	font-size: .85rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .8;
	text-align: right;
}

/* form panel */
.form-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 72px 28px 32px;
	outline: none;
}

.auth-card {
	position: relative;
	width: 100%;
	max-width: 440px;
	padding: 36px 34px 30px;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	animation: card-in .7s var(--ease) both;
	transition: background-color .35s var(--ease), border-color .35s var(--ease);
}

/* thin brand line on top of the card */
.auth-card::before {
	content: "";
	position: absolute;
	inset-inline: 28px;
	top: -1px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, transparent, var(--brand-orange), transparent);
	opacity: .9;
}

/* CodeMind, owner, designer, developer and programmer of NextEG (owner decision 2026-11-19) */
.owner-line {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	color: var(--muted);
	font-size: .84rem;
	font-weight: 600;
	text-decoration: none;
	transition: color .2s, background-color .2s;
}

.owner-line img {
	flex: none;
}

.owner-line b {
	color: var(--text);
	font-weight: 800;
}

.owner-line:hover,
.owner-line:focus-visible {
	color: var(--text);
	background: var(--surface-2);
}

.brand-owner {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-top: 34px;
	padding: 14px 18px 12px;
	border-radius: 16px;
	border: 1px solid var(--border);
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(91, 75, 255, .10) 0%, transparent 55%),
		radial-gradient(120% 140% at 100% 100%, rgba(34, 211, 238, .10) 0%, transparent 55%),
		var(--surface-2);
	color: var(--muted);
	text-decoration: none;
	transition: border-color .2s var(--ease), transform .2s var(--ease);
	/* backwards, not both: a held final transform would cancel the hover lift */
	animation: rise .8s .45s var(--ease) backwards;
}

.brand-owner:hover,
.brand-owner:focus-visible {
	border-color: rgba(59, 130, 246, .55);
	transform: translateY(-2px);
}

.brand-owner img {
	display: block;
	width: 230px;
	max-width: 100%;
	height: auto;
}

.brand-owner-kicker,
.brand-owner-roles {
	font-size: .8rem;
	font-weight: 700;
}

.brand-owner-roles {
	color: var(--text);
	opacity: .85;
}

.splash-owner {
	align-items: center;
	margin-top: 26px;
}

.splash-owner .brand-owner-roles {
	max-width: 360px;
	text-align: center;
	font-weight: 600;
	line-height: 1.7;
}

.splash-copy {
	margin: 14px 0 0;
	color: var(--muted);
	font-size: .78rem;
}

@keyframes card-in {
	from {
		opacity: 0;
		transform: translateY(18px) scale(.985);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ------------------------------------------------------------------ steps */
.step {
	animation: step-in .45s var(--ease) both;
}

.step.is-back {
	animation-name: step-in-back;
}

@keyframes step-in {
	from {
		opacity: 0;
		transform: translateX(-22px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes step-in-back {
	from {
		opacity: 0;
		transform: translateX(22px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.step-head {
	margin-bottom: 22px;
}

.step-head h1,
.success-title {
	margin: 0 0 6px;
	font-size: 1.65rem;
	font-weight: 800;
	line-height: 1.3;
	outline: none;
}

.step-lead {
	margin: 0;
	color: var(--muted);
	font-size: .97rem;
}

.step-lead b {
	color: var(--text);
	font-weight: 700;
	unicode-bidi: isolate;
}

/* stepper */
.stepper {
	list-style: none;
	display: flex;
	gap: 6px;
	margin: 0 0 20px;
	padding: 0;
	font-size: .8rem;
	color: var(--muted);
}

.stepper li {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-weight: 600;
}

.stepper li span {
	display: block;
	height: 4px;
	border-radius: 4px;
	background: var(--border);
	font-size: 0;
	overflow: hidden;
	position: relative;
}

.stepper li span::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--btn-2), var(--brand-orange));
	transform: scaleX(0);
	transform-origin: right;
	transition: transform .6s var(--ease);
}

.stepper li.is-done span::after,
.stepper li.is-current span::after {
	transform: scaleX(1);
}

.stepper li.is-current {
	color: var(--text);
}

/* ------------------------------------------------------------------ fields */
.field {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.field>label,
.field>legend {
	display: block;
	margin-bottom: 7px;
	padding: 0;
	font-size: .92rem;
	font-weight: 700;
}

.control {
	position: relative;
	display: flex;
	align-items: center;
}

.control input {
	width: 100%;
	height: 52px;
	/* physical sides: the page is RTL but the e-mail / password fields are LTR, and the icon stays on the right */
	padding: 0 46px 0 16px;
	border-radius: var(--radius-md);
	border: 1.5px solid var(--border-strong);
	background: var(--input-bg);
	font-size: 1rem;
	transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .35s var(--ease);
}

.control input[dir="ltr"] {
	text-align: left;
}

.control input::placeholder {
	color: var(--muted);
	opacity: .65;
	font-size: .9rem;
}

.control input:hover {
	border-color: var(--muted);
}

.control input:focus {
	outline: none;
	border-color: var(--brand-orange);
	box-shadow: 0 0 0 4px rgba(254, 89, 3, .16);
}

.control input[aria-invalid="true"] {
	border-color: var(--error-border);
}

.control-ic {
	position: absolute;
	right: 15px;
	display: grid;
	color: var(--muted);
	pointer-events: none;
	transition: color .2s var(--ease);
}

.control:focus-within .control-ic {
	color: var(--brand-orange);
}

.control.has-reveal input {
	padding-left: 52px;
}

.reveal {
	position: absolute;
	left: 5px;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: color .2s, background-color .2s;
}

.reveal:hover {
	color: var(--text);
	background: var(--surface-2);
}

.reveal .reveal-hide,
.reveal[aria-pressed="true"] .reveal-show {
	display: none;
}

.reveal[aria-pressed="true"] .reveal-hide {
	display: grid;
}

.reveal-show,
.reveal-hide {
	display: grid;
}

.field-help {
	margin: 6px 2px 0;
	font-size: .82rem;
	color: var(--muted);
}

.caps-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 7px 2px 0;
	font-size: .83rem;
	font-weight: 600;
	color: var(--warn-text);
	animation: rise .25s var(--ease) both;
}

/* checkbox */
.row-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0 18px;
	flex-wrap: wrap;
}

.check {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	cursor: pointer;
	font-size: .93rem;
	font-weight: 600;
	user-select: none;
}

/* the real checkbox lies over the drawn box, so it is the click / tap target */
.check input {
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	z-index: 1;
	width: 20px;
	height: 20px;
	margin: -10px 0 0;
	opacity: 0;
	cursor: pointer;
}

.check-box {
	width: 20px;
	height: 20px;
	border-radius: 6px;
	border: 1.5px solid var(--border-strong);
	background: var(--input-bg);
	display: grid;
	place-items: center;
	transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease-spring);
}

.check-box::after {
	content: "";
	width: 10px;
	height: 6px;
	border: 2.2px solid #fff;
	border-top: 0;
	border-right: 0;
	transform: rotate(-45deg) scale(0);
	margin-top: -2px;
	transition: transform .25s var(--ease-spring);
}

.check input:checked+.check-box {
	background: var(--btn-1);
	border-color: var(--btn-1);
	transform: scale(1.05);
}

.check input:checked+.check-box::after {
	transform: rotate(-45deg) scale(1);
}

.check input:focus-visible+.check-box {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

/* links */
.link-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--link);
	font-weight: 700;
	font-size: .93rem;
	cursor: pointer;
	border-radius: 8px;
	text-decoration: none;
	transition: color .2s, opacity .2s;
}

.link-btn:hover:not(:disabled) {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.link-btn:disabled {
	color: var(--muted);
	cursor: default;
	opacity: .7;
}

.back-link {
	margin-top: 14px;
}

.back-link .ic {
	transform: scaleX(-1);
}

/* ------------------------------------------------------------------ alerts */
.alert {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: var(--radius-md);
	border: 1px solid var(--error-border);
	background: var(--error-bg);
	color: var(--error-text);
	font-size: .93rem;
	font-weight: 600;
	animation: rise .3s var(--ease) both;
}

.alert .ic {
	margin-top: 3px;
}

.shake {
	animation: shake .42s var(--ease);
}

@keyframes shake {

	10%,
	90% {
		transform: translateX(-1px);
	}

	20%,
	80% {
		transform: translateX(3px);
	}

	30%,
	50%,
	70% {
		transform: translateX(-6px);
	}

	40%,
	60% {
		transform: translateX(6px);
	}
}

/* ------------------------------------------------------------------ buttons */
.btn-primary {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--radius-md);
	background: linear-gradient(135deg, var(--btn-1) 0%, var(--btn-2) 100%);
	color: var(--btn-text);
	font-size: 1.04rem;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	box-shadow: 0 12px 24px -12px rgba(210, 70, 7, .75);
	transition: transform .2s var(--ease), box-shadow .25s var(--ease), filter .2s;
}

/* moving sheen */
.btn-primary::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
	transform: translateX(110%);
	transition: transform .7s var(--ease);
}

.btn-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 16px 30px -12px rgba(210, 70, 7, .85);
}

.btn-primary:hover:not(:disabled)::before {
	transform: translateX(-110%);
}

.btn-primary:active:not(:disabled) {
	transform: translateY(1px) scale(.99);
}

.btn-primary:disabled {
	cursor: progress;
}

.btn-ic {
	display: grid;
	transform: scaleX(-1);
	transition: transform .25s var(--ease);
}

.btn-primary:hover:not(:disabled) .btn-ic {
	transform: scaleX(-1) translateX(4px);
}

.spinner {
	display: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	animation: spin .7s linear infinite;
}

.btn-primary.is-busy .spinner {
	display: block;
}

.btn-primary.is-busy .btn-ic {
	display: none;
}

.btn-primary.is-done {
	background: linear-gradient(135deg, #12a26f, #0e8a5e);
	box-shadow: 0 12px 24px -12px rgba(18, 162, 111, .8);
}

.btn-primary.is-done .btn-ic,
.btn-primary.is-done .spinner {
	display: none;
}

.btn-quiet {
	margin-top: 22px;
}

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

.foot-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px dashed var(--border);
	color: var(--muted);
	font-size: .87rem;
}

/* ------------------------------------------------------------------ OTP */
.otp-field {
	margin-bottom: 20px;
}

.otp {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
}

.otp-box {
	width: 100%;
	height: 58px;
	padding: 0;
	border-radius: var(--radius-md);
	border: 1.5px solid var(--border-strong);
	background: var(--input-bg);
	text-align: center;
	font-size: 1.5rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	caret-color: var(--brand-orange);
	transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease-spring);
}

.otp-box:focus {
	outline: none;
	border-color: var(--brand-orange);
	box-shadow: 0 0 0 4px rgba(254, 89, 3, .16);
	transform: translateY(-2px);
}

.otp-box.is-filled {
	border-color: var(--brand-orange);
	animation: pop .22s var(--ease-spring);
}

.otp.is-invalid .otp-box {
	border-color: var(--error-border);
}

@keyframes pop {
	50% {
		transform: scale(1.08);
	}
}

.resend-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 8px;
	font-size: .88rem;
	flex-wrap: wrap;
}

.muted {
	color: var(--muted);
}

/* ------------------------------------------------------------------ password rules */
.pw-rules {
	list-style: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 12px;
	margin: -2px 0 18px;
	padding: 12px 14px;
	border-radius: var(--radius-md);
	background: var(--surface-2);
	border: 1px solid var(--border);
	font-size: .83rem;
	color: var(--muted);
}

.pw-rules li {
	display: flex;
	align-items: center;
	gap: 8px;
	transition: color .25s var(--ease);
}

.pw-rules li::before {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1.5px solid var(--border-strong);
	background: transparent center / 10px no-repeat;
	transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .3s var(--ease-spring);
}

.pw-rules li.is-ok {
	color: var(--ok);
}

.pw-rules li.is-ok::before {
	border-color: var(--ok);
	background-color: var(--ok);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	transform: scale(1.08);
}

/* ------------------------------------------------------------------ success */
.step-success {
	text-align: center;
}

.step-success .stepper {
	text-align: start;
}

.success-mark {
	width: 92px;
	height: 92px;
	margin: 10px auto 18px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--ok-soft);
	animation: pop-in .55s var(--ease-spring) both;
}

.success-mark svg {
	width: 62px;
	height: 62px;
	fill: none;
	stroke: var(--ok);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.success-mark circle {
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: draw .6s .15s var(--ease) forwards;
}

.success-mark path {
	stroke-dasharray: 36;
	stroke-dashoffset: 36;
	animation: draw .4s .6s var(--ease) forwards;
}

@keyframes draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes pop-in {
	from {
		opacity: 0;
		transform: scale(.6);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.noscript {
	position: fixed;
	inset-inline: 16px;
	bottom: 16px;
	z-index: 30;
	margin: 0;
	padding: 12px 16px;
	border-radius: var(--radius-md);
	background: var(--error-bg);
	border: 1px solid var(--error-border);
	color: var(--error-text);
	text-align: center;
	font-weight: 700;
}

/* ------------------------------------------------------------------ splash (logo_view) */
.splash {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 32px 20px;
}

.splash-card {
	max-width: 480px;
	text-align: center;
	padding: 44px 36px 38px;
}

.splash-card .brand-logo img {
	margin: 0 auto 26px;
	width: min(300px, 82%);
}

.splash-card h1 {
	margin: 0 0 6px;
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	font-weight: 800;
	line-height: 1.35;
}

.splash-sub {
	margin: 0 0 4px;
	color: var(--link);
	font-weight: 700;
	letter-spacing: .02em;
}

.splash-card .btn-primary {
	margin-top: 28px;
}

/* ------------------------------------------------------------------ responsive: tablet & phone */
@media (max-width: 959.98px) {
	.auth-layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto 1fr;
	}

	.brand-panel {
		padding: max(26px, env(safe-area-inset-top)) 20px 8px;
		border: 0;
		background: none;
		justify-content: flex-start;
	}

	.brand-inner {
		max-width: 440px;
		margin-inline: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.brand-logo img {
		width: 188px;
		margin-bottom: 10px;
	}

	.brand-subtitle {
		font-size: 1.05rem;
		font-weight: 700;
		margin-bottom: 0;
		color: var(--muted);
	}

	.brand-tagline,
	.brand-points,
	.brand-tagline-en,
	.brand-panel .brand-owner {
		display: none;
	}

	.form-panel {
		justify-content: flex-start;
		padding: 14px 16px max(22px, env(safe-area-inset-bottom));
	}
}

@media (max-width: 520px) {
	.auth-card {
		padding: 26px 18px 22px;
		border-radius: 20px;
	}

	.step-head h1,
	.success-title {
		font-size: 1.42rem;
	}

	.otp {
		gap: 6px;
	}

	.otp-box {
		height: 54px;
		font-size: 1.35rem;
	}

	.pw-rules {
		grid-template-columns: 1fr;
	}

	.theme-toggle {
		width: 40px;
		height: 40px;
	}

	.splash-card {
		padding: 34px 20px 28px;
	}
}

/* short landscape phones */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 959.98px) {
	.brand-panel {
		padding-top: 12px;
	}

	.brand-logo img {
		width: 150px;
		margin-bottom: 4px;
	}

	.brand-subtitle {
		display: none;
	}
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	.orb {
		animation: none !important;
	}

	.success-mark circle,
	.success-mark path {
		stroke-dashoffset: 0;
	}
}
