/*
 * Start flow — account drawer (sign in, create account, codes, password reset).
 *
 * Self-contained: the /start/ document does not load the main stylesheet, so
 * every token used here is declared here. Light values are the default and
 * [data-theme="dark"] swaps them. Logical properties throughout, so the panel
 * docks to the left and arrows flip in RTL without separate rules.
 */

.nl-auth {
	--au-bg: #ffffff;
	--au-sunken: #f4f7fb;
	--au-raised: #ffffff;
	--au-ink: #0c1a2b;
	--au-ink-2: #34465a;
	--au-muted: #627389;
	--au-line: #e3e9f1;
	--au-line-strong: #c9d4e1;
	--au-brand: #1463d8;
	--au-brand-hover: #0f53b8;
	--au-brand-ink: #0f56bf;
	--au-brand-tint: #ecf3fe;
	--au-brand-ring: rgba(20, 99, 216, 0.2);
	--au-ok: #0d8a5f;
	--au-ok-tint: #e8f7f0;
	--au-ok-line: #a9e2c9;
	--au-warn: #a65b00;
	--au-warn-tint: #fff6e5;
	--au-warn-line: #f6d38f;
	--au-danger: #c8321f;
	--au-danger-tint: #fef2f0;
	--au-danger-line: #f7c4bb;
	--au-meter-1: #d9442e;
	--au-meter-2: #e8900c;
	--au-meter-3: #1b8fd2;
	--au-meter-4: #119a68;
	--au-shadow: 0 1px 2px rgba(12, 26, 43, 0.06), 0 40px 80px -24px rgba(12, 26, 43, 0.35);
	--au-btn-shadow: 0 1px 2px rgba(12, 26, 43, 0.12), 0 10px 22px -12px rgba(20, 99, 216, 0.7);
	--au-backdrop: rgba(6, 16, 28, 0.42);
	--au-radius: 12px;
	--au-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	color: var(--au-ink);
	font-family: var(--font-sans, "IRANSansX", Inter, system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

[data-theme="dark"] .nl-auth {
	--au-bg: #0d1726;
	--au-sunken: #111f31;
	--au-raised: #16263b;
	--au-ink: #eaf0f7;
	--au-ink-2: #c3cfdd;
	--au-muted: #8d9db1;
	--au-line: #1e2f45;
	--au-line-strong: #2c4060;
	--au-brand: #3b86f5;
	--au-brand-hover: #5a9bfa;
	--au-brand-ink: #80b3ff;
	--au-brand-tint: rgba(59, 134, 245, 0.13);
	--au-brand-ring: rgba(90, 155, 250, 0.32);
	--au-ok: #4fd6a2;
	--au-ok-tint: rgba(79, 214, 162, 0.1);
	--au-ok-line: rgba(79, 214, 162, 0.32);
	--au-warn: #f5b84a;
	--au-warn-tint: rgba(245, 184, 74, 0.1);
	--au-warn-line: rgba(245, 184, 74, 0.3);
	--au-danger: #ff8a78;
	--au-danger-tint: rgba(255, 138, 120, 0.1);
	--au-danger-line: rgba(255, 138, 120, 0.32);
	--au-meter-3: #4ea8f0;
	--au-meter-4: #3ccf93;
	--au-shadow: 0 0 0 1px rgba(120, 160, 210, 0.08), 0 40px 90px -20px rgba(0, 0, 0, 0.7);
	--au-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -12px rgba(59, 134, 245, 0.8);
	--au-backdrop: rgba(2, 8, 16, 0.6);
}

.nl-auth[hidden] {
	display: none;
}

.nl-auth *,
.nl-auth *::before,
.nl-auth *::after {
	box-sizing: border-box;
}

.nl-auth svg {
	flex: none;
}

[dir="rtl"] .nl-auth__flip {
	transform: scaleX(-1);
}

/* ---------- Shell ---------- */

.nl-auth__backdrop {
	position: absolute;
	inset: 0;
	background: var(--au-backdrop);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	backdrop-filter: blur(6px) saturate(120%);
	animation: nlAuthFade 0.24s var(--au-ease) both;
}

.nl-auth__panel {
	position: absolute;
	inset-block: 12px;
	inset-inline-end: 12px;
	display: flex;
	flex-direction: column;
	width: min(480px, calc(100vw - 24px));
	border: 1px solid var(--au-line);
	border-radius: 24px;
	background: var(--au-bg);
	box-shadow: var(--au-shadow);
	overflow: hidden;
	animation: nlAuthIn 0.36s var(--au-ease) both;
}

.nl-auth__panel:focus {
	outline: none;
}

.nl-auth__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 12px 16px 0 24px;
	padding-inline: 24px 14px;
}

.nl-auth__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--au-ink);
}

.nl-auth__brand img {
	width: 26px;
	height: 26px;
	border-radius: 7px;
}

.nl-auth__brand[hidden] {
	display: none;
}

.nl-auth__back,
.nl-auth__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--au-ink-2);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.18s var(--au-ease), color 0.18s var(--au-ease);
}

.nl-auth__back {
	margin-inline-start: -10px;
	padding-inline: 10px 12px;
}

.nl-auth__back[hidden] {
	display: none;
}

.nl-auth__close {
	width: 40px;
	margin-inline-start: auto;
	color: var(--au-muted);
}

.nl-auth__back:hover,
.nl-auth__close:hover {
	background: var(--au-sunken);
	color: var(--au-ink);
}

.nl-auth__scroll {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--au-line-strong) transparent;
}

/* margin-block:auto centres short views and lets long ones scroll from the top. */
.nl-auth__inner {
	width: 100%;
	margin-block: auto;
	padding: 8px 40px 28px;
}

.nl-auth__inner[hidden] {
	display: none;
}

.nl-auth__foot {
	display: flex;
	flex: none;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 40px 18px;
	border-top: 1px solid var(--au-line);
	color: var(--au-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

.nl-auth__foot svg {
	margin-top: 2px;
	color: var(--au-ok);
}

/* ---------- Tabs ---------- */

.nl-auth-tabs {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 24px;
	padding: 4px;
	border-radius: 14px;
	background: var(--au-sunken);
	box-shadow: inset 0 0 0 1px var(--au-line);
}

.nl-auth-tabs[hidden] {
	display: none;
}

.nl-auth-tabs button {
	position: relative;
	z-index: 1;
	min-height: 40px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--au-muted);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.2s var(--au-ease);
}

.nl-auth-tabs button[aria-selected="true"] {
	color: var(--au-ink);
}

.nl-auth-tabs button:focus-visible {
	outline: 2px solid var(--au-brand);
	outline-offset: 1px;
}

.nl-auth-tabs__thumb {
	position: absolute;
	inset-block: 4px;
	inset-inline-start: 4px;
	width: calc(50% - 4px);
	border-radius: 10px;
	background: var(--au-raised);
	box-shadow: 0 1px 2px rgba(12, 26, 43, 0.08), 0 2px 8px -2px rgba(12, 26, 43, 0.12);
	transition: transform 0.32s var(--au-ease);
}

.nl-auth-tabs[data-active="register"] .nl-auth-tabs__thumb {
	transform: translateX(100%);
}

[dir="rtl"] .nl-auth-tabs[data-active="register"] .nl-auth-tabs__thumb {
	transform: translateX(-100%);
}

/* ---------- View typography ---------- */

.nl-auth-view[hidden] {
	display: none;
}

.nl-auth-view.is-entering,
.nl-auth-done.is-entering {
	animation: nlAuthView 0.32s var(--au-ease) both;
}

.nl-auth-glyph {
	display: inline-grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-bottom: 20px;
	border-radius: 16px;
	background: var(--au-brand-tint);
	color: var(--au-brand-ink);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-brand) 18%, transparent), 0 0 0 6px color-mix(in srgb, var(--au-brand) 6%, transparent);
}

.nl-auth-glyph--ok {
	background: var(--au-ok-tint);
	color: var(--au-ok);
	box-shadow: inset 0 0 0 1px var(--au-ok-line), 0 0 0 6px color-mix(in srgb, var(--au-ok) 7%, transparent);
}

.nl-auth-glyph--warn {
	background: var(--au-warn-tint);
	color: var(--au-warn);
	box-shadow: inset 0 0 0 1px var(--au-warn-line), 0 0 0 6px color-mix(in srgb, var(--au-warn) 7%, transparent);
}

.nl-auth-glyph--danger {
	background: var(--au-danger-tint);
	color: var(--au-danger);
	box-shadow: inset 0 0 0 1px var(--au-danger-line), 0 0 0 6px color-mix(in srgb, var(--au-danger) 7%, transparent);
}

.nl-auth-title {
	margin: 0 0 8px;
	color: var(--au-ink);
	font-size: 27px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.022em;
}

.nl-auth-title:focus {
	outline: none;
}

.nl-auth-lead {
	margin: 0 0 22px;
	color: var(--au-muted);
	font-size: 15px;
	line-height: 1.6;
}

.nl-auth-lead strong,
.nl-auth-email {
	color: var(--au-ink);
	font-weight: 600;
	overflow-wrap: anywhere;
	unicode-bidi: isolate;
}

.nl-auth-deadline {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: -10px 0 24px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--au-warn-tint);
	color: var(--au-warn);
	font-size: 13.5px;
	font-weight: 600;
}

.nl-auth-deadline:empty {
	display: none;
}

/* ---------- Alerts ---------- */

.nl-auth-alert {
	display: flex;
	gap: 10px;
	margin: -8px 0 20px;
	padding: 12px 14px;
	border: 1px solid var(--au-line);
	border-radius: var(--au-radius);
	background: var(--au-sunken);
	color: var(--au-ink-2);
	font-size: 14px;
	line-height: 1.5;
	animation: nlAuthView 0.24s var(--au-ease) both;
}

.nl-auth-alert[hidden] {
	display: none;
}

.nl-auth-alert__icon {
	margin-top: 1px;
}

.nl-auth-alert__body {
	min-width: 0;
}

.nl-auth-alert__text {
	margin: 0;
}

.nl-auth-alert__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-top: 6px;
}

.nl-auth-alert[data-kind="error"] {
	border-color: var(--au-danger-line);
	background: var(--au-danger-tint);
	color: var(--au-danger);
}

.nl-auth-alert[data-kind="success"] {
	border-color: var(--au-ok-line);
	background: var(--au-ok-tint);
	color: var(--au-ok);
}

.nl-auth-alert[data-kind="info"] {
	border-color: color-mix(in srgb, var(--au-brand) 26%, transparent);
	background: var(--au-brand-tint);
	color: var(--au-brand-ink);
}

.nl-auth-alert .nl-auth-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Fields ---------- */

.nl-auth-form {
	display: grid;
	gap: 18px;
}

.nl-auth-form[hidden] {
	display: none;
}

.nl-auth-form--change {
	margin-bottom: 20px;
	padding: 16px;
	border: 1px solid var(--au-line);
	border-radius: 16px;
	background: var(--au-sunken);
}

.nl-field {
	display: grid;
	gap: 8px;
	margin: 0;
}

.nl-field__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.nl-field__label {
	padding: 0;
	color: var(--au-ink-2);
	font-size: 13.5px;
	font-weight: 600;
}

.nl-field__input {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--au-line-strong);
	border-radius: var(--au-radius);
	background: var(--au-bg);
	color: var(--au-ink);
	font: inherit;
	/* 16px stops iOS zooming into the field. */
	font-size: 16px;
	box-shadow: 0 1px 2px rgba(12, 26, 43, 0.04);
	transition: border-color 0.18s var(--au-ease), box-shadow 0.18s var(--au-ease), background-color 0.18s var(--au-ease);
	-webkit-appearance: none;
	appearance: none;
}

[dir="rtl"] .nl-field__input[dir="ltr"] {
	text-align: left;
}

.nl-field__input::placeholder {
	color: color-mix(in srgb, var(--au-muted) 70%, transparent);
}

.nl-field__input:hover {
	border-color: color-mix(in srgb, var(--au-line-strong) 60%, var(--au-muted));
}

.nl-field__input:focus {
	border-color: var(--au-brand);
	outline: none;
	box-shadow: 0 0 0 4px var(--au-brand-ring);
}

.nl-field__input[aria-invalid="true"] {
	border-color: var(--au-danger);
}

.nl-field__input[aria-invalid="true"]:focus {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--au-danger) 22%, transparent);
}

.nl-field__input:-webkit-autofill {
	-webkit-text-fill-color: var(--au-ink);
	-webkit-box-shadow: 0 0 0 40px var(--au-brand-tint) inset;
}

.nl-field__note {
	margin: 0;
	color: var(--au-muted);
	font-size: 13px;
	line-height: 1.5;
}

.nl-field__error {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--au-danger);
	font-size: 13px;
	font-weight: 500;
}

.nl-suggest {
	margin: 0;
	color: var(--au-ink-2);
	font-size: 13.5px;
}

.nl-suggest button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--au-brand-ink);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 3px;
	cursor: pointer;
	unicode-bidi: isolate;
}

/* Password field with a show/hide toggle. */
.nl-password {
	position: relative;
}

.nl-password .nl-field__input {
	padding-inline-end: 50px;
}

.nl-password__toggle {
	position: absolute;
	inset-block: 4px;
	inset-inline-end: 4px;
	display: grid;
	place-items: center;
	width: 42px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--au-muted);
	cursor: pointer;
}

.nl-password__toggle:hover {
	background: var(--au-sunken);
	color: var(--au-ink);
}

.nl-password__toggle:focus-visible {
	outline: 2px solid var(--au-brand);
	outline-offset: -2px;
}

.nl-password__hide,
.nl-password__toggle[aria-pressed="true"] .nl-password__show {
	display: none;
}

.nl-password__toggle[aria-pressed="true"] .nl-password__hide {
	display: block;
}

/* Strength meter. */
.nl-meter {
	display: grid;
	gap: 8px;
}

.nl-meter__bars {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
}

.nl-meter__bars i {
	height: 4px;
	border-radius: 4px;
	background: var(--au-line);
	transition: background-color 0.25s var(--au-ease);
}

.nl-meter__label {
	color: var(--au-muted);
	font-size: 13px;
}

.nl-meter[data-level="1"] .nl-meter__bars i:nth-child(-n + 1) { background: var(--au-meter-1); }
.nl-meter[data-level="2"] .nl-meter__bars i:nth-child(-n + 2) { background: var(--au-meter-2); }
.nl-meter[data-level="3"] .nl-meter__bars i:nth-child(-n + 3) { background: var(--au-meter-3); }
.nl-meter[data-level="4"] .nl-meter__bars i { background: var(--au-meter-4); }
.nl-meter[data-level="1"] .nl-meter__label,
.nl-meter.is-error .nl-meter__label { color: var(--au-danger); }
.nl-meter[data-level="4"] .nl-meter__label { color: var(--au-ok); }

/* Email preferences as toggle chips (real checkboxes underneath). */
.nl-prefs {
	display: grid;
	gap: 10px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.nl-prefs__optional {
	color: var(--au-muted);
	font-weight: 500;
}

.nl-prefs__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.nl-chip {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.nl-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.nl-chip__body {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 36px;
	padding: 0 12px;
	border: 1px solid var(--au-line-strong);
	border-radius: 999px;
	background: var(--au-bg);
	color: var(--au-ink-2);
	font-size: 13px;
	font-weight: 600;
	transition: background-color 0.18s var(--au-ease), border-color 0.18s var(--au-ease), color 0.18s var(--au-ease);
}

.nl-chip__check {
	display: none;
	stroke-width: 3;
}

.nl-chip:hover .nl-chip__body {
	border-color: color-mix(in srgb, var(--au-brand) 45%, var(--au-line-strong));
}

.nl-chip input:checked + .nl-chip__body {
	border-color: color-mix(in srgb, var(--au-brand) 55%, transparent);
	background: var(--au-brand-tint);
	color: var(--au-brand-ink);
}

.nl-chip input:checked + .nl-chip__body .nl-chip__check {
	display: block;
}

.nl-chip input:focus-visible + .nl-chip__body {
	outline: 2px solid var(--au-brand);
	outline-offset: 2px;
}

/* ---------- Buttons and links ---------- */

.nl-auth-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 50px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: var(--au-radius);
	font: inherit;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s var(--au-ease), border-color 0.18s var(--au-ease), box-shadow 0.18s var(--au-ease), transform 0.12s var(--au-ease), opacity 0.18s;
}

.nl-auth-btn[hidden] {
	display: none;
}

.nl-auth-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.nl-auth-btn:focus-visible {
	outline: 2px solid var(--au-brand);
	outline-offset: 3px;
}

.nl-auth-btn:disabled {
	cursor: default;
	opacity: 0.72;
}

.nl-auth-btn--primary {
	background: var(--au-brand);
	color: #ffffff;
	box-shadow: var(--au-btn-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.nl-auth-btn--primary:hover:not(:disabled) {
	background: var(--au-brand-hover);
	color: #ffffff;
}

.nl-auth-btn--ghost {
	border-color: var(--au-line-strong);
	background: var(--au-bg);
	color: var(--au-ink);
	box-shadow: 0 1px 2px rgba(12, 26, 43, 0.05);
}

.nl-auth-btn--ghost:hover:not(:disabled) {
	border-color: color-mix(in srgb, var(--au-line-strong) 50%, var(--au-muted));
	background: var(--au-sunken);
	color: var(--au-ink);
}

.nl-auth-form + .nl-auth-btn,
.nl-auth-view > .nl-auth-btn + .nl-auth-btn,
.nl-auth-stack {
	margin-top: 12px;
}

.nl-auth-view > .nl-auth-form + .nl-auth-btn--ghost {
	margin-top: 12px;
}

.nl-auth-btn.is-busy {
	color: transparent;
}

.nl-auth-btn.is-busy > * {
	visibility: hidden;
}

.nl-auth-btn__busy {
	position: absolute;
	inset: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: #ffffff;
	visibility: visible !important;
}

.nl-auth-btn--ghost .nl-auth-btn__busy {
	color: var(--au-ink);
}

.nl-auth-btn__busy::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: nlAuthSpin 0.7s linear infinite;
}

.nl-auth-actions {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.nl-auth-actions .nl-auth-btn--ghost {
	width: auto;
}

.nl-auth-link {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	color: var(--au-brand-ink);
	font: inherit;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
}

.nl-auth-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nl-auth-link:focus-visible {
	border-radius: 4px;
	outline: 2px solid var(--au-brand);
	outline-offset: 2px;
}

.nl-auth-link:disabled {
	color: var(--au-muted);
	text-decoration: none;
	cursor: default;
}

.nl-auth-link[hidden] {
	display: none;
}

.nl-auth-link--quiet {
	font-size: 13.5px;
	font-weight: 600;
}

/* ---------- Social sign-in ---------- */

.nl-auth-social:empty,
.nl-auth-social[hidden] {
	display: none;
}

.nl-auth-social .nsl-container {
	margin: 0 !important;
	padding: 0 !important;
}

.nl-auth-social .nsl-container-buttons {
	display: grid !important;
	gap: 10px;
	width: 100%;
	padding: 0 !important;
}

.nl-auth-social .nsl-container-buttons a {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	text-decoration: none !important;
}

.nl-auth-social .nsl-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100% !important;
	min-height: 50px;
	margin: 0 !important;
	padding: 0 18px !important;
	border: 1px solid var(--au-line-strong) !important;
	border-radius: var(--au-radius) !important;
	background: var(--au-bg) !important;
	color: var(--au-ink) !important;
	box-shadow: 0 1px 2px rgba(12, 26, 43, 0.05) !important;
	transition: background-color 0.18s var(--au-ease), border-color 0.18s var(--au-ease);
}

.nl-auth-social .nsl-button:hover {
	border-color: color-mix(in srgb, var(--au-line-strong) 50%, var(--au-muted)) !important;
	background: var(--au-sunken) !important;
}

.nl-auth-social .nsl-button-svg-container {
	display: grid !important;
	place-items: center;
	padding: 0 !important;
}

.nl-auth-social .nsl-button-svg-container svg {
	width: 20px !important;
	height: 20px !important;
}

.nl-auth-social .nsl-button-label-container {
	margin: 0 !important;
	padding: 0 !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
}

.nl-auth-social .nsl-button-label-container b {
	font-weight: 700;
}

.nl-auth-divider {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0;
	color: var(--au-muted);
	font-size: 13px;
	white-space: nowrap;
}

.nl-auth-divider[hidden] {
	display: none;
}

.nl-auth-divider::before,
.nl-auth-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--au-line);
}

/* ---------- Code entry ---------- */

.nl-otp {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
}

.nl-otp__box {
	width: 100%;
	min-width: 0;
	height: 64px;
	padding: 0;
	border: 1px solid var(--au-line-strong);
	border-radius: 14px;
	background: var(--au-bg);
	color: var(--au-ink);
	font: inherit;
	font-size: 28px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
	caret-color: var(--au-brand);
	box-shadow: 0 1px 2px rgba(12, 26, 43, 0.05);
	transition: border-color 0.18s var(--au-ease), box-shadow 0.18s var(--au-ease), background-color 0.18s var(--au-ease);
}

.nl-otp__box:focus {
	border-color: var(--au-brand);
	outline: none;
	box-shadow: 0 0 0 4px var(--au-brand-ring);
}

.nl-otp__box.is-filled {
	border-color: color-mix(in srgb, var(--au-brand) 45%, var(--au-line-strong));
	background: var(--au-brand-tint);
}

.nl-otp.is-error .nl-otp__box {
	border-color: var(--au-danger);
	background: var(--au-danger-tint);
}

.nl-otp.is-error {
	animation: nlAuthShake 0.42s var(--au-ease);
}

.nl-otp.is-ok .nl-otp__box {
	border-color: var(--au-ok);
	background: var(--au-ok-tint);
}

.nl-auth-resend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 8px;
	margin-top: 18px;
	color: var(--au-muted);
	font-size: 14px;
	text-align: center;
}

.nl-auth-resend__timer {
	font-variant-numeric: tabular-nums;
}

.nl-auth-resend__timer[hidden] {
	display: none;
}

.nl-auth-mailapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: fit-content;
	min-height: 40px;
	margin: 14px auto 0;
	padding: 0 16px;
	border: 1px solid var(--au-line);
	border-radius: 999px;
	color: var(--au-ink-2);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.18s var(--au-ease);
}

.nl-auth-mailapp:hover {
	background: var(--au-sunken);
	color: var(--au-ink);
}

.nl-auth-mailapp[hidden] {
	display: none;
}

.nl-auth-view > a.nl-auth-btn[data-nl-mailapp] {
	margin-bottom: 4px;
}

.nl-auth-hint {
	margin: 16px 0 0;
	color: var(--au-muted);
	font-size: 13px;
	line-height: 1.55;
	text-align: center;
}

.nl-auth-hint:empty {
	display: none;
}

.nl-auth-grace {
	margin-top: 24px;
	padding: 16px;
	border: 1px dashed var(--au-line-strong);
	border-radius: 16px;
	background: var(--au-sunken);
}

.nl-auth-grace[hidden] {
	display: none;
}

.nl-auth-grace p {
	margin: 0 0 12px;
	color: var(--au-ink-2);
	font-size: 14px;
	line-height: 1.55;
}

.nl-auth-grace strong {
	color: var(--au-ink);
}

/* ---------- Small print ---------- */

.nl-auth-switch {
	margin: 22px 0 0;
	color: var(--au-muted);
	font-size: 14px;
	text-align: center;
}

.nl-auth-legal {
	margin: -4px 0 0;
	color: var(--au-muted);
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
}

.nl-auth-legal a {
	color: var(--au-ink-2);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Done ---------- */

.nl-auth-done {
	text-align: center;
}

.nl-auth-done__mark {
	display: inline-grid;
	place-items: center;
	width: 88px;
	height: 88px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--au-ok-tint);
	color: var(--au-ok);
}

.nl-auth-done__mark circle {
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: nlAuthDraw 0.6s var(--au-ease) 0.05s forwards;
}

.nl-auth-done__mark path {
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: nlAuthDraw 0.4s var(--au-ease) 0.45s forwards;
}

.nl-auth-done__progress {
	display: block;
	height: 4px;
	margin: 4px auto 24px;
	max-width: 220px;
	overflow: hidden;
	border-radius: 4px;
	background: var(--au-line);
}

.nl-auth-done__progress i {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background: var(--au-ok);
	transform: scaleX(0);
	transform-origin: left center;
}

[dir="rtl"] .nl-auth-done__progress i {
	transform-origin: right center;
}

.nl-auth-done.is-leaving .nl-auth-done__progress i {
	animation: nlAuthProgress var(--nl-auth-redirect, 1400ms) linear forwards;
}

.nl-auth-done .nl-auth-btn {
	width: auto;
	min-width: 160px;
}

/* ---------- Motion ---------- */

@keyframes nlAuthFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes nlAuthIn {
	from { opacity: 0; transform: translateX(28px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

[dir="rtl"] .nl-auth__panel {
	animation-name: nlAuthInRtl;
}

@keyframes nlAuthInRtl {
	from { opacity: 0; transform: translateX(-28px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@keyframes nlAuthView {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes nlAuthShake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-8px); }
	40% { transform: translateX(7px); }
	60% { transform: translateX(-5px); }
	80% { transform: translateX(3px); }
}

@keyframes nlAuthSpin {
	to { transform: rotate(360deg); }
}

@keyframes nlAuthDraw {
	to { stroke-dashoffset: 0; }
}

@keyframes nlAuthProgress {
	to { transform: scaleX(1); }
}

@keyframes nlAuthSheet {
	from { transform: translateY(100%); }
	to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.nl-auth *,
	.nl-auth *::before,
	.nl-auth *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.nl-auth-btn__busy::before {
		animation: nlAuthSpin 1.2s linear infinite !important;
	}
}

/* ---------- Small screens: a bottom sheet ---------- */

@media (max-width: 600px) {
	.nl-auth__panel,
	[dir="rtl"] .nl-auth__panel {
		inset: auto 0 0 0;
		width: 100%;
		max-height: calc(100dvh - 16px);
		border-width: 1px 0 0;
		border-radius: 24px 24px 0 0;
		animation: nlAuthSheet 0.36s var(--au-ease) both;
	}

	.nl-auth__bar {
		position: relative;
		min-height: 60px;
		padding-top: 18px;
		padding-inline: 18px 10px;
	}

	/* Grab handle. */
	.nl-auth__bar::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 4px;
		background: var(--au-line-strong);
	}

	.nl-auth__inner {
		padding: 8px 20px 24px;
	}

	.nl-auth__foot {
		padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
	}

	.nl-auth-title {
		font-size: 24px;
	}

	.nl-auth-tabs {
		margin-bottom: 22px;
	}

	.nl-otp {
		gap: 8px;
	}

	.nl-otp__box {
		height: 58px;
		font-size: 24px;
	}

	.nl-auth-actions {
		grid-template-columns: 1fr;
	}

	.nl-auth-actions .nl-auth-btn--ghost {
		width: 100%;
	}
}

@media (max-height: 560px) and (min-width: 601px) {
	.nl-auth__inner {
		margin-block: 0;
	}
}
