/* Telas de acesso fora da plataforma (esqueci a senha, criar senha nova): mesmo visual do login */
:root {
    --bg-base: #050505;
    --surface: rgba(10, 10, 10, 0.6);
    --border: rgba(212, 175, 55, 0.2);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --primary: #D4AF37; 
    --primary-hover: #f3ce56;
    --primary-fg: #000000;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* A página rola quando o cartão é mais alto que a tela (celular com a barra do navegador): o cartão fica no meio
   pelo margin auto (com espaço sobrando) e começa no topo quando não cabe. O fundo fica parado atrás (fixed) */
body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    background-color: var(--bg-base);
    color: var(--text-main);
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5,5,5,0.7), rgba(5,5,5,0.95)), url('../imagens/login.webp') center / cover no-repeat;
    z-index: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    body::before {
        background: linear-gradient(to bottom, rgba(5,5,5,0.7), rgba(5,5,5,0.95)), url('../imagens/mlogin.webp') center / cover no-repeat;
    }
}

.premium-loader {
    position: fixed; inset: 0;
    background: var(--bg-base); z-index: 999999; display: flex;
    align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.premium-loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.loader-logo-wrapper::before {
    content: ''; position: absolute; width: 100px; height: 100px; border-radius: 50%;
    border: 3px solid var(--primary); border-top-color: transparent; border-bottom-color: transparent;
    animation: spin-premium 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; opacity: 0.6;
}
.loader-logo-wrapper::after {
    content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%;
    border: 1px dashed rgba(212, 175, 55, 0.4); animation: spin-premium-reverse 3s linear infinite;
}
.loader-logo { width: 60px; height: auto; position: relative; z-index: 2; animation: pulse-glow-premium 2s infinite ease-in-out; }

@keyframes spin-premium { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-premium-reverse { 0% { transform: rotate(360deg); } 100% { transform: rotate(0deg); } }
@keyframes pulse-glow-premium {
    0% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.2)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.8)); }
    100% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.2)); }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px; 
    margin: auto 0;
    background: var(--surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand { text-align: center; margin-bottom: 1.5rem; }
.brand img { height: 70px; object-fit: contain; filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.3)); }

.welcome-msg { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 1px; }

.title { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; letter-spacing: -0.5px; }
.title span { color: var(--primary); }

.alert {
    background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.8rem 1rem; border-radius: var(--radius); font-size: 0.85rem;
    display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem;
    opacity: 0; transform: translateY(-10px); transition: transform 0.4s ease, opacity 0.4s ease;
    display: none; will-change: transform, opacity;
}
.alert.show { display: flex; opacity: 1; transform: translateY(0); }

.caps-aviso { display: flex; align-items: center; gap: 6px; margin: -0.6rem 0 1rem; color: var(--primary); font-size: 0.78rem; }
.caps-aviso svg { width: 14px; height: 14px; }
.caps-aviso[hidden] { display: none; }

.form-group { position: relative; margin-bottom: 1.25rem; }

.form-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); transition: color var(--transition); pointer-events: none;
    width: 18px; height: 18px;
}

.form-input {
    width: 100%; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius); color: var(--text-main); font-size: 0.95rem;
    padding: 1rem 1rem 1rem 2.8rem; transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
    outline: none;
    user-select: auto; 
    -webkit-user-select: auto;
    -ms-user-select: auto;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover, 
.form-input:-webkit-autofill:focus, 
.form-input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #0a0a0a inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-input::placeholder { color: var(--text-muted); font-size: 0.9rem; }

.form-input:focus {
    border-color: var(--primary); background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.form-input:focus + .form-icon { color: var(--primary); }

.toggle-pw {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; background: none; border: none;
    transition: color var(--transition); padding: 0; display: flex; align-items: center;
}
.toggle-pw:hover { color: var(--primary); }
.toggle-pw svg { width: 18px; height: 18px; }

.options { display: flex; justify-content: space-between; align-items: center; margin: 1.25rem 0 2rem; font-size: 0.85rem; }

.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted); transition: color var(--transition); }
.checkbox-wrapper:hover { color: var(--text-main); }

.checkbox-input {
    appearance: none; width: 16px; height: 16px; border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px; background: rgba(0, 0, 0, 0.5); cursor: pointer; position: relative;
    transition: background-color var(--transition), border-color var(--transition);
}
.checkbox-input:checked { background: var(--primary); border-color: var(--primary); }
.checkbox-input:checked::after {
    content: ''; position: absolute; left: 5px; top: 2px; width: 3px; height: 7px;
    border: solid var(--primary-fg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.forgot-link { color: var(--text-muted); text-decoration: none; transition: color var(--transition); font-weight: 500; }
.forgot-link:hover { color: var(--primary); }

.btn-submit {
    width: 100%; background: linear-gradient(135deg, var(--primary) 0%, #a68820 100%);
    color: var(--primary-fg); border: none; border-radius: var(--radius);
    padding: 1rem; font-size: 0.95rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    text-transform: uppercase; letter-spacing: 0.5px; position: relative; overflow: hidden;
    will-change: transform;
}

.btn-submit::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-25deg); transition: 0.5s; z-index: 1; pointer-events: none;
}

.btn-submit:hover:not(:disabled)::after { left: 150%; }

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; background: #333; color: #888; }

.btn-submit svg { z-index: 2; width: 18px; height: 18px; }
.btn-submit span { z-index: 2; }
.girar { animation: spin-premium 1s linear infinite; }

@media (max-width: 480px) {
    body { padding: 1rem 0.85rem; }
    .login-wrapper { padding: 1.6rem 1.25rem; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.05); }
    .brand { margin-bottom: 1rem; }
    .brand img { height: 56px; }
    .options { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .title { font-size: 1.3rem; }
}

/* ---------- Esqueci a senha / senha nova ---------- */
.intro-text { margin: -0.75rem 0 1.5rem; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; text-align: center; }
.alert { align-items: flex-start; line-height: 1.45; }
.alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.alert.sucesso { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.alert small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 0.8rem; }
.back-link { margin-top: 1.5rem; text-align: center; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: color var(--transition); }
.back-link a svg { width: 16px; height: 16px; }
.back-link a:hover { color: var(--primary); }
.btn-sec { width: 100%; margin-top: 0.75rem; padding: 0.85rem; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius); background: transparent; color: var(--text-main); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: border-color var(--transition), color var(--transition); }
.btn-sec:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-sec:disabled { color: var(--text-muted); cursor: not-allowed; }
.regras { display: grid; gap: 6px; margin: -0.4rem 0 1.25rem; padding: 0; list-style: none; font-size: 0.8rem; color: var(--text-muted); }
.regras li { display: flex; align-items: center; gap: 8px; transition: color var(--transition); }
.regras li svg { width: 14px; height: 14px; flex-shrink: 0; }
.regras li .ok { display: none; }
.regras li.cumprida { color: #10b981; }
.regras li.cumprida .ok { display: block; }
.regras li.cumprida .falta { display: none; }
.form-input.nao-bate { border-color: rgba(239, 68, 68, 0.5); }
.conta-email { margin: -1rem 0 1.5rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; overflow-wrap: anywhere; }
.conta-email b { color: var(--text-main); font-weight: 600; }
[hidden] { display: none !important; }

/* ===== Boas-vindas (primeiro acesso): passos, força da senha, dicas dos campos ===== */
form[hidden] { display: none !important; }
.bv-passos { display: flex; gap: 8px; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.bv-passos li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; color: #777; font-size: .8rem; font-weight: 600; }
.bv-passos li b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: .7rem; }
.bv-passos li.ativo { border-color: var(--primary); color: #fff; }
.bv-passos li.ativo b { background: var(--primary); color: #111; }
.bv-passos li.feito { color: var(--primary); }
.bv-passos li.feito b { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.forca { display: flex; align-items: center; gap: 4px; margin: -0.4rem 0 .6rem; }
.forca span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); transition: background .2s; }
.forca em { min-width: 44px; color: #888; font-size: .72rem; font-style: normal; text-align: right; }
.forca[data-nivel="1"] span:nth-child(1) { background: #ef4444; }
.forca[data-nivel="2"] span:nth-child(-n+2) { background: #f59e0b; }
.forca[data-nivel="3"] span:nth-child(-n+3) { background: #22c55e; }
.bv-dica { min-height: 0; margin: -0.7rem 0 .9rem; color: #888; font-size: .76rem; line-height: 1.4; }
.bv-dica:empty { display: none; }
.bv-dica.ok { color: #22c55e; }
.bv-dica.erro { color: #ef4444; }
.bv-suporte { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; margin-top: 10px; text-decoration: none; }
.bv-suporte svg { width: 16px; height: 16px; }
.bv-num { white-space: nowrap; opacity: .75; font-weight: 500; }
.bv-suporte.destaque { border-color: var(--primary); color: var(--primary); }
.bv-seguro { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 1.2rem 0 0; color: #666; font-size: .74rem; text-align: center; }
.bv-seguro svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Telas baixas (celular com teclado ou barra do navegador): menos espaço vertical para o botão aparecer sem rolar tanto */
@media (max-height: 760px) {
    .brand { margin-bottom: 0.75rem; }
    .brand img { height: 48px; }
    .title { margin-bottom: 1rem; }
    .intro-text { margin: -0.4rem 0 1rem; font-size: 0.84rem; }
    .form-group { margin-bottom: 1rem; }
    .form-input { padding-top: 0.85rem; padding-bottom: 0.85rem; }
    .regras { gap: 4px; margin-bottom: 1rem; }
    .back-link { margin-top: 1rem; }
}

/* Acesso vencido (acesso_vencido.php): o que ele construiu, os cursos e os caminhos para renovar */
.av-caixa { max-width: 400px; }
.av-numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 0 0 1.2rem; }
.av-numeros div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius); background: rgba(255, 255, 255, 0.02); text-align: center; }
.av-numeros b { color: var(--primary); font-size: 1.15rem; }
.av-numeros span { color: var(--text-muted); font-size: .7rem; line-height: 1.25; }
.av-rotulo { margin: 0 0 .5rem; color: var(--text-muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.av-cursos { display: flex; flex-direction: column; gap: 6px; margin: 0 0 1.3rem; padding: 0; list-style: none; }
.av-cursos li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; font-size: .84rem; }
.av-cursos svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--primary); }
.av-cursos span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
.av-btn svg { width: 17px; height: 17px; }
.av-ajuda { margin: 1.2rem 0 0; color: var(--text-muted); font-size: .78rem; text-align: center; }
.av-ajuda a { color: var(--primary); text-decoration: none; white-space: nowrap; }
.av-sair { display: block; margin-top: .8rem; color: #666; font-size: .76rem; text-align: center; text-decoration: none; }
.av-sair:hover { color: var(--text-muted); }
.btn-submit.av-btn { text-transform: none; letter-spacing: 0; font-size: 1rem; }

/* Celular: o iPhone dá zoom na tela ao tocar num campo com letra menor que 16px (tira a cara de app no PWA).
   Em tela de toque, todo campo de digitar fica com 16px; no computador nada muda */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
    textarea, select, [contenteditable=""], [contenteditable="true"] { font-size: 16px !important; }
}
.av-apostilas span { flex: 1; }
.av-apostilas a { flex-shrink: 0; color: var(--primary); font-weight: 600; text-decoration: none; font-size: .8rem; }
.av-apostilas a:hover { text-decoration: underline; }
