/* =======================================================
   TELA DE LOGIN - usa as cores do gira.css
   ======================================================= */

.login-page {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(32px, 6vw, 96px);
    width: min(1120px, calc(100% - 48px));
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 48px 0;
}

/* ---------- Lado da marca ---------- */
.login-showcase {
    position: relative;
    isolation: isolate;
    max-width: 540px;
}

/* O mesmo círculo suave que aparece atrás do hero da Home */
.login-showcase::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -8%;
    left: -14%;
    width: 118%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 42% 38%, var(--surface-strong) 0%, var(--surface) 48%, transparent 72%);
    opacity: 0.75;
}

.login-art img {
    display: block;
    width: 100%;
    height: auto;
}

.login-pitch {
    max-width: 26ch;
    margin: 28px 0 18px;
    color: var(--ink);
    font-size: clamp(20px, 2.1vw, 26px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.login-features {
    display: grid;
    gap: 11px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.login-features li {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.login-features li::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--turquoise);
    transform: translateY(-1px);
}

/* ---------- Painel do formulário ---------- */
.login-panel {
    justify-self: end;
    width: 100%;
    max-width: 440px;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 28px 64px #00000047;
}

/* Logo do painel. Só aparece no celular. */
.login-panel-logo {
    display: none;
}

.login-panel h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.05em;
}

.login-intro {
    margin: 10px 0 26px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Mensagens ---------- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 22px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.login-alert svg {
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-top: 1px;
}

.login-alert--error {
    border: 1px solid #FF7A8F66;
    background: #FF7A8F17;
    color: #FFD9DF;
}

.login-alert--error svg {
    color: var(--coral);
}

.login-alert--notice {
    border: 1px solid #FFDDA366;
    background: #FFDDA314;
    color: var(--accent-ink);
}

.login-alert--notice svg {
    color: var(--lime);
}

/* ---------- Campos ---------- */
.login-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.login-field label {
    font-size: 13px;
    font-weight: 700;
}

.login-input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--ink);
    font: 500 15px Manrope, Arial, sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input::placeholder {
    color: var(--muted);
}

.login-input:hover {
    border-color: #5A5D92;
}

.login-input:focus {
    outline: none;
    border-color: var(--turquoise);
    box-shadow: 0 0 0 3px #F9643647;
}

/* Evita o fundo amarelo do preenchimento automático do navegador */
.login-input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    box-shadow: 0 0 0 1000px var(--surface-soft) inset;
    caret-color: var(--ink);
}

.password-wrap {
    position: relative;
}

.password-wrap .login-input {
    padding-right: 92px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--turquoise);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: #FFFFFF12;
}

.password-toggle:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 1px;
}

.caps-hint {
    margin: 0;
    color: var(--lime);
    font-size: 12px;
    font-weight: 600;
}

/* ---------- Botões ---------- */
.login-submit {
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    background: var(--cta);
    color: var(--button-ink);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.login-submit:hover {
    background: var(--cta-hover);
    box-shadow: 0 9px 20px #FFDDA340;
    transform: translateY(-1px);
}

.login-submit:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px;
}

.login-submit:disabled {
    background: var(--cta);
    box-shadow: none;
    cursor: progress;
    opacity: 0.7;
    transform: none;
}

.login-help {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ---------- Modo desenvolvimento ---------- */
.login-dev {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
}

.login-dev p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.login-dev code {
    color: var(--lime);
    font: 500 12px 'DM Mono', monospace;
}

.login-dev-button {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.login-dev-button:hover {
    border-color: var(--lime);
    color: var(--lime);
}

.login-dev-button:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
    .login-page {
        grid-template-columns: 1fr;
        justify-items: center;
        align-content: center;
        width: min(460px, calc(100% - 32px));
        padding: 32px 0;
    }

    .login-showcase {
        display: none;
    }

    .login-panel {
        justify-self: stretch;
        max-width: none;
    }

    /* O SVG já vem recortado, sem margem sobrando. */
    .login-panel-logo {
        display: block;
        width: 132px;
        margin-bottom: 22px;
    }

    .login-panel-logo img {
        display: block;
        width: 100%;
        height: auto;
    }
}

@media (max-width: 420px) {
    .login-panel {
        padding: 24px 20px;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-input,
    .login-submit,
    .login-dev-button {
        transition: none;
    }

    .login-submit:hover {
        transform: none;
    }
}

/* Aceite do termo de uso de dados (LGPD) */
.login-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 20px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    cursor: pointer;
}
.login-consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--accent);
}
.login-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Logo no alto da lateral do login (computador) */
.login-showcase-brand {
    display: block;
    width: 128px;
    margin-bottom: 26px;
}
.login-showcase-brand img { display: block; width: 100%; height: auto; }

/* Entrar com Google / Microsoft */
.login-social {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    transition: border-color .15s, background .15s;
}
.social-button:hover { border-color: var(--accent); background: var(--surface-alt); }
.social-button svg { flex: none; }

.login-divider {
    position: relative;
    margin: 0 0 18px;
    text-align: center;
}
.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line);
}
.login-divider span {
    position: relative;
    padding: 0 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

/* Telas de senha: só o painel, sem a lateral da ilustração */
.login-page--single { grid-template-columns: 1fr; place-items: center; }
.login-page--single .login-panel { width: min(440px, 100%); justify-self: center; }
.login-page--single .login-panel-logo { display: block; width: 116px; margin-bottom: 24px; }
.login-page--single .login-panel-logo img { display: block; width: 100%; height: auto; }
.login-submit--ghost {
    display: block;
    margin-top: 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    text-align: center;
    line-height: 50px;
}
.login-submit--ghost:hover { border-color: var(--accent); color: var(--accent); }
.login-help a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Captcha da tela de login */
.login-captcha { display: grid; gap: 8px; }
.login-captcha-ajuda { margin: -2px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.captcha-box { display: flex; align-items: center; gap: 10px; }
.captcha-box img { flex: none; width: 240px; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.captcha-refresh { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-strong); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s; }
.captcha-refresh:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 420px) { .captcha-box img { width: 200px; } }


/* Cadastro visível na tela de login */
.login-signup-cta { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.login-signup-cta span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.login-create-account { display: flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--turquoise); border-radius: 10px; color: var(--turquoise); font-weight: 800; text-decoration: none; transition: transform .2s, background .2s, color .2s; }
.login-create-account:hover { transform: translateY(-1px); background: var(--cta); color: var(--button-ink); }
.login-create-account:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* Google é o caminho principal: largura total, maior e primeiro.
   Microsoft continua disponível, mas como opção secundária. */
.social-button--primary {
    min-height: 54px;
    border-color: var(--accent);
    background: var(--ink);
    color: var(--paper);
    font-size: 16px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}
.social-button--primary:hover { background: var(--accent-soft); color: var(--paper); border-color: var(--accent); }
.social-button--secondary {
    min-height: 44px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
}

/* Outras formas de entrar: código por e-mail e passkey */
.login-alt-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font: 700 14px/1.2 Manrope, system-ui, sans-serif;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.login-alt-button:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-alt); }
.login-alt-button:disabled { opacity: .6; cursor: progress; }
.login-passkey { margin-top: 4px; }
.login-passkey[hidden] { display: none; }
.login-passkey-status { min-height: 1.2em; margin: 8px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.login-code-intro { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.login-code-intro strong { color: var(--ink); }
.login-input--code { letter-spacing: .4em; font-size: 22px; font-weight: 700; text-align: center; }
.login-input--code::placeholder { letter-spacing: .4em; }

/* Isca do cadastro: fora da tela para pessoas e leitores de tela */
.signup-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Medidor de força da senha */
.password-meter { display: grid; gap: 6px; }
.password-meter[hidden] { display: none; }
.password-meter-bar { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.password-meter-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--danger); transition: width .2s, background .2s; }
.password-meter[data-level="ok"] .password-meter-bar > span { background: var(--accent-soft); }
.password-meter[data-level="boa"] .password-meter-bar > span,
.password-meter[data-level="forte"] .password-meter-bar > span { background: var(--accent); }
.password-meter-label { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Telas sem rodapé (cadastro): links legais discretos no fim do painel. */
.auth-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 18px; }
.auth-legal-links a { color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; min-height: 24px; display: inline-flex; align-items: center; }
.auth-legal-links a:hover { color: var(--accent); }
