/* Sign-in, two-step verification and password pages */
:root {
    --a-primary: #007ae1; --a-primary-600: #0066bd; --a-ring: rgba(0, 122, 225, .2);
    --a-brand: #2a3990; --a-ink: #1f2430; --a-ink-2: #4a5160; --a-muted: #6b7385;
    --a-border: #dfe3ec; --a-bg: #f5f6fa; --a-card: #fff;
    --a-danger: #d92c2c; --a-danger-soft: #ffeded; --a-success: #078a3a; --a-success-soft: #e3f8ea;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.auth { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; color: var(--a-ink); background: var(--a-bg); -webkit-font-smoothing: antialiased; }
a { color: var(--a-primary); text-decoration: none; }
a:hover { color: var(--a-primary-600); text-decoration: underline; }

.auth-shell { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }

/* Brand panel */
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; overflow: hidden; color: #fff;
    background: radial-gradient(1200px 600px at -10% -10%, rgba(0, 166, 199, .45), transparent 60%), linear-gradient(150deg, #22307f 0%, #1c4fb8 55%, #007ae1 100%); }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border: 60px solid rgba(255, 255, 255, .06); border-radius: 50%; }
.auth-brand-logo { display: inline-flex; padding: 10px 14px; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.auth-brand-logo img { display: block; height: 52px; width: auto; }
.auth-brand-body { position: relative; z-index: 1; max-width: 460px; }
.auth-brand h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.auth-brand p { margin: 0 0 24px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.auth-brand ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.auth-brand li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, .92); }
.auth-brand li i { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; font-size: 13px; background: rgba(255, 255, 255, .16); border-radius: 50%; }
.auth-brand-foot { position: relative; z-index: 1; margin: 0; font-size: 12px; color: rgba(255, 255, 255, .65); }

/* Form panel */
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: none; margin-bottom: 24px; }
.auth-logo img { height: 56px; width: auto; }
.auth-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--a-ink); }
.auth-sub { margin: 6px 0 26px; font-size: 14px; line-height: 1.55; color: var(--a-muted); }
.auth-sub strong { color: var(--a-ink); }
.auth-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; font-size: 22px; color: var(--a-primary); background: #e8f2fc; border-radius: 14px; }
.auth-icon.success { color: var(--a-success); background: var(--a-success-soft); }

.auth-field { margin-bottom: 16px; }
.auth-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--a-ink); }
.auth-label a { font-weight: 500; font-size: 13px; }
.auth-control { position: relative; }
.auth-control > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: #9fa8b9; pointer-events: none; }
.auth-input { display: block; width: 100%; height: 46px; padding: 0 14px 0 42px; font: inherit; font-size: 15px; color: var(--a-ink); background: var(--a-card);
    border: 1px solid var(--a-border); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 4px var(--a-ring); }
.auth-input[readonly] { background: var(--a-bg); }
.auth-input.is-invalid { border-color: var(--a-danger); }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(217, 44, 44, .15); }
.auth-input.code { padding: 0 14px; height: 58px; font-size: 26px; font-weight: 700; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-otp { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-otp-box { flex: 1 1 0; min-width: 0; max-width: 54px; height: 58px; padding: 0; font: inherit; font-size: 24px; font-weight: 700; text-align: center; color: var(--a-ink);
    background: var(--a-card); border: 1px solid var(--a-border); border-radius: 10px; outline: none; caret-color: var(--a-primary); transition: border-color .15s, box-shadow .15s, transform .1s; }
.auth-otp-box:focus { border-color: var(--a-primary); box-shadow: 0 0 0 4px var(--a-ring); }
.auth-otp-box.has-value { border-color: #b9cfe9; background: #f6faff; }
.auth-otp-box.is-invalid { border-color: var(--a-danger); animation: auth-shake .3s; }
.auth-otp-sep { flex: 0 0 10px; height: 2px; background: var(--a-border); border-radius: 1px; }
@keyframes auth-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (max-width: 379.98px) { .auth-otp { gap: 5px; } .auth-otp-box { height: 50px; font-size: 20px; } .auth-otp-sep { flex-basis: 4px; } }
.auth-reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; font-size: 16px; color: var(--a-muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.auth-reveal:hover { color: var(--a-ink); background: var(--a-bg); }
.auth-error { display: none; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--a-danger); }
.auth-error:not(:empty) { display: block; }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 20px; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--a-ink-2); cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--a-primary); }

.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 600;
    color: #fff; background: var(--a-primary); border: 0; border-radius: 10px; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; }
.auth-btn:hover { background: var(--a-primary-600); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--a-ring); }
.auth-btn:disabled { opacity: .7; cursor: progress; }
.auth-btn.ghost { color: var(--a-ink); background: var(--a-card); border: 1px solid var(--a-border); }
.auth-btn.ghost:hover { background: var(--a-bg); }
.auth-link-btn { padding: 0; font: inherit; font-weight: 600; color: var(--a-primary); background: none; border: 0; cursor: pointer; }
.auth-link-btn:disabled { color: var(--a-muted); cursor: default; }
.auth-spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-spin.dark { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; border-color: rgba(0, 122, 225, .25); border-top-color: var(--a-primary); }
.auth-link-btn .auth-spin { margin-right: 4px; }

.auth-alert { display: none; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; font-size: 13px; line-height: 1.5; border-radius: 10px; }
.auth-alert.show { display: flex; }
.auth-alert i { margin-top: 2px; }
.auth-alert.error { color: var(--a-danger); background: var(--a-danger-soft); border: 1px solid #ffd0d0; }
.auth-alert.success { color: var(--a-success); background: var(--a-success-soft); border: 1px solid #bfe9cd; }
.auth-alert.info { color: #0050a0; background: #e8f2fc; border: 1px solid #c9e1f8; }

.auth-foot { margin-top: 22px; font-size: 13px; text-align: center; color: var(--a-muted); }
.auth-help { margin: 0; font-size: 12px; color: var(--a-muted); }
.auth-meter { display: flex; gap: 4px; margin-top: 8px; }
.auth-meter span { flex: 1; height: 4px; background: var(--a-border); border-radius: 2px; transition: background .2s; }
.auth-meter[data-score="1"] span:nth-child(-n+1) { background: #e15a5a; }
.auth-meter[data-score="2"] span:nth-child(-n+2) { background: #e5a54a; }
.auth-meter[data-score="3"] span:nth-child(-n+3) { background: #4fae6b; }
.auth-meter[data-score="4"] span { background: var(--a-success); }

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-logo { display: inline-block; }
    .auth-panel { justify-content: flex-start; padding-top: 48px; }
}
@media (max-width: 479.98px) {
    .auth-panel { padding: 32px 16px; }
    .auth-title { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
