/**
 * PrintPOS Pro - Login premium L3.2.
 *
 * Pantalla completa inspirada en el mockup aprobado:
 * panel de marca lateral, corte diagonal y experiencia móvil app-first.
 * La tipografía se hereda del sistema global `data-font-family`.
 */

.auth-page {
    --auth-blue: #2563eb;
    --auth-blue-strong: #1d4ed8;
    --auth-navy: #07142a;
    --auth-navy-2: #102f68;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #d7e2f1;
    --auth-mint: #10b981;
    --auth-panel: #ffffff;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-ink);
    background: #ffffff;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

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

.auth-shell {
    min-height: 100dvh;
}

.auth-login {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 56%) minmax(430px, 44%);
    overflow: hidden;
    background: var(--auth-panel);
}

.auth-visual {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: grid;
    align-content: space-between;
    gap: clamp(34px, 4vw, 58px);
    margin-right: clamp(-150px, -8vw, -88px);
    padding:
        clamp(42px, 5vw, 72px)
        clamp(150px, 13vw, 230px)
        clamp(46px, 5vw, 76px)
        clamp(46px, 5vw, 78px);
    color: #ffffff;
    clip-path: polygon(0 0, calc(100% - clamp(110px, 8vw, 160px)) 0, 100% 50%, calc(100% - clamp(110px, 8vw, 160px)) 100%, 0 100%);
    background:
        radial-gradient(circle at 74% 78%, rgba(37, 99, 235, .32), transparent 34%),
        radial-gradient(circle at 10% 18%, rgba(96, 165, 250, .16), transparent 28%),
        linear-gradient(145deg, #061124 0%, #0b234d 54%, #153c84 100%);
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 126px),
        linear-gradient(28deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 144px);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, .58), transparent 88%);
}

.auth-visual__brand {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 600px;
}

.auth-logo {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-blue-strong), #4f8df7);
    color: #ffffff;
    font-size: 28px;
    box-shadow: 0 20px 44px rgba(37, 99, 235, .28);
}

.auth-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.auth-logo--image {
    width: min(190px, 18vw);
    height: 58px;
    padding: 0;
    place-items: center start;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-logo--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    filter:
        drop-shadow(0 0 1px rgba(255, 255, 255, .70))
        drop-shadow(.6px 0 0 rgba(219, 234, 254, .48))
        drop-shadow(-.6px 0 0 rgba(219, 234, 254, .48))
        drop-shadow(0 .6px 0 rgba(219, 234, 254, .42))
        drop-shadow(0 -.6px 0 rgba(219, 234, 254, .42))
        drop-shadow(0 0 10px rgba(147, 197, 253, .46))
        drop-shadow(0 14px 24px rgba(2, 6, 23, .28));
}

.auth-logo--fallback {
    background: linear-gradient(135deg, var(--auth-blue-strong), #4f8df7);
}

.auth-logo--image + div {
    padding-left: 18px;
    border-left: 1px solid rgba(219, 234, 254, .30);
}

.auth-logo--image + div h1 {
    display: none;
}

.auth-visual__brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(28px, 2.25vw, 38px);
    line-height: 1;
    font-weight: 840;
    letter-spacing: -.052em;
}

.auth-visual__brand p {
    margin: 0;
    max-width: 340px;
    overflow: hidden;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 940;
    letter-spacing: .065em;
    text-shadow: 0 2px 12px rgba(147, 197, 253, .26);
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-visual__content {
    width: min(100%, 620px);
    transform: translateY(-1vh);
}

.auth-chip,
.auth-access__badge {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 820;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.auth-chip {
    max-width: min(100%, 360px);
    margin-bottom: 24px;
    overflow: hidden;
    color: #1d4ed8;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(219, 234, 254, .88);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-visual__content h2 {
    max-width: 650px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(40px, 4vw, 64px);
    line-height: 1.15;
    font-weight: 840;
    letter-spacing: -.048em;
    text-wrap: balance;
}

.auth-visual__content p {
    max-width: 560px;
    margin: 24px 0 0;
    color: rgba(226, 232, 240, .82);
    font-size: clamp(15px, 1.15vw, 18px);
    line-height: 1.65;
}

.auth-visual__content p span {
    display: block;
    margin-top: 14px;
    color: rgba(191, 219, 254, .78);
    font-size: 13px;
    font-weight: 820;
    letter-spacing: .025em;
}

.auth-favicon-mark {
    position: absolute;
    top: 50%;
    right: clamp(70px, 5.4vw, 96px);
    z-index: 4;
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(219, 234, 254, .92);
    box-shadow:
        0 22px 52px rgba(2, 6, 23, .24),
        0 0 0 10px rgba(255, 255, 255, .08);
    transform: translateY(-50%);
}

.auth-favicon-mark img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.auth-visual__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-visual__footer span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    color: rgba(226, 232, 240, .88);
    background: rgba(15, 23, 42, .24);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 14px;
    font-weight: 800;
}

.auth-form-area {
    position: relative;
    min-height: 100dvh;
    display: grid;
    align-items: center;
    padding:
        clamp(42px, 5vw, 72px)
        clamp(44px, 6vw, 92px)
        clamp(42px, 5vw, 72px)
        clamp(145px, 12vw, 220px);
    background:
        radial-gradient(circle at 100% 0, rgba(37, 99, 235, .07), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, .09), transparent 34%),
        #ffffff;
}

.auth-theme-toggle {
    position: absolute;
    top: 32px;
    right: 32px;
    z-index: 5;
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 16px;
    background: rgba(255, 255, 255, .90);
    color: #0f172a;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .09);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.auth-theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .34);
    box-shadow: 0 20px 46px rgba(37, 99, 235, .14);
}

.auth-theme-toggle:focus-visible,
.auth-submit:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .26);
    outline-offset: 3px;
}

.auth-access {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
}

.auth-access__mobile-brand {
    display: none;
}

.auth-access__header {
    margin-bottom: 28px;
}

.auth-access__badge {
    max-width: min(100%, 360px);
    margin-bottom: 18px;
    overflow: hidden;
    color: #047857;
    background: rgba(16, 185, 129, .11);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-access__header h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(40px, 3.55vw, 56px);
    line-height: .96;
    font-weight: 840;
    letter-spacing: -.065em;
}

.auth-access__header p {
    margin: 16px 0 0;
    color: var(--auth-muted);
    font-size: 15.5px;
    line-height: 1.6;
    font-weight: 620;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: 18px;
    background: rgba(254, 242, 242, .95);
    color: #991b1b;
    font-weight: 750;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 9px;
}

.auth-field label {
    color: #24324a;
    font-size: 14px;
    font-weight: 820;
}

.auth-input {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 17px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .025);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.auth-input:focus-within {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .70);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10), 0 14px 28px rgba(15, 23, 42, .06);
}

.auth-input i {
    color: #64748b;
    font-size: 19px;
}

.auth-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 16px;
    font-weight: 720;
}

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

.auth-password-toggle {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    color: #2563eb;
    font-size: 17px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.auth-password-toggle:hover {
    transform: translateY(-1px);
    background: rgba(37, 99, 235, .14);
    color: #1d4ed8;
}

.auth-password-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .24);
    outline-offset: 2px;
}

.auth-submit {
    min-height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--auth-blue-strong);
    color: #ffffff;
    font-size: 16px;
    font-weight: 880;
    box-shadow: 0 20px 42px rgba(37, 99, 235, .25);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    background: #1e40af;
    box-shadow: 0 24px 54px rgba(37, 99, 235, .31);
}

html[data-bs-theme="dark"] .auth-page {
    color: #e2e8f0;
    background: #020617;
}

html[data-bs-theme="dark"] .auth-login {
    background: #020617;
}

html[data-bs-theme="dark"] .auth-form-area {
    background:
        radial-gradient(circle at 100% 0, rgba(59, 130, 246, .11), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, .08), transparent 34%),
        #020617;
}

html[data-bs-theme="dark"] .auth-theme-toggle {
    background: rgba(15, 23, 42, .90);
    border-color: rgba(148, 163, 184, .24);
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .auth-access__header h2,
html[data-bs-theme="dark"] .auth-field label,
html[data-bs-theme="dark"] .auth-input input {
    color: #f8fafc;
}

html[data-bs-theme="dark"] .auth-access__header p {
    color: #94a3b8;
}

html[data-bs-theme="dark"] .auth-input {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .76);
}

html[data-bs-theme="dark"] .auth-password-toggle {
    background: rgba(37, 99, 235, .18);
    color: #93c5fd;
}

html[data-bs-theme="dark"] .auth-input:focus-within {
    background: rgba(15, 23, 42, .95);
}

html[data-bs-theme="dark"] .auth-alert {
    background: rgba(127, 29, 29, .22);
    border-color: rgba(248, 113, 113, .24);
    color: #fecaca;
}

@media (max-width: 1240px) {
    .auth-login {
        grid-template-columns: minmax(0, 54%) minmax(410px, 46%);
    }

    .auth-visual {
        padding-left: 44px;
        padding-right: clamp(130px, 12vw, 190px);
    }

    .auth-form-area {
        padding-left: clamp(128px, 11vw, 180px);
        padding-right: clamp(32px, 4vw, 62px);
    }

    .auth-visual__content h2 {
        font-size: clamp(38px, 4.45vw, 56px);
    }
}

@media (max-width: 980px) {
    .auth-page {
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 38%),
            linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
    }

    .auth-login {
        display: block;
        min-height: 100dvh;
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 38%),
            linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
    }

    .auth-visual {
        min-height: clamp(210px, 34dvh, 280px);
        display: flex;
        align-items: flex-start;
        justify-content: center;
        margin-right: 0;
        padding:
            max(30px, env(safe-area-inset-top))
            max(22px, env(safe-area-inset-right))
            78px
            max(22px, env(safe-area-inset-left));
        clip-path: polygon(0 0, 100% 0, 100% 70%, 60% 88%, 50% 98%, 40% 88%, 0 70%);
    }

    .auth-visual::before {
        mask-image: linear-gradient(180deg, rgba(0, 0, 0, .52), transparent 92%);
    }

    .auth-visual__brand {
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        text-align: center;
    }

    .auth-logo--image {
        width: min(198px, 52vw);
        height: 62px;
        place-items: center;
    }

    .auth-logo--image img {
        object-position: center;
        filter:
            drop-shadow(0 0 1px rgba(255, 255, 255, .74))
            drop-shadow(.6px 0 0 rgba(219, 234, 254, .54))
            drop-shadow(-.6px 0 0 rgba(219, 234, 254, .54))
            drop-shadow(0 .6px 0 rgba(219, 234, 254, .50))
            drop-shadow(0 -.6px 0 rgba(219, 234, 254, .50))
            drop-shadow(0 0 13px rgba(147, 197, 253, .54))
            drop-shadow(0 16px 28px rgba(2, 6, 23, .30));
    }

    .auth-logo--image + div {
        padding-left: 0;
        border-left: 0;
    }

    .auth-visual__brand p {
        max-width: 230px;
        margin-top: 0;
        margin-left: auto;
        margin-right: auto;
        color: rgba(219, 234, 254, .92);
    }

    .auth-visual__content,
    .auth-visual__footer {
        display: none;
    }

    .auth-favicon-mark {
        top: auto;
        right: auto;
        bottom: 10px;
        left: 50%;
        width: 58px;
        height: 58px;
        border-color: rgba(219, 234, 254, .96);
        box-shadow:
            0 16px 36px rgba(2, 6, 23, .20),
            0 0 0 8px rgba(255, 255, 255, .10);
        transform: translateX(-50%);
    }

    .auth-favicon-mark img {
        width: 36px;
        height: 36px;
    }

    .auth-form-area {
        min-height: calc(100dvh - clamp(210px, 34dvh, 280px));
        display: block;
        margin-top: -42px;
        padding:
            0
            max(18px, env(safe-area-inset-right))
            max(28px, env(safe-area-inset-bottom))
            max(18px, env(safe-area-inset-left));
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .10), transparent 38%),
            linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
    }

    .auth-theme-toggle {
        top: max(20px, env(safe-area-inset-top));
        right: max(18px, env(safe-area-inset-right));
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }

    .auth-access {
        width: 100%;
        max-width: 430px;
        margin: 0 auto;
        padding-top: 44px;
    }

    .auth-access__header {
        margin-bottom: 24px;
    }

    .auth-access__badge {
        margin-bottom: 14px;
    }

    .auth-access__header h2 {
        font-size: clamp(38px, 11vw, 50px);
    }

    .auth-input,
    .auth-submit {
        min-height: 58px;
    }

    html[data-bs-theme="dark"] .auth-login {
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .14), transparent 38%),
            linear-gradient(180deg, #020617 0%, #041513 100%);
    }

    html[data-bs-theme="dark"] .auth-page {
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .14), transparent 38%),
            linear-gradient(180deg, #020617 0%, #041513 100%);
    }

    html[data-bs-theme="dark"] .auth-form-area {
        background:
            radial-gradient(circle at 100% 0, rgba(37, 99, 235, .14), transparent 38%),
            linear-gradient(180deg, #020617 0%, #041513 100%);
    }
}

@media (max-width: 520px) {
    .auth-visual {
        min-height: 198px;
        padding-bottom: 68px;
    }

    .auth-logo {
        width: 54px;
        height: 54px;
        border-radius: 17px;
    }

    .auth-logo img {
        width: 39px;
        height: 39px;
    }

    .auth-logo--image {
        width: min(194px, 54vw);
        height: 60px;
    }

    .auth-logo--image img {
        width: 100%;
        height: 100%;
    }

    .auth-favicon-mark {
        bottom: 8px;
        width: 54px;
        height: 54px;
    }

    .auth-favicon-mark img {
        width: 34px;
        height: 34px;
    }

    .auth-visual__brand h1 {
        font-size: 25px;
    }

    .auth-form-area {
        min-height: calc(100dvh - 198px);
        margin-top: -36px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .auth-access {
        padding-top: 38px;
    }

    .auth-access__header p {
        font-size: 15px;
    }

}

@media (max-height: 760px) and (min-width: 981px) {
    .auth-visual,
    .auth-form-area {
        padding-top: 34px;
        padding-bottom: 34px;
    }

    .auth-visual__content {
        transform: none;
    }

    .auth-visual__content h2 {
        font-size: clamp(36px, 3.7vw, 54px);
    }

    .auth-visual__content p {
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-theme-toggle,
    .auth-submit,
    .auth-input {
        transition: none;
    }
}
