:root {
    --color-brand-navy: #0A1A3F;
    --color-brand-cyan: #31A9BC;
    --color-brand-gold: #C99A3F;
    --color-night: #060D1F;
    --color-cyan-soft: #9BDDEE;
    --color-gray-light: #F5F8FB;
    --color-gray-blue: #5A6B85;
    --color-surface: rgba(255, 255, 255, 0.1);
    --color-border: rgba(255, 255, 255, 0.14);
    --font-heading: Georgia, Cambria, "Times New Roman", serif;
    --font-interface: Inter, "Source Sans 3", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-interface);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(10, 26, 63, 0.24), rgba(6, 13, 31, 0.34)),
        url("/static/images/login-desktop.webp") center center / cover no-repeat;
}

.auth-body-centered {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 3rem 3.25rem 2.5rem;
    overflow: hidden;
}

.auth-visual-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(10, 26, 63, 0.18), rgba(10, 26, 63, 0.34)),
        radial-gradient(circle at top right, rgba(49, 169, 188, 0.08), transparent 36%);
}

.auth-visual-brandmark {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 2;
}

.auth-visual-logo {
    width: 250px;
    height: 100px;
    object-fit: contain;
    box-shadow: none;
}

.auth-visual-content {
    position: relative;
    z-index: 2;
    max-width: 40rem;
    margin-top: 31rem;
}

.auth-kicker {
    margin: 0 0 0.6rem;
    color: var(--color-cyan-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-title-line-1,
.auth-title-line-2 {
    display: inline;
}

.auth-description {
    margin: 0;
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.45;
}

.auth-description-single {
    white-space: normal;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 40px;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 3rem 2.2rem 2rem;
    border-radius: 28px;
    background: rgba(11, 26, 53, 0.74);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(18px);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
}

.auth-card-compact {
    max-width: 460px;
}

.auth-copy {
    margin-top: 0;
}

.auth-copy h2,
.auth-copy-title-compact {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.06;
    letter-spacing: -0.02em;
}

.auth-copy p,
.auth-copy-line {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    font-size: 1rem;
}

.auth-copy-security h2 {
    font-size: 2.35rem;
    line-height: 1.05;
}

.auth-form,
.auth-magic-form {
    margin-top: 24px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.auth-field label {
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--color-brand-cyan);
    box-shadow: 0 0 0 4px rgba(49, 169, 188, 0.14);
}

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

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
}

.auth-button {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-brand-cyan), #1592a7);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-button-secondary {
    background: transparent;
    border: 1px solid rgba(49, 169, 188, 0.42);
    color: var(--color-cyan-soft);
}

.auth-divider {
    margin: 26px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.62);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.auth-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.9rem;
}

.auth-messages {
    margin-top: 16px;
}

.auth-message {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(201, 154, 63, 0.14);
    border: 1px solid rgba(201, 154, 63, 0.24);
    color: #fff;
}

.auth-qr-block {
    margin: 18px 0;
    text-align: center;
}

.auth-qr-image {
    max-width: 220px;
    width: 100%;
    background: #fff;
    padding: 12px;
    border-radius: 16px;
}

.auth-message-break {
    word-break: break-all;
}
/* ==========================================================================
   AUTH — TABLET
   Mantém hero e card lado a lado.
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1080px) {
    .auth-shell {
        grid-template-columns:
            minmax(0, 1.05fr)
            minmax(340px, 0.95fr);
    }

    .auth-visual {
        min-width: 0;
        min-height: 100vh;
        padding: 2rem 1.75rem;
    }

    .auth-visual-brandmark {
        top: 1.5rem;
        left: 1.5rem;
    }

    .auth-visual-logo {
        width: 200px;
        height: 80px;
    }

    .auth-visual-content {
        max-width: 100%;
        margin-top: auto;
        margin-bottom: 3rem;
    }

    .auth-title {
        max-width: 100%;
        font-size: clamp(2rem, 4vw, 3rem);
        line-height: 1.08;
        white-space: normal;
    }

    .auth-description {
        max-width: 100%;
        font-size: 0.95rem;
        white-space: normal;
    }

    .auth-panel {
        min-width: 0;
        padding: 1.5rem;
    }

    .auth-card {
        width: 100%;
        max-width: 430px;
        padding: 2.25rem 1.75rem 1.75rem;
        border-radius: 24px;
    }

    .auth-copy h2,
    .auth-copy-title-compact {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body.auth-body {
        background:
            linear-gradient(180deg, rgba(10, 26, 63, 0.20), rgba(6, 13, 31, 0.28)),
            url("/static/images/login-mobile.webp") center top / cover no-repeat;
    }

    .auth-shell {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .auth-visual {
    position: relative;
    min-height: clamp(260px, 34vh, 380px);
    padding: 1rem 1.1rem 0.5rem;
    justify-content: flex-end;
    
    }

    .auth-visual-brandmark {
        position: absolute;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
        width: auto;
        margin: 0;
    }

    .auth-visual-logo {
        width: 170px;
        height: 58px;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-visual-content {
        max-width: 100%;
        margin-top: 0;
        padding: 2.3rem 0 1.8rem;
    }

    .auth-kicker {
        margin: 0 0 0.45rem;
        font-size: 0.74rem;
        letter-spacing: 0.12em;
        line-height: 1.2;
        text-align: left;
    }

    .auth-title {
        margin: 0 0 0.8rem;
        font-size: 1.78rem;
        line-height: 1;
        max-width: 17.5rem;
        white-space: normal;
    }

    .auth-title-line-1,
    .auth-title-line-2 {
        display: block;
    }

    .auth-description {
        margin: 0;
        max-width: 17rem;
        color: rgba(255, 255, 255, 0.88);
        font-size: 0.9rem;
        line-height: 1.34;
        white-space: normal;
    }

    .auth-description-single {
        white-space: normal;
    }

    .auth-panel {
        margin-top: 0.15rem;
        padding: 0 0.9rem 1rem;
    }

    .auth-card {
        width: 100%;
        max-width: none;
        padding: 1.1rem;
        border-radius: 24px;
    }

    .auth-copy h2,
    .auth-copy-title-compact {
        font-size: 1.7rem;
        line-height: 1.02;
        margin-bottom: 0.35rem;
    }

    .auth-copy-line {
        font-size: 0.88rem;
        line-height: 1.3;
    }

    .auth-copy-security h2 {
        font-size: 1.95rem;
    }

    .auth-form,
    .auth-magic-form {
        margin-top: 18px;
    }

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

    .auth-field input {
        min-height: 50px;
    }

    .auth-button {
        min-height: 50px;
    }

    .auth-footer {
        margin-top: 18px;
        padding-top: 14px;
        gap: 6px;
        font-size: 0.82rem;
        line-height: 1.3;
    }
}

@media (min-width: 1081px) {
    .auth-title {
        white-space: nowrap;
    }

    .auth-title-line-1,
    .auth-title-line-2 {
        display: inline;
    }

    .auth-description {
        white-space: nowrap;
    }
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100%;
    min-height: 54px;
    padding: 0 54px 0 16px;
}

.password-field .password-toggle-icon {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    outline: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.password-field .password-toggle-icon:hover {
    color: #ffffff;
}

.password-field .password-toggle-icon:focus {
    outline: none;
    box-shadow: none;
}

.password-eye {
    position: absolute;
    inset: 0;
    margin: auto;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.password-eye-off {
    opacity: 0;
}

.password-toggle-icon.is-visible .password-eye-open {
    opacity: 0;
}

.password-toggle-icon.is-visible .password-eye-off {
    opacity: 1;
}

.auth-row.auth-row-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-link-helper,
.auth-link-helper:link,
.auth-link-helper:visited {
    display: inline-block;
    color: #ffffff !important;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link-helper:hover,
.auth-link-helper:focus {
    color: #ffffff !important;
    text-decoration: underline;
}

/* ==========================================================================
   AUTH CARD — CONTRASTE DOS TEXTOS
   ========================================================================== */

.auth-card,
.auth-card h1,
.auth-card h2,
.auth-card h3,
.auth-card label,
.auth-card strong {
    color: #ffffff;
}

.auth-card .auth-copy p,
.auth-card .auth-copy-line,
.auth-card .auth-checkbox,
.auth-card .auth-checkbox span,
.auth-card .auth-footer {
    color: rgba(255, 255, 255, 0.78);
}

.auth-card .auth-link-helper,
.auth-card .auth-link-helper:link,
.auth-card .auth-link-helper:visited {
    color: #ffffff !important;
}

.auth-card .auth-field input {
    color: #ffffff;
}

.auth-card .auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

html[data-viewport="mobile"] body.auth-body {
    background:
        linear-gradient(
            180deg,
            rgba(10, 26, 63, 0.20),
            rgba(6, 13, 31, 0.28)
        ),
        var(
            --login-background-mobile,
            url("/static/images/login-mobile.webp")
        )
        center top / cover no-repeat;
}

html[data-viewport="mobile"] .auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html[data-viewport="mobile"] .auth-visual {
    position: relative;
    min-height: clamp(260px, 34vh, 380px);
    padding: 1rem 1.1rem 0.5rem;
    justify-content: flex-end;
}

html[data-viewport="mobile"] .auth-panel {
    margin-top: 0.15rem;
    padding: 0 0.9rem 1rem;
}

/* =========================================================
   BOTÃO FECHAR PREVIEW
   ========================================================= */

.login-preview-close {

    position: fixed;

    top: calc(16px + env(safe-area-inset-top));

    left: 16px;

    z-index: 9999;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    min-height: 42px;

    padding: 0 16px;

    border: none;

    border-radius: 999px;

    background: rgba(10,26,63,.88);

    color: #FFF;

    font-size: .82rem;

    font-weight: 700;

    box-shadow: 0 12px 30px rgba(0,0,0,.25);

    cursor: pointer;
}

.login-preview-close[hidden]{

    display:none;

}

@media (min-width:769px){

    .login-preview-close{

        display:none!important;

    }

}