/*
   Telas deslogadas (login, senha, cadastro, confirmação, termos): o formulário fica direto sobre a foto da cidade, sem cartão.
   O tom vem da marca, em data-auth-tone no <html>: Wise2go esverdeado, WiiMove preto.
   Toda regra começa em html[data-auth-tone] para vencer o app-theme-dark.css, que também é carregado nestas telas.
*/

html[data-auth-tone="verde"] {
    --auth-ground: #0b1d2b;
    --auth-scrim: 11, 29, 43;
    --auth-label: #dce8ee;
    --auth-muted: #d2e0e7;
    --auth-soft: #b8ccd6;
    --auth-link: #9adeeb;
    --auth-line: #7e9bac;
    --auth-field: #10293a;
    --auth-panel: rgba(16, 41, 58, .88);
    --auth-error-line: #ffa99c;
    --auth-error: #ffc4ba;
    --auth-button: #6fcbdd;
    --auth-button-ink: #06222a;
    --auth-focus: #9adeeb;
}

html[data-auth-tone="preto"] {
    --auth-ground: #060708;
    --auth-scrim: 6, 7, 8;
    --auth-label: #e6e8ea;
    --auth-muted: #cdd1d5;
    --auth-soft: #b3b8bd;
    --auth-link: #ffffff;
    --auth-line: #7b8187;
    --auth-field: #141618;
    --auth-panel: rgba(20, 22, 24, .88);
    --auth-error-line: #ff9c8e;
    --auth-error: #ffbdb2;
    --auth-button: #ffffff;
    --auth-button-ink: #060708;
    --auth-focus: #ffffff;
}

/* A tela é sempre escura, nos dois temas: sem isto, no tema claro o navegador pinta os campos com cores claras. */
html[data-auth-tone] {
    color-scheme: dark;
    background: var(--auth-ground);
}

html[data-auth-tone] body.auth-page {
    margin: 0;
    min-height: 100vh;
    color: #ffffff;
    background: var(--auth-ground);
    font-family: Lato, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html[data-auth-tone] .auth-page *,
html[data-auth-tone] .auth-page *::before,
html[data-auth-tone] .auth-page *::after {
    box-sizing: border-box;
}

/* ---------- Foto e véu ---------- */

html[data-auth-tone] .auth-photo {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% 100%;
}

html[data-auth-tone] .auth-scrim {
    position: fixed;
    inset: 0;
    background: linear-gradient(90deg, var(--auth-ground) 0%, rgba(var(--auth-scrim), .94) 30%, rgba(var(--auth-scrim), 0) 58%);
}

/* Cadastro e termos: coluna mais larga, a foto recua. */
html[data-auth-tone] .auth-page--wide .auth-photo {
    object-position: 0% 100%;
}

html[data-auth-tone] .auth-page--wide .auth-scrim {
    background: linear-gradient(90deg, var(--auth-ground) 0%, rgba(var(--auth-scrim), .96) 42%, rgba(var(--auth-scrim), 0) 74%);
}

/* ---------- Coluna ---------- */

html[data-auth-tone] .auth-main {
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 480px;
    margin-left: clamp(0px, 6vw, 96px);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
}

html[data-auth-tone] .auth-page--wide .auth-main {
    max-width: 680px;
}

html[data-auth-tone] .auth-logo {
    align-self: flex-start;
    display: block;
    line-height: 0;
}

html[data-auth-tone] .auth-logo img {
    width: 168px;
    height: auto;
    filter: brightness(0) invert(1);
}

html[data-auth-tone] .auth-content {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

html[data-auth-tone] .auth-heading {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html[data-auth-tone] .auth-title {
    margin: 0;
    color: #ffffff;
    font-size: 44px;
    line-height: 1.12;
    font-weight: 900;
    text-wrap: balance;
}

html[data-auth-tone] .auth-text {
    margin: 0;
    color: var(--auth-muted);
    font-size: 17px;
    line-height: 1.5;
}

html[data-auth-tone] .auth-icon {
    color: var(--auth-link);
    line-height: 0;
}

/* ---------- Formulário ---------- */

html[data-auth-tone] .auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
}

html[data-auth-tone] .auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

html[data-auth-tone] .auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

html[data-auth-tone] .auth-field-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 12px;
}

html[data-auth-tone] .auth-page .auth-label {
    margin: 0;
    color: var(--auth-label);
    font-size: 15px;
    font-weight: 700;
}

html[data-auth-tone] .auth-field .auth-input {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px;
    color: #ffffff;
    background: var(--auth-field);
    border: 1px solid var(--auth-line);
    border-radius: 4px;
    box-shadow: none;
    font: inherit;
    font-size: 16px;
}

/* Preenchimento automático: o Chrome pinta o campo de azul-claro e o olho da senha, claro, some. Mantém a cor do campo. */
html[data-auth-tone] .auth-field .auth-input:-webkit-autofill,
html[data-auth-tone] .auth-field .auth-input:-webkit-autofill:hover,
html[data-auth-tone] .auth-field .auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    box-shadow: 0 0 0 40px var(--auth-field) inset;
    caret-color: #ffffff;
}

html[data-auth-tone] .auth-field .auth-input[aria-invalid="true"],
html[data-auth-tone] .auth-field .auth-input.has-error {
    border: 2px solid var(--auth-error-line);
}

html[data-auth-tone] .auth-password {
    position: relative;
    color: var(--auth-label);
}

html[data-auth-tone] .auth-field .auth-password .auth-input {
    padding-right: 52px;
}

html[data-auth-tone] .auth-page .auth-eye {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

html[data-auth-tone] .auth-eye .auth-eye-off,
html[data-auth-tone] .auth-eye[aria-pressed="true"] .auth-eye-on {
    display: none;
}

html[data-auth-tone] .auth-eye[aria-pressed="true"] .auth-eye-off {
    display: block;
}

html[data-auth-tone] .auth-hint {
    margin: 0;
    display: flex;
    gap: 8px;
    color: var(--auth-soft);
    font-size: 14px;
    line-height: 1.4;
}

/* ---------- Ações ---------- */

html[data-auth-tone] .auth-page .auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 16px;
    color: var(--auth-button-ink);
    background: var(--auth-button);
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 17px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

html[data-auth-tone] .auth-page .auth-button:hover,
html[data-auth-tone] .auth-page .auth-button:focus {
    color: var(--auth-button-ink);
    text-decoration: none;
    filter: brightness(1.06);
}

html[data-auth-tone] .auth-page .auth-button-secondary {
    flex: 1 1 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 12px;
    color: #ffffff;
    border: 1px solid var(--auth-line);
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
}

html[data-auth-tone] .auth-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

html[data-auth-tone] .auth-page a.auth-link,
html[data-auth-tone] .auth-page .auth-text a,
html[data-auth-tone] .auth-page .auth-terms a {
    color: var(--auth-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

html[data-auth-tone] .auth-page a.auth-link:hover,
html[data-auth-tone] .auth-page .auth-text a:hover {
    color: var(--auth-link);
    text-decoration-thickness: 2px;
}

html[data-auth-tone] .auth-link-strong {
    font-weight: 700;
}

html[data-auth-tone] .auth-page a:focus-visible,
html[data-auth-tone] .auth-page button:focus-visible,
html[data-auth-tone] .auth-page input:focus-visible {
    outline: 3px solid var(--auth-focus);
    outline-offset: 2px;
}

/* ---------- Avisos ---------- */

html[data-auth-tone] .auth-alert,
html[data-auth-tone] .auth-notice {
    margin: 0;
    display: flex;
    gap: 10px;
    font-size: 16px;
    line-height: 1.45;
}

html[data-auth-tone] .auth-alert {
    color: var(--auth-error);
}

html[data-auth-tone] .auth-notice {
    color: var(--auth-muted);
}

html[data-auth-tone] .auth-alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

html[data-auth-tone] .auth-alert svg,
html[data-auth-tone] .auth-notice svg,
html[data-auth-tone] .auth-hint svg {
    flex: none;
    margin-top: 2px;
}

/* ---------- Cadastro e termos ---------- */

html[data-auth-tone] .auth-community {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    color: var(--auth-muted);
}

html[data-auth-tone] .auth-community img {
    flex: none;
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
}

html[data-auth-tone] .auth-community strong {
    display: block;
    color: #ffffff;
    font-size: 18px;
}

html[data-auth-tone] .auth-community > span > span {
    display: block;
}

html[data-auth-tone] .auth-community .auth-avatar {
    flex: none;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-button-ink);
    background: var(--auth-button);
    border-radius: 50%;
    font-size: 19px;
    font-weight: 900;
    object-fit: cover;
}

/* O que a pessoa herda ao entrar pelo link de onboarding. */
html[data-auth-tone] .auth-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    background: var(--auth-panel);
    border: 1px solid var(--auth-line);
    border-radius: 6px;
}

html[data-auth-tone] .auth-page .auth-panel-title {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
}

html[data-auth-tone] .auth-facts {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 20px;
}

html[data-auth-tone] .auth-facts dt {
    color: var(--auth-soft);
    font-size: 13px;
    font-weight: 400;
}

html[data-auth-tone] .auth-facts dd {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

html[data-auth-tone] .auth-field-error {
    margin: 0;
    color: var(--auth-error);
    font-size: 15px;
    line-height: 1.4;
}

html[data-auth-tone] .auth-field-error:empty {
    display: none;
}

html[data-auth-tone] .auth-field .auth-input[aria-invalid="true"] {
    border: 2px solid var(--auth-error-line);
}

/* Regras da senha, marcadas conforme a pessoa digita. */
html[data-auth-tone] .auth-rules {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--auth-soft);
    font-size: 14px;
    line-height: 1.4;
}

html[data-auth-tone] .auth-rules li::before {
    content: "○";
    display: inline-block;
    width: 1.4em;
}

html[data-auth-tone] .auth-rules li[data-met="true"] {
    color: #ffffff;
}

html[data-auth-tone] .auth-rules li[data-met="true"]::before {
    content: "✓";
    color: var(--auth-link);
}

html[data-auth-tone] .auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-muted);
    font-size: 16px;
}

html[data-auth-tone] .auth-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--auth-button);
}

html[data-auth-tone] .auth-check label {
    margin: 0;
    font-weight: 400;
}

html[data-auth-tone] .auth-steps {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--auth-muted);
    font-size: 16px;
}

html[data-auth-tone] .auth-inline-form {
    margin: 0;
}

html[data-auth-tone] .auth-page .auth-link-button {
    padding: 0;
    color: var(--auth-link);
    background: none;
    border: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

html[data-auth-tone] .auth-terms {
    max-width: 68ch;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

html[data-auth-tone] .auth-terms h1,
html[data-auth-tone] .auth-terms h2,
html[data-auth-tone] .auth-terms h3,
html[data-auth-tone] .auth-terms strong,
html[data-auth-tone] .auth-terms b {
    color: #ffffff;
}

/* ---------- Celular: a foto vira uma faixa no alto ---------- */

@media (max-width: 900px) {
    html[data-auth-tone] .auth-photo {
        position: absolute;
        height: 300px;
        object-position: 54% 58%;
    }

    html[data-auth-tone] .auth-scrim,
    html[data-auth-tone] .auth-page--wide .auth-scrim {
        position: absolute;
        height: 301px;
        background: linear-gradient(180deg, rgba(var(--auth-scrim), .15) 0%, rgba(var(--auth-scrim), .55) 45%, var(--auth-ground) 100%);
    }

    html[data-auth-tone] .auth-main,
    html[data-auth-tone] .auth-page--wide .auth-main {
        min-height: 0;
        margin: 0 auto;
        padding: 24px 20px 32px;
        justify-content: flex-start;
        gap: 22px;
    }

    html[data-auth-tone] .auth-logo img {
        width: 128px;
    }

    html[data-auth-tone] .auth-content {
        padding-top: 150px;
    }

    html[data-auth-tone] .auth-title {
        font-size: 34px;
    }

    html[data-auth-tone] .auth-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    html[data-auth-tone] .auth-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-auth-tone] .auth-page * {
        transition: none;
    }
}
