/* ═══════════════════════════════════════════════════════════════
   DRWL Passwordless Login — Dark theme
   ═══════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
	background: #0d0f1a;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #e6e8f5;
	-webkit-font-smoothing: antialiased;
}

/* Subtle glow */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	background: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(59,130,246,.12), transparent);
	pointer-events: none;
}

.pwl-page {
	width: 100%;
	max-width: 420px;
	padding: 20px;
	position: relative;
	z-index: 1;
}

/* ── Card ────────────────────────────────────────────────────── */
.pwl-card {
	background: #161928;
	border: 1px solid #2a2d45;
	border-radius: 20px;
	padding: 40px 36px;
	box-shadow: 0 8px 48px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
	text-align: center;
}

/* ── Brand ───────────────────────────────────────────────────── */
.pwl-brand {
	display: block;
	font-size: 28px;
	font-weight: 800;
	color: #fff;
	text-decoration: none;
	letter-spacing: -.04em;
	margin-bottom: 20px;
}
.pwl-brand:hover { color: #fff; }

/* ── Title / subtitle ────────────────────────────────────────── */
.pwl-title {
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 8px;
	line-height: 1.3;
}
.pwl-subtitle {
	font-size: 14px;
	color: #8c90b0;
	margin-bottom: 28px;
	line-height: 1.5;
}
.pwl-subtitle strong { color: #e6e8f5; }

/* ── Email input ─────────────────────────────────────────────── */
.pwl-field { margin-bottom: 20px; }

.pwl-input-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #111320;
	border: 1.5px solid #2a2d45;
	border-radius: 12px;
	padding: 0 16px;
	transition: border-color .15s, box-shadow .15s;
}
.pwl-input-wrap:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.pwl-input-icon {
	font-size: 18px;
	opacity: .5;
	flex-shrink: 0;
}
.pwl-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #e6e8f5;
	font-size: 15px;
	padding: 14px 0;
	font-family: inherit;
}
.pwl-input::placeholder { color: #565a78; }

/* ── Code digit inputs ───────────────────────────────────────── */
.pwl-code-inputs {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 24px;
}
.pwl-code-digit {
	width: 48px;
	height: 56px;
	background: #111320;
	border: 1.5px solid #2a2d45;
	border-radius: 10px;
	color: #fff;
	font-size: 24px;
	font-weight: 700;
	text-align: center;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	font-family: -apple-system, BlinkMacSystemFont, monospace;
	caret-color: #3b82f6;
}
.pwl-code-digit:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.pwl-code-digit.has-value {
	border-color: #3b82f6;
}
.pwl-code-sep {
	width: 12px;
	height: 2px;
	background: #2a2d45;
	border-radius: 1px;
	flex-shrink: 0;
}

/* ── Button ──────────────────────────────────────────────────── */
.pwl-btn {
	display: block;
	width: 100%;
	padding: 14px;
	background: #3b82f6;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: background .15s, transform .15s, box-shadow .15s;
	box-shadow: 0 4px 16px rgba(59,130,246,.2);
	font-family: inherit;
}
.pwl-btn:hover {
	background: #2563eb;
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(59,130,246,.25);
}
.pwl-btn:active { transform: translateY(0); }
.pwl-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

/* ── Links ───────────────────────────────────────────────────── */
.pwl-code-links {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}
.pwl-link {
	background: none;
	border: none;
	color: #8c90b0;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	transition: color .15s;
}
.pwl-link:hover { color: #3b82f6; }
.pwl-link-sep {
	color: #2a2d45;
	font-size: 13px;
}

/* ── Secure text ─────────────────────────────────────────────── */
.pwl-secure {
	font-size: 12px;
	color: #565a78;
	margin-top: 20px;
}

/* ── Error ────────────────────────────────────────────────────── */
.pwl-error {
	font-size: 13px;
	color: #f87171;
	margin-top: 12px;
	min-height: 18px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.pwl-footer {
	text-align: center;
	font-size: 12px;
	color: #565a78;
	margin-top: 24px;
}

/* ── Steps ───────────────────────────────────────────────────── */
.pwl-step[hidden] { display: none; }

/* ── Spinner on button ───────────────────────────────────────── */
.pwl-btn.is-loading {
	pointer-events: none;
	position: relative;
	color: transparent;
}
.pwl-btn.is-loading::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 20px; height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid rgba(255,255,255,.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pwl-spin .6s linear infinite;
}
@keyframes pwl-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 440px) {
	.pwl-card { padding: 32px 24px; border-radius: 16px; }
	.pwl-code-digit { width: 42px; height: 50px; font-size: 20px; }
	.pwl-brand { font-size: 24px; }
	.pwl-title { font-size: 19px; }
}
