/* Auth pages (login, forgot password) — split card: form on the left,
   blueprint-blue brand panel on the right. */
:root {
    --orange: #FF6B00;
    --orange-dark: #E55E00;
    --blue: #1E5A8E;
    --blue-dark: #16476F;
    --blue-deep: #0F3456;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6B7280;
    --line: #E3E8EF;
    --field: #F7F9FC;
    --page: #D9DEE6;
    --white: #fff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.auth-page {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--page);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    -webkit-font-smoothing: antialiased;
}
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.auth-shell {
    width: 100%;
    max-width: 1100px;
    min-height: 640px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(15, 30, 60, 0.35), 0 8px 20px -10px rgba(15, 30, 60, 0.15);
}

/* ---------------------------------------------------------------- form */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
}
.auth-form {
    width: 100%;
    max-width: 330px;
}
.auth-logo img {
    height: 38px;
    width: auto;
    display: block;
    margin-bottom: 30px;
}
.auth-form h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--ink);
    margin-bottom: 6px;
}
.auth-lead {
    font-size: 13.5px;
    color: var(--ink-2);
    margin-bottom: 24px;
}

.role-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.role-btn {
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.role-btn:hover { border-color: #C9D2DE; }
.role-btn.is-selected {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.14);
}
.role-ico {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: var(--white);
}
.role-ico--client { background: var(--orange); }
.role-ico--admin { background: var(--blue); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    font-size: 11.5px;
    color: var(--muted);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-alert {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    color: #9B1C1C;
    background: #FDF2F2;
    border: 1px solid #F8D4D4;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.auth-alert i { margin-top: 3px; }

.auth-fields { display: grid; gap: 14px; }
.field {
    position: relative;
    display: block;
}
.field input {
    width: 100%;
    height: 44px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 42px 0 42px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: #8A94A6; }
.field input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.14);
}
.field-ico {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #8A94A6;
    pointer-events: none;
}
.field-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    border: 0;
    background: transparent;
    color: #8A94A6;
    cursor: pointer;
    border-radius: 6px;
}
.field-eye:hover { color: var(--ink-2); }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    margin: 2px 0 10px;
}
.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    width: 16px; height: 16px;
    border-radius: 4px;
    border: 1px solid #C9D2DE;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all .15s;
}
.check input:checked + .check-box {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}
.check input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.25); }

.auth-link {
    color: var(--orange);
    font-weight: 500;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-submit {
    height: 44px;
    border: 0;
    border-radius: 6px;
    background: var(--orange);
    color: var(--white);
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    box-shadow: 0 8px 18px -10px rgba(255, 107, 0, 0.8);
    transition: background .2s, transform .2s;
}
.auth-submit:hover { background: var(--orange-dark); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
    margin-top: 22px;
}
.auth-submit--ghost:hover { background: var(--field); }

.auth-foot {
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-2);
    margin-top: 26px;
}

.demo-hint {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11.5px;
    color: var(--ink-2);
    background: #F3F6FA;
    border: 1px dashed #C9D2DE;
    border-radius: 8px;
    padding: 9px 12px;
}
.demo-hint i { color: var(--blue); }
.demo-hint strong { color: var(--ink); font-weight: 600; }

.auth-card-note {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field);
    font-size: 13.5px;
}
.auth-card-note div { display: flex; gap: 12px; align-items: center; }
.auth-card-note i { color: var(--blue); width: 16px; text-align: center; }

/* --------------------------------------------------------------- brand */
.auth-brand {
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 90% at 30% 30%, #2A6FA8 0%, var(--blue) 45%, var(--blue-dark) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 48px 44px;
}
/* faint blueprint grid */
.brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(80% 70% at 50% 40%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000 40%, transparent 100%);
}
.brand-stage {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 420px;
    height: 300px;
    transform: translate(-50%, -50%);
}
.brand-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 380px;
    height: 380px;
    margin: -190px 0 0 -190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
}
.brand-orbit--inner {
    width: 280px;
    height: 280px;
    margin: -140px 0 0 -140px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.brand-wires {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.brand-wires path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.brand-node {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--white);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.18), 0 10px 20px -8px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
}
.brand-node--a { left: 70px; top: 60px; color: var(--orange); }
.brand-node--b { left: 40px; top: 150px; width: 62px; height: 62px; }
.brand-node--b img { width: 38px; height: 38px; object-fit: contain; }
.brand-node--c { left: 70px; top: 240px; }
.brand-window {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 190px;
    background: #F8FAFD;
    border-radius: 8px;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.45);
    padding: 0 10px 12px;
    animation: float 6s ease-in-out infinite;
}
.bw-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    border-bottom: 1px solid #E6EBF2;
    margin: 0 -10px 10px;
    padding: 0 10px;
}
.bw-bar i { width: 6px; height: 6px; border-radius: 50%; background: #F16B5B; }
.bw-bar i:nth-child(2) { background: #F5BE4F; }
.bw-bar i:nth-child(3) { background: #5CC56B; }
.bw-bar span { margin-left: auto; width: 46px; height: 4px; border-radius: 4px; background: #E1E6EE; }
.bw-tabs { display: flex; gap: 10px; margin-bottom: 10px; }
.bw-tabs span { height: 14px; flex: 1; border-radius: 4px; background: transparent; position: relative; }
.bw-tabs span::after { content: ''; position: absolute; left: 20%; right: 20%; top: 5px; height: 4px; border-radius: 4px; background: #D5DCE6; }
.bw-tabs span.is-on { background: #E6EBF2; }
.bw-tabs span.is-on::after { background: #AFBACB; }
.bw-row {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--white);
    border: 1px solid #E6EBF2;
    border-radius: 5px;
    padding: 7px;
    margin-top: 6px;
}
.bw-row b {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #FFE9DA;
    color: var(--orange);
    font-size: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bw-row:nth-child(4) b { background: #E3EEF8; color: var(--blue); }
.bw-row:nth-child(5) b { background: #E4F5E8; color: #2E9E4F; }
.bw-row div { flex: 1; display: grid; gap: 5px; }
.bw-row em { display: block; height: 4px; border-radius: 4px; background: #AFBACB; }
.bw-row small { display: block; height: 4px; border-radius: 4px; background: #EDF1F6; overflow: hidden; }
.bw-row small u { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.bw-row:nth-child(5) small u { background: #2E9E4F; }

@keyframes float {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 6px)); }
}

.brand-copy {
    position: relative;
    text-align: center;
}
.brand-slides {
    position: relative;
    min-height: 74px;
}
.brand-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .5s ease, transform .5s ease;
}
.brand-slide.is-active {
    opacity: 1;
    transform: none;
    position: relative;
}
.brand-slide h2 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 8px;
}
.brand-slide p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}
.brand-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}
.brand-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: background .3s, transform .3s;
}
.brand-dots span.is-active { background: var(--white); transform: scale(1.15); }

@media (prefers-reduced-motion: reduce) {
    .brand-window { animation: none; }
    .brand-slide { transition: none; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 480px;
        min-height: 0;
    }
    .auth-brand { display: none; }
}
@media (max-width: 480px) {
    body.auth-page { padding: 0; align-items: stretch; background: var(--white); }
    .auth-shell { border-radius: 0; box-shadow: none; }
    .auth-form-panel { padding: 40px 20px; }
}

/* ---------------------------------------------- sign-up / verify / reset */
.auth-alert--ok {
    color: #1F6B3F;
    background: #EAF6EF;
    border-color: #CBE8D6;
}
.auth-alert a { color: inherit; font-weight: 600; }
.field-hint {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: -4px;
}
.field-hint.is-ok { color: #1F8A4C; }
.field-hint.is-bad { color: #B42318; }
.field--code input {
    padding: 0 12px;
    height: 56px;
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 12px;
    font-variant-numeric: tabular-nums;
}
.field--code input::placeholder { letter-spacing: 12px; }
.auth-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FFF1E7;
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}
.auth-badge--warn { background: #FDF2F2; color: #B42318; }
.auth-lead strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.auth-resend {
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}
.auth-linkbtn {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--orange);
    cursor: pointer;
}
.auth-linkbtn:hover { text-decoration: underline; }
