/* Modular authentication surface. It intentionally uses the shared theme
   variables so the login/register page follows the workbench light/dark mode. */
:root {
    --auth-bg: #0b1020;
    --auth-surface: #121a2e;
    --auth-surface-strong: #18233b;
    --auth-border: rgba(148, 163, 184, .2);
    --auth-text: #f8fafc;
    --auth-muted: #9aa8bd;
    --auth-primary: #6d5dfc;
    --auth-primary-strong: #5545df;
    --auth-danger: #f87171;
    --auth-success: #34d399;
    --auth-shadow: 0 24px 80px rgba(2, 6, 23, .35);
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 12% 10%, rgba(109, 93, 252, .18), transparent 32rem),
        radial-gradient(circle at 92% 84%, rgba(34, 211, 238, .1), transparent 26rem),
        var(--auth-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    box-sizing: border-box;
}

.auth-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    background: rgba(18, 26, 46, .88);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
}

.auth-shell--admin { grid-template-columns: minmax(360px, 440px); justify-content: center; }
.auth-shell--admin .auth-aside { display: none; }

.auth-aside {
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: linear-gradient(145deg, rgba(109, 93, 252, .22), rgba(20, 184, 166, .08));
}

.auth-brand,
.auth-brand-mark { display: inline-flex; align-items: center; gap: 10px; }
.auth-brand { color: var(--auth-text); font-weight: 750; letter-spacing: .01em; }
.auth-brand-mark {
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary), #22d3ee);
    color: #fff;
    box-shadow: 0 10px 26px rgba(109, 93, 252, .28);
}

.auth-aside h1 { max-width: 470px; margin: 0 0 16px; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; }
.auth-aside p { max-width: 470px; margin: 0; color: var(--auth-muted); font-size: 15px; line-height: 1.75; }
.auth-benefits { display: grid; gap: 14px; margin-top: 36px; }
.auth-benefit { display: flex; gap: 12px; align-items: flex-start; color: var(--auth-muted); font-size: 13px; line-height: 1.55; }
.auth-benefit i { flex: 0 0 auto; margin-top: 2px; color: #67e8f9; }
.auth-trust { display: flex; gap: 16px; color: var(--auth-muted); font-size: 12px; }
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }

.auth-card { padding: 42px; background: var(--auth-surface); }
.auth-form-header { margin-bottom: 24px; }
.auth-form-header h2 { margin: 0 0 8px; color: var(--auth-text); font-size: 25px; letter-spacing: -.02em; }
.auth-form-header p { margin: 0; color: var(--auth-muted); font-size: 13px; line-height: 1.55; }
.auth-admin-badge { display: inline-flex; margin-bottom: 16px; padding: 5px 9px; border-radius: 999px; color: #c4b5fd; background: rgba(109, 93, 252, .14); font-size: 11px; font-weight: 700; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 24px; padding: 4px; border: 1px solid var(--auth-border); border-radius: 12px; background: rgba(148, 163, 184, .07); }
.auth-tab { min-height: 38px; border: 0; border-radius: 9px; color: var(--auth-muted); background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; transition: .2s ease; }
.auth-tab:hover { color: var(--auth-text); background: rgba(148, 163, 184, .08); }
.auth-tab.active { color: #fff; background: var(--auth-primary); box-shadow: 0 8px 18px rgba(109, 93, 252, .22); }

.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { display: flex; justify-content: space-between; gap: 10px; color: var(--auth-text); font-size: 13px; font-weight: 650; }
.auth-field-hint { color: var(--auth-muted); font-size: 11px; font-weight: 400; }
.auth-control { position: relative; }
.auth-control input { width: 100%; min-height: 46px; box-sizing: border-box; padding: 0 14px; border: 1px solid var(--auth-border); border-radius: 11px; outline: none; color: var(--auth-text); background: rgba(2, 6, 23, .28); font: inherit; font-size: 14px; transition: .2s ease; }
.auth-control input.has-toggle { padding-right: 46px; }
.auth-control input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 3px rgba(109, 93, 252, .16); }
.auth-control input.is-invalid { border-color: var(--auth-danger); }
.auth-control input::placeholder { color: #728198; }
.auth-password-toggle { position: absolute; top: 50%; right: 10px; width: 28px; height: 28px; transform: translateY(-50%); border: 0; border-radius: 7px; color: var(--auth-muted); background: transparent; cursor: pointer; }
.auth-password-toggle:hover { color: var(--auth-text); background: rgba(148, 163, 184, .1); }
.auth-field-error { min-height: 15px; color: var(--auth-danger); font-size: 11px; }

.auth-password-meter { display: grid; gap: 8px; margin-top: -2px; }
.auth-password-meter-bar { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(148, 163, 184, .15); }
.auth-password-meter-fill { width: 0; height: 100%; border-radius: inherit; background: var(--auth-danger); transition: width .2s ease, background .2s ease; }
.auth-password-meter-note { color: var(--auth-muted); font-size: 11px; }

.auth-consent { display: flex; gap: 9px; align-items: flex-start; color: var(--auth-muted); font-size: 11px; line-height: 1.55; }
.auth-consent input { margin-top: 2px; accent-color: var(--auth-primary); }
.auth-consent a, .auth-footer a { color: #a5b4fc; text-decoration: none; }
.auth-consent a:hover, .auth-footer a:hover { text-decoration: underline; }
.auth-alert { display: none; padding: 11px 12px; border: 1px solid rgba(248, 113, 113, .28); border-radius: 10px; color: #fecaca; background: rgba(127, 29, 29, .25); font-size: 12px; line-height: 1.5; }
.auth-alert.is-visible { display: block; }
.auth-alert.is-success { border-color: rgba(52, 211, 153, .28); color: #a7f3d0; background: rgba(6, 78, 59, .25); }
.auth-submit { min-height: 47px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--auth-primary), #8b5cf6); cursor: pointer; font: inherit; font-size: 14px; font-weight: 750; box-shadow: 0 12px 24px rgba(109, 93, 252, .22); transition: .2s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(109, 93, 252, .3); }
.auth-submit:disabled { opacity: .62; cursor: wait; transform: none; }
.auth-footer { margin-top: 20px; color: var(--auth-muted); font-size: 11px; line-height: 1.6; text-align: center; }

html[data-theme="light"] .auth-page,
html.theme-light .auth-page { --auth-bg: #f4f7fb; --auth-surface: #fff; --auth-surface-strong: #f8fafc; --auth-border: rgba(36, 45, 66, .14); --auth-text: #202334; --auth-muted: #667085; --auth-shadow: 0 24px 70px rgba(36, 45, 66, .12); background: radial-gradient(circle at 12% 10%, rgba(91, 91, 214, .12), transparent 32rem), var(--auth-bg); }
html[data-theme="light"] .auth-shell,
html.theme-light .auth-shell { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .auth-aside,
html.theme-light .auth-aside { background: linear-gradient(145deg, rgba(91, 91, 214, .1), rgba(14, 165, 233, .06)); }
html[data-theme="light"] .auth-control input,
html.theme-light .auth-control input { background: #fff; }
html[data-theme="light"] .auth-tab.active,
html.theme-light .auth-tab.active { color: #fff; }

@media (max-width: 760px) {
    .auth-wrapper { padding: 18px 12px; }
    .auth-shell { display: block; border-radius: 20px; }
    .auth-aside { min-height: auto; padding: 26px 24px 22px; }
    .auth-aside h1 { margin-top: 28px; font-size: 30px; }
    .auth-benefits { display: none; }
    .auth-trust { margin-top: 24px; }
    .auth-card { padding: 28px 24px 30px; }
}
