/* ─────────────────────────────────────────────────────────────────────────
   NUMERA — authentication shell
   Used by views/layouts/auth.php for sign in, password recovery, the 2FA
   challenge and the staff portal OTP steps.

   Colours, radii, shadows and the ambient background replicate the public
   landing page (views/layouts/landing.php) so the two feel like one product:
     page wash  #080e1c + three radial glows + a 72px grid at 6%
     surfaces   #0d1526 glass, white/10 hairlines
     primary    the landing's yellow gradient, #FCDD09 → #f5c518
   ───────────────────────────────────────────────────────────────────────── */

:root {
    --auth-ink: #080e1c;
    --auth-surface: #0d1526;
    --auth-line: rgba(255, 255, 255, .10);
    --auth-line-strong: rgba(255, 255, 255, .18);
    --auth-text: #e2eaf5;
    --auth-muted: rgba(255, 255, 255, .55);
    --auth-dim: rgba(255, 255, 255, .38);
    --auth-yellow: #FCDD09;
}

/* ── Page + landing-identical ambient wash ───────────────────────────── */
html,
body {
    overflow: auto !important;
    height: auto !important;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-ink);
    color: var(--auth-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Three radial glows, same stops and positions as the landing wash */
body.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at top, rgba(37, 99, 235, .28), transparent 55%),
        radial-gradient(ellipse at 85% 10%, rgba(14, 165, 233, .20), transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(15, 71, 175, .26), transparent 55%);
}

/* 72px grid at 6%, same as the landing */
body.auth-body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .06;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .6) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .6) 1px, transparent 1px);
    background-size: 72px 72px;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 100vh;
    padding: 32px 24px;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.auth-card {
    display: grid;
    grid-template-columns: 42% 1fr;
    width: 100%;
    max-width: 920px;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(13, 21, 38, .82);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--auth-line);
    box-shadow: 0 40px 110px rgba(2, 6, 23, .7);
}

/* ── Brand header: left on desktop, right on small screens ───────────── */
.auth-lockup {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.auth-flag {
    width: 44px;
    height: 22px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.auth-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}

.auth-brand-sub {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: rgba(255, 255, 255, .45);
}

/* ── Two-column body ─────────────────────────────────────────────────── */
.auth-grid { display: contents; }

/* ── Brand / trust panel ─────────────────────────────────────────────── */
.auth-aside {
    grid-column: 1;
    grid-row: 2;
    padding: 34px 38px 40px;
    border-right: 1px solid var(--auth-line);
    /* Nearly the card's own glass, just a whisper of blue so the panel isn't flat */
    background:
        radial-gradient(420px circle at 106% -10%, rgba(37, 99, 235, .08), transparent 70%);
    display: flex;
    flex-direction: column;
}

.auth-aside h2 {
    margin: 0 0 6px;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: #fff;
}

.auth-aside .tagline {
    margin: 0 0 26px;
    font-size: .84rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .5);
}

.auth-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 16px;
}

.auth-item-ico {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: .82rem;
    background: rgba(15, 71, 175, .28);
    color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .3);
}

.auth-item strong {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: #f1f5f9;
}

.auth-item span {
    display: block;
    margin-top: 2px;
    font-size: .75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .45);
}

.auth-aside-foot {
    margin-top: auto;
    padding-top: 28px;
}

.auth-by {
    display: flex;
    align-items: center;
    gap: 9px;
}

.auth-by img {
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: .45;
}

.auth-by span {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #fff;
}

/* ── Form panel ──────────────────────────────────────────────────────── */
.auth-main {
    grid-column: 2;
    grid-row: 2;
    padding: 34px 42px 42px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: rgba(252, 221, 9, .85);
}

.auth-eyebrow::before {
    content: '';
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--auth-yellow);
}

.auth-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.15;
    color: #fff;
}

.auth-sub {
    margin: 0 0 26px;
    font-size: .87rem;
    line-height: 1.6;
    color: var(--auth-muted);
}

/* ── Fields ──────────────────────────────────────────────────────────── */
.auth-field { margin-bottom: 16px; }

.auth-label {
    display: block;
    margin-bottom: 7px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .65);
}

.auth-input {
    width: 100%;
    padding: .74rem .95rem;
    border-radius: 12px;
    border: 1px solid #d7dde7;
    background: #fff;
    color: #0f172a;
    font-size: .92rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-input::placeholder { color: #94a3b8; }

.auth-input:hover { border-color: #b9c3d2; }

.auth-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

/* Chrome autofill paints its own background, which would undo the white field */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    caret-color: #0f172a;
    transition: background-color 6000s ease-in-out 0s;
}

.auth-input--code {
    padding: .8rem .5rem;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .32em;
}

.auth-hint {
    display: block;
    margin-top: 6px;
    font-size: .73rem;
    line-height: 1.5;
    color: var(--auth-dim);
}

.auth-error {
    display: block;
    margin-top: 6px;
    font-size: .76rem;
    color: #fca5a5;
}

/* ── Secondary link row ──────────────────────────────────────────────── */
.auth-linkrow {
    margin: 18px 0 22px;
    text-align: right;
}

.auth-link {
    font-size: .85rem;
    font-weight: 500;
    color: #93c5fd;
    text-decoration: none !important;
}

.auth-link:hover { color: #fff; }

/* Cross-portal switch, styled like the landing's secondary button */
.auth-alt {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-top: 22px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .06);
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none !important;
    transition: background-color .2s ease, transform .15s ease, border-color .2s ease;
}

.auth-alt:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Submit: the landing's yellow gradient ───────────────────────────── */
.auth-btn {
    width: 100%;
    padding: .95rem 1.25rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FCDD09, #f5c518);
    color: var(--auth-ink);
    font-size: .95rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 12px 40px -10px rgba(252, 221, 9, .45);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 18px 46px -10px rgba(252, 221, 9, .55);
}

.auth-btn:active { transform: translateY(0); }

.auth-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ── Badges ──────────────────────────────────────────────────────────── */
.auth-userbadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--auth-line-strong);
    background: rgba(255, 255, 255, .06);
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
}

/* ── 2FA method selector ─────────────────────────────────────────────── */
.auth-methods {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-method {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--auth-line);
    background: rgba(255, 255, 255, .04);
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .65);
    cursor: pointer;
    user-select: none;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.auth-method:hover { border-color: var(--auth-line-strong); color: #fff; }

.auth-method.is-active {
    border-color: #93c5fd;
    background: rgba(15, 71, 175, .28);
    color: #fff;
}

.auth-method-radio { position: absolute; opacity: 0; pointer-events: none; }

.auth-sendpanel { margin-bottom: 16px; }

.auth-sendpanel-text {
    margin: 0 0 8px;
    font-size: .82rem;
    color: rgba(255, 255, 255, .6);
}

.auth-sendbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--auth-line-strong);
    background: rgba(255, 255, 255, .06);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.auth-sendbtn:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.auth-sendbtn:disabled { opacity: .6; cursor: default; }

.auth-sendmsg { margin-top: 7px; font-size: .78rem; }
.auth-sendmsg.is-ok  { color: #86efac; }
.auth-sendmsg.is-err { color: #fca5a5; }


.auth-emailbadge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid rgba(147, 197, 253, .3);
    background: rgba(59, 130, 246, .15);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8rem;
    font-weight: 700;
    color: #bfdbfe;
    white-space: nowrap;
}

/* ── Flash messages (tones match the landing footer flashes) ─────────── */
.auth-flashes {
    width: 100%;
    max-width: 920px;
    margin-bottom: 16px;
}

.auth-flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.55;
}

.auth-flash:last-child { margin-bottom: 0; }
.auth-flash i { margin-top: 2px; flex-shrink: 0; }

.auth-flash-success { border: 1px solid rgba(52, 211, 153, .3); background: rgba(16, 185, 129, .1); color: #a7f3d0; }
.auth-flash-error   { border: 1px solid rgba(248, 113, 113, .3); background: rgba(239, 68, 68, .1); color: #fecaca; }
.auth-flash-warning { border: 1px solid rgba(251, 191, 36, .3); background: rgba(245, 158, 11, .1); color: #fde68a; }
.auth-flash-info    { border: 1px solid rgba(56, 189, 248, .3); background: rgba(14, 165, 233, .1); color: #bae6fd; }

/* Model-level error shown above a form */
.auth-form-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid rgba(248, 113, 113, .3);
    background: rgba(239, 68, 68, .1);
    color: #fecaca;
    font-size: .84rem;
    line-height: 1.55;
}

.auth-form-error i { margin-top: 2px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.auth-foot {
    margin-top: 24px;
    text-align: center;
    font-size: .78rem;
    line-height: 1.8;
    color: var(--auth-dim);
}

.auth-foot a {
    font-weight: 500;
    color: #93c5fd;
    text-decoration: none;
}

.auth-foot a:hover { color: #fff; }

/* ── Select company (multi-company users) ────────────────────────────── */
.auth-companies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.auth-company-form { margin: 0; }

.auth-company {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--auth-line);
    background: rgba(255, 255, 255, .04);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
}

.auth-company:hover {
    border-color: #93c5fd;
    background: rgba(15, 71, 175, .22);
    transform: translateY(-1px);
}

.auth-company-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    font-weight: 800;
    font-size: .85rem;
    color: #fff;
}

.auth-company-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-company-text strong { font-size: .95rem; font-weight: 700; color: #fff; }
.auth-company-text small { font-size: .72rem; color: rgba(255, 255, 255, .5); }
.auth-company i { margin-left: auto; color: rgba(255, 255, 255, .35); }

.auth-company-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-linkbtn {
    background: none;
    border: 0;
    padding: 0;
    color: #fca5a5;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
}

.auth-linkbtn:hover { color: #fecaca; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 460px;
        border-radius: 22px;
    }
    .auth-aside { display: none; }
    .auth-lockup {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: flex-end;
        padding: 18px 22px 0;
    }
    .auth-main { grid-column: 1; grid-row: 2; padding: 26px 26px 30px; }
    .auth-title { font-size: 1.4rem; }
    .auth-shell { padding: 20px 16px; }
}

@media (max-width: 420px) {
    .auth-shell { padding: 14px 12px; }
    .auth-main { padding: 26px 20px; }
    .auth-brand-name { font-size: .98rem; }
    .auth-input--code { letter-spacing: .2em; }
}