/*
 * Login / 2FA screens (APP view). Paired with
 * resources/views/vendor/adminlte/partials/auth-shell.blade.php and the
 * 3 cards that extend it (login, two-factor.enroll, two-factor.challenge).
 * Hand-written and loaded directly (not through the Mix bundle) - same
 * pattern this page already used for vendor/adminlte/css/login.css before
 * this redesign. Font-size in rem throughout per .claude/skills/ui-ux/SKILL.md.
 *
 * Type scale bumped up a notch from the first pass (everything felt small,
 * flagged after browser testing) - input text in particular stays at 1rem
 * (16px) minimum so iOS Safari doesn't auto-zoom the page on focus.
 */

html { font-size: 16px; }

:root {
    --auth-blue: #2563EB;
    --auth-blue-dark: #1D4ED8;
    --auth-green: #059669;
    --auth-slate: #0F172A;
    --auth-black: #020617;
    --auth-amber: #F59E0B;
    --auth-amber-dark: #D97706;
    --auth-red: #DC2626;
}

body.auth-shell-page {
    margin: 0;
    background: #FAF7F1;
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* ---- Brand panel ---- */

.auth-shell__brand {
    flex: 0 0 42%;
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(155deg, var(--auth-blue) 0%, var(--auth-slate) 40%, var(--auth-green) 75%, var(--auth-black) 100%);
    background-size: cover;
    background-position: center;
}

.auth-shell__brand--photo {
    background-size: cover;
    background-position: center;
}

.auth-shell__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
}

.auth-shell__motif { position: absolute; inset: 0; pointer-events: none; }
.auth-shell__motif-box { position: absolute; opacity: 0.11; }
.auth-shell__motif-box--1 { width: 9.5rem; height: 9.5rem; top: 4rem; left: -2.2rem; transform: rotate(-10deg); }
.auth-shell__motif-box--2 { width: 12rem; height: 12rem; bottom: 5rem; right: -3rem; opacity: 0.09; transform: rotate(14deg); }
.auth-shell__motif-barcode { position: absolute; bottom: 2.75rem; right: 2.5rem; width: 8.25rem; height: 2.75rem; opacity: 0.14; fill: #fff; }

.auth-shell__logo, .auth-shell__pitch, .auth-shell__footer { position: relative; }

.auth-shell__logo { font-size: 1.375rem; font-weight: 700; }

.auth-shell__headline {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.875rem;
}

.auth-shell__tagline {
    font-size: 1.0625rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    max-width: 26rem;
}

.auth-shell__chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.auth-shell__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.375rem 0.75rem;
}

.auth-shell__chip i {
    font-size: 0.9375rem;
}

.auth-shell__footer { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.55); }

/* ---- Content / card ---- */

.auth-shell__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 27rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-blue), var(--auth-green));
}

.auth-card__eyebrow {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--auth-blue);
    margin-bottom: 0.75rem;
}

.auth-card__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
}

.auth-card__subtitle {
    font-size: 0.9375rem;
    color: #6B7280;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.auth-status {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0 1.25rem;
    line-height: 1.4;
}

.auth-status--success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

/* ---- Fields ---- */

.auth-field { margin-bottom: 1rem; }

.auth-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4375rem;
}

.auth-field__control { position: relative; }

/* Direct-child combinator on purpose: the OTHER <i> on this page - the eye
   icon inside .auth-field__toggle - is also technically a descendant of
   .auth-field__control, and a plain descendant selector here was absolutely
   positioning it against .auth-field__control's box instead of the (much
   smaller) toggle button, pushing it outside the input entirely. */
.auth-field__control > i {
    position: absolute;
    left: 0.9375rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1.1875rem;
}

.auth-field__control input {
    width: 100%;
    padding: 0.8125rem 2.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #111827;
}

.auth-field__control input:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-field__control input.is-invalid { border-color: var(--auth-red); }

.auth-field__toggle {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 1.1875rem;
}

.auth-field__toggle:hover { color: var(--auth-blue); }

.auth-field__error {
    display: block;
    font-size: 0.8125rem;
    color: var(--auth-red);
    margin-top: 0.375rem;
}

.auth-otp-input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.auth-otp-input:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-otp-input.is-invalid { border-color: var(--auth-red); }

/* ---- Failed-attempts indicator ---- */

.auth-attempts { margin: 0 0 1rem; }

.auth-attempts__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--auth-red);
    margin-bottom: 0.3125rem;
}

.auth-attempts__bar {
    height: 6px;
    border-radius: 999px;
    background: #F3F4F6;
    overflow: hidden;
}

.auth-attempts__fill {
    height: 100%;
    background: linear-gradient(90deg, #EF4444, #F87171);
    border-radius: 999px;
}

/* ---- Row: remember + forgot ---- */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.125rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.875rem;
    color: #4B5563;
    font-weight: 400;
}

.auth-checkbox input { width: 1.0625rem; height: 1.0625rem; }

.auth-row a, .auth-secondary-link a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-blue);
    text-decoration: none;
}

.auth-row a:hover, .auth-secondary-link a:hover { color: var(--auth-blue-dark); text-decoration: underline; }

/* ---- Captcha ---- */

.auth-field--captcha .auth-captcha {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.auth-captcha img {
    display: block;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    /* Source image is 380x64 (config/captcha.php 'auth' preset) - wider than
       the card at full size, so it scales down to fill the row instead of a
       fixed height, keeping its aspect ratio (min-width:0 lets it shrink
       below its intrinsic size inside the flex row). */
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.auth-captcha__refresh {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #D1D5DB;
    background: #fff;
    border-radius: 0.5rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.3125rem;
    color: #4B5563;
    cursor: pointer;
}

.auth-captcha__refresh:hover { background: #F9FAFB; }

.auth-captcha__answer {
    width: 100%;
    padding: 0.8125rem 0.9375rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #111827;
}

.auth-captcha__answer:focus {
    outline: none;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-captcha__answer.is-invalid { border-color: var(--auth-red); }

/* ---- Submit / links ---- */

.auth-submit {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--auth-amber);
    color: #1F1300;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: 0.25rem;
}

.auth-submit:hover { background: var(--auth-amber-dark); }

.auth-secondary-link {
    text-align: center;
    font-size: 0.9375rem;
    color: #6B7280;
    margin-top: 1.125rem;
}

/* ---- QR enrollment ---- */

.auth-qr {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    margin-bottom: 1.5rem;
    padding: 1.125rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.625rem;
}

.auth-qr__code { flex: 0 0 auto; width: 7rem; height: 7rem; }
.auth-qr__code svg { width: 100%; height: 100%; }

.auth-qr__manual { font-size: 0.875rem; color: #6B7280; line-height: 1.6; }
.auth-qr__manual code {
    display: inline-block;
    margin-top: 0.3125rem;
    font-size: 0.9375rem;
    font-family: monospace;
    color: #374151;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0.25rem;
    padding: 0.1875rem 0.4375rem;
    word-break: break-all;
}

/* ---- Responsive: collapse the split panel below lg ---- */

@media (max-width: 991.98px) {
    .auth-shell { flex-direction: column; min-height: auto; }

    .auth-shell__brand {
        flex: 0 0 auto;
        padding: 1.75rem 2rem 2.5rem;
    }

    .auth-shell__headline { font-size: 1.75rem; }
    .auth-shell__tagline { margin-bottom: 1rem; }

    .auth-shell__content {
        flex: 1;
        padding: 2rem 1.25rem;
        align-items: flex-start;
    }

    .auth-card { max-width: 33rem; margin: 0 auto; }
}

@media (max-width: 575.98px) {
    .auth-shell__brand { padding: 1.25rem 1.25rem 2rem; }
    .auth-shell__headline { font-size: 1.5rem; }
    .auth-shell__tagline { font-size: 0.9375rem; }
    .auth-shell__motif-box--1, .auth-shell__motif-box--2 { display: none; }

    .auth-shell__content { padding: 1.25rem 1rem; }
    .auth-card { padding: 1.75rem 1.375rem 2rem; }

    .auth-qr { flex-direction: column; align-items: flex-start; }
}
