/* ==========================================================================
   Lanzerr — pantallas de acceso
   Estructura split del diseño de referencia, con la identidad de marca Lanzerr.
   ========================================================================== */

.auth-screen {
    --a-surface: #FFFFFF;
    --a-surface-3: #EEF5F0;
    --a-ink: #172A28;
    --a-ink-2: #33463F;
    --a-muted: #62726F;
    --a-line: #E4EBE7;
    --a-line-2: #D3E0D8;
    --a-brand: #096D58;
    --a-brand-2: #07866A;
    --a-lime: #DCF6DF;
    --a-brand-soft: rgba(9, 109, 88, .10);
    --a-danger: #BE123C;
    --a-danger-soft: rgba(244, 63, 94, .10);
    --a-ok: #0E9F6E;
    --a-ok-soft: rgba(14, 159, 110, .12);

    --a-dark: #112E2B;
    --a-dark-ink: #F0FAF4;
    --a-dark-ink-2: #D8ECE2;
    --a-dark-muted: #A9C3B7;
    --a-dark-brand: #9FE7B9;

    --a-radius: 12px;
    --a-radius-lg: 28px;
    --a-ease: cubic-bezier(.2, .7, .2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-screen {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--a-ink);
    background:
        radial-gradient(46% 42% at 12% 10%, rgba(9, 109, 88, .10), transparent 60%),
        radial-gradient(40% 38% at 88% 8%, rgba(220, 246, 223, .65), transparent 60%),
        radial-gradient(50% 46% at 80% 100%, rgba(9, 109, 88, .10), transparent 64%),
        linear-gradient(160deg, #F8FBF9 0%, #F2F7F4 55%, #EAF3EE 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.auth-screen a {
    color: var(--a-brand);
    text-decoration: none;
    transition: color .18s var(--a-ease);
}

body.auth-screen a:hover {
    color: var(--a-brand-2);
}

body.auth-screen img {
    max-width: 100%;
    display: block;
}

body.auth-screen h1,
body.auth-screen h2,
body.auth-screen p {
    margin-top: 0;
}

body.auth-screen ::selection {
    background: var(--a-lime);
    color: var(--a-dark);
}

/* ---------- Theme toggle ---------- */

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.auth-theme-toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--a-line);
    background: var(--a-surface);
    color: var(--a-ink-2);
    cursor: pointer;
    transition: color .18s var(--a-ease), background-color .18s var(--a-ease), border-color .18s var(--a-ease), box-shadow .18s var(--a-ease);
}

.auth-theme-toggle:hover {
    color: var(--a-brand);
    border-color: var(--a-line-2);
    background: var(--a-surface-3);
}

.auth-theme-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-theme-toggle .icon-moon {
    display: none;
}

html.dark .auth-theme-toggle .icon-sun {
    display: none;
}

html.dark .auth-theme-toggle .icon-moon {
    display: block;
}

/* ---------- Layout ---------- */

.auth-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 48px 24px;
}

.auth-split {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
    background: var(--a-surface);
    border: 1px solid var(--a-line);
    border-radius: var(--a-radius-lg);
    box-shadow: 0 30px 70px rgba(17, 46, 43, .14);
    overflow: hidden;
}

.auth-form-panel {
    padding: 46px 44px;
    min-width: 0;
}

.auth-side {
    min-width: 0;
    display: flex;
}

.auth-side > * {
    width: 100%;
}

.auth-brand {
    display: inline-flex;
    margin-bottom: 0;
}

.auth-brand img {
    height: 36px;
    width: auto;
}

/* ---------- Form heading ---------- */

.auth-title {
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--a-ink);
}

.auth-lead {
    color: var(--a-muted);
    font-size: 14.5px;
    margin-bottom: 24px;
}

/* ---------- Alerts ---------- */

.alert {
    border-radius: var(--a-radius);
    padding: 13px 15px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--a-danger-soft);
    border-color: rgba(244, 63, 94, .22);
    color: var(--a-danger);
}

.alert-success {
    background: var(--a-ok-soft);
    border-color: rgba(14, 159, 110, .24);
    color: var(--a-ok);
}

.auth-notice {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-radius: var(--a-radius);
    padding: 13px 15px;
    margin-bottom: 20px;
    font-size: 13.5px;
    line-height: 1.5;
    background: var(--a-brand-soft);
    border: 1px solid rgba(9, 109, 88, .18);
    color: var(--a-ink-2);
}

.auth-notice strong {
    color: var(--a-brand);
    font-weight: 750;
}

.auth-notice b {
    color: var(--a-ink);
}

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

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 7px;
    color: var(--a-ink-2);
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"],
.field input[type="search"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--a-line);
    border-radius: var(--a-radius);
    font-family: inherit;
    font-size: 15px;
    color: var(--a-ink);
    background: var(--a-surface);
    outline: none;
    transition: border-color .18s var(--a-ease), box-shadow .18s var(--a-ease), background-color .18s var(--a-ease);
}

.field input::placeholder {
    color: #94A69E;
}

.field input:focus {
    border-color: var(--a-brand);
    box-shadow: 0 0 0 4px var(--a-brand-soft);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--a-ink);
    -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset;
    caret-color: var(--a-ink);
    transition: background-color 9999s ease-in-out 0s;
}

.auth-password {
    position: relative;
}

.auth-password input {
    padding-right: 48px;
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--a-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: color .18s var(--a-ease), background-color .18s var(--a-ease);
}

.auth-eye:hover {
    color: var(--a-ink);
    background: var(--a-surface-3);
}

.auth-eye svg {
    width: 18px;
    height: 18px;
}

.auth-eye .icon-eye-off {
    display: none;
}

.auth-eye.is-revealed .icon-eye {
    display: none;
}

.auth-eye.is-revealed .icon-eye-off {
    display: block;
}

/* ---------- Remember / links ---------- */

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 18px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--a-ink-2);
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--a-brand);
}

.auth-link {
    font-size: 13.5px;
    font-weight: 650;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: var(--a-radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .18s var(--a-ease), background-color .18s var(--a-ease), border-color .18s var(--a-ease), color .18s var(--a-ease), box-shadow .18s var(--a-ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(180deg, #07866A 0%, #096D58 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(9, 109, 88, .24);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(9, 109, 88, .32);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: var(--a-surface);
    border-color: var(--a-line);
    color: var(--a-ink);
}

.btn-ghost:hover {
    color: var(--a-ink);
    border-color: var(--a-line-2);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 40px;
    padding: 0 16px;
    font-size: 13.5px;
    border-radius: 10px;
}

/* ---------- Bottom links ---------- */

.auth-register {
    margin: 20px 0 0;
    font-size: 14px;
    color: var(--a-muted);
    text-align: center;
}

.auth-register a {
    font-weight: 700;
}

.auth-back {
    margin: 0;
    font-size: 13.5px;
    color: var(--a-muted);
}

.auth-back a {
    color: var(--a-muted);
    font-weight: 600;
}

.auth-back a:hover {
    color: var(--a-brand);
}

/* ---------- Register extras ---------- */

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--a-muted);
    margin: 2px 0 18px;
}

.auth-terms input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex: none;
    accent-color: var(--a-brand);
}

.auth-terms a {
    font-weight: 650;
}

/* ---------- Right panel: autorización externa ---------- */

.auth-qr-panel {
    min-height: 100%;
    padding: 46px 40px;
    background:
        radial-gradient(85% 60% at 50% 0%, rgba(159, 231, 185, .12), transparent 60%),
        var(--a-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--a-dark-ink);
}

.auth-qr-kicker {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--a-dark-brand);
    margin-bottom: 10px;
}

.auth-qr-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 8px;
    color: var(--a-dark-ink);
}

.auth-qr-text {
    color: var(--a-dark-muted);
    font-size: 13.5px;
    max-width: 310px;
    margin: 0 auto 24px;
}

.auth-qr-start {
    max-width: 300px;
    margin-bottom: 22px;
}

.auth-qr-frame[hidden],
.auth-qr-status[hidden],
.auth-qr-timer[hidden],
.auth-qr-refresh[hidden],
.auth-qr-start[hidden] {
    display: none;
}

.auth-qr-frame {
    position: relative;
    width: 218px;
    height: 218px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    padding: 14px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, .28);
}

.auth-qr-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity .3s var(--a-ease);
}

.auth-qr-frame.is-ready img {
    opacity: 1;
}

.auth-qr-spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: var(--a-dark-brand);
    animation: a-spin .9s linear infinite;
}

.auth-qr-spinner[hidden] {
    display: none;
}

@keyframes a-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-qr-status {
    margin: 18px 0 0;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--a-dark-ink-2);
}

.auth-qr-timer {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--a-dark-muted);
}

.auth-qr-timer[hidden] {
    display: none;
}

.auth-qr-timer b {
    color: var(--a-dark-brand);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.auth-qr-refresh {
    margin-top: 14px;
}

.auth-qr-panel .btn-ghost {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
    color: var(--a-dark-ink);
}

.auth-qr-panel .btn-ghost:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}

.auth-qr-apps {
    margin-top: auto;
    padding-top: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--a-dark-muted);
}

.auth-qr-apps span {
    width: 100%;
    margin-bottom: 2px;
}

.auth-qr-apps a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 650;
    color: var(--a-dark-ink-2);
}

.auth-qr-apps a:hover {
    color: var(--a-dark-brand);
}

.auth-qr-apps svg {
    width: 16px;
    height: 16px;
}

/* ---------- Right panel: benefits (register) ---------- */

.auth-benefits {
    min-height: 100%;
    padding: 46px 40px;
    background:
        radial-gradient(85% 60% at 50% 0%, rgba(159, 231, 185, .12), transparent 60%),
        var(--a-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--a-dark-ink);
}

.auth-benefits-kicker {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--a-dark-brand);
    margin-bottom: 10px;
}

.auth-benefits-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin-bottom: 10px;
    color: var(--a-dark-ink);
}

.auth-benefits-text {
    color: var(--a-dark-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.auth-benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--a-dark-ink-2);
}

.auth-benefits-list strong {
    display: block;
    color: var(--a-dark-ink);
    font-weight: 700;
}

.auth-benefits-list span {
    display: block;
    color: var(--a-dark-muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.auth-benefits-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(159, 231, 185, .14);
    color: var(--a-dark-brand);
}

.auth-benefits-icon svg {
    width: 17px;
    height: 17px;
}

/* ---------- Dark theme ---------- */

html.dark .auth-screen {
    --a-surface: #111A2B;
    --a-surface-3: #1B2638;
    --a-ink: #F1F5F9;
    --a-ink-2: #C3CFDD;
    --a-muted: #94A3B8;
    --a-line: #263449;
    --a-line-2: #334155;
    --a-brand: #34D399;
    --a-brand-2: #6EE7B7;
    --a-lime: #064E3B;
    --a-brand-soft: rgba(52, 211, 153, .14);
    --a-danger: #FB7185;
    --a-danger-soft: rgba(244, 63, 94, .16);
    --a-ok: #34D399;
    --a-ok-soft: rgba(16, 185, 129, .16);
    --a-dark: #0B1F19;
    --a-dark-ink: #F0FAF4;
    --a-dark-ink-2: #D8ECE2;
    --a-dark-muted: #A9C3B7;
    --a-dark-brand: #9FE7B9;
}

html.dark body.auth-screen {
    background:
        radial-gradient(46% 42% at 12% 10%, rgba(16, 185, 129, .16), transparent 60%),
        radial-gradient(40% 38% at 88% 8%, rgba(4, 120, 87, .22), transparent 60%),
        radial-gradient(50% 46% at 80% 100%, rgba(16, 185, 129, .12), transparent 64%),
        linear-gradient(160deg, #0B1120 0%, #0F172A 55%, #0B1120 100%) !important;
}

html.dark .auth-brand img {
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
}

html.dark .field input:-webkit-autofill,
html.dark .field input:-webkit-autofill:hover,
html.dark .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #E2E8F0;
    -webkit-box-shadow: 0 0 0 1000px #0F172A inset;
    caret-color: #E2E8F0;
}

html.dark .btn-primary {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    box-shadow: 0 12px 26px rgba(16, 185, 129, .28);
}

html.dark .btn-primary:hover {
    box-shadow: 0 16px 34px rgba(16, 185, 129, .36);
}

html.dark .auth-theme-toggle {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}

html.dark .auth-qr-panel,
html.dark .auth-benefits {
    border-left: 1px solid var(--a-line);
}

/* ---------- Register: Buyesia ID + benefits stack ---------- */

.auth-side-stack {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.auth-qr-panel--compact {
    min-height: 0;
    padding: 30px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.auth-qr-panel--compact .auth-qr-title {
    font-size: 19px;
}

.auth-qr-panel--compact .auth-qr-text {
    margin-bottom: 18px;
}

.auth-qr-panel--compact .auth-qr-frame {
    width: 178px;
    height: 178px;
}

.auth-qr-panel--compact .auth-qr-apps {
    margin-top: 18px;
    padding-top: 0;
}

.auth-side-stack .auth-benefits {
    min-height: 0;
    flex: 1;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .auth-shell {
        padding: 28px 16px;
    }

    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-form-panel {
        padding: 36px 28px;
    }

    .auth-title {
        font-size: 25px;
    }

    .auth-qr-panel,
    .auth-benefits {
        padding: 34px 28px;
        border-left: 0;
    }

    html.dark .auth-qr-panel,
    html.dark .auth-benefits {
        border-left: 0;
    }

    .auth-qr-apps {
        padding-top: 22px;
    }
}

@media (max-width: 520px) {
    .auth-form-panel,
    .auth-qr-panel,
    .auth-benefits {
        padding-left: 22px;
        padding-right: 22px;
    }

    .auth-grid-2 {
        grid-template-columns: 1fr;
    }

    .auth-row {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- Onboarding steps ---------- */
.auth-steps {
    list-style: none;
    margin: 22px 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.auth-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.auth-step-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--a-brand-soft);
    color: var(--a-brand);
    font-size: 12px;
    font-weight: 800;
}

.auth-step-copy {
    min-width: 0;
}

.auth-step-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--a-ink);
}

.auth-step-copy > span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--a-muted);
}

.auth-benefits a {
    color: var(--a-dark-brand);
    text-decoration: underline;
}
