/* ===== RESET ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== VARIÁVEIS DE MARCA ===== */
:root {
    --marca:        #6366f1;
    --marca-escura: #4f46e5;
    --texto:        #1e293b;
    --texto-fraco:  #64748b;
    --borda:        #e2e6f3;
    --fundo-campo:  #f7f8fd;
}

/* ===== BODY ===== */
body {
    min-height: 100vh;
    font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #eef1fb, #e4e8f8);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--texto);
}

/* ===== CARTÃO DE LOGIN ===== */
.login {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 16px;
    width: 400px;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 24px 55px rgba(79, 70, 229, 0.18);
    animation: fadeIn 0.5s ease;
}

/* Barra de destaque no topo (estilo Guardião: border-top colorido) */
.login__top {
    height: 5px;
    background: linear-gradient(90deg, var(--marca), var(--marca-escura));
}

.login__body {
    padding: 34px 40px 40px;
    text-align: center;
}

/* ===== ÍCONE DE ELEFANTE ===== */
.login__icone {
    width: 92px;
    height: 92px;
    margin: 4px auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef0ff, #e2e5ff);
    border: 1px solid var(--borda);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.20);
}

.login__icone svg {
    width: 58px;
    height: 58px;
}

.login__icone .corpo  { fill: var(--marca); }
.login__icone .tromba { stroke: var(--marca); stroke-width: 8; stroke-linecap: round; }
.login__icone .olho   { fill: #ffffff; }

/* ===== TÍTULO ===== */
.login h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--marca);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login__acesso {
    font-size: 14px;
    color: var(--texto-fraco);
    margin-bottom: 26px;
}

.login__acesso strong {
    color: var(--marca);
    font-weight: 700;
}

/* ===== FORMULÁRIO ===== */
.login__form {
    text-align: left;
}

.campo {
    display: block;
    margin-bottom: 16px;
}

.campo__rotulo {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 6px;
}

.login input[type="text"],
.login input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--borda);
    background: var(--fundo-campo);
    color: var(--texto);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login input::placeholder {
    color: #a0abc0;
}

.login input:focus {
    border-color: var(--marca);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    background: #ffffff;
}

/* Mantém o input claro mesmo no autofill do navegador */
.login input:-webkit-autofill,
.login input:-webkit-autofill:hover,
.login input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--texto);
    -webkit-box-shadow: 0 0 0 1000px var(--fundo-campo) inset;
    box-shadow: 0 0 0 1000px var(--fundo-campo) inset;
    caret-color: var(--texto);
    transition: background-color 9999s ease-in-out 0s;
}

/* ===== MOSTRAR SENHA (checkbox, estilo Guardião) ===== */
.mostrar-senha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--texto-fraco);
    cursor: pointer;
    user-select: none;
    margin: 2px 0 22px;
}

.mostrar-senha input {
    width: 16px;
    height: 16px;
    accent-color: var(--marca);
    cursor: pointer;
}

/* ===== BOTÃO ===== */
.login button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--marca), var(--marca-escura));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.32);
    transition: transform 0.12s, box-shadow 0.12s;
}

.login button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.42);
}

/* ===== ESQUECI MINHA SENHA ===== */
.login__esqueci {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: var(--marca);
    text-decoration: none;
    font-weight: 600;
}

.login__esqueci:hover {
    text-decoration: underline;
}

/* ===== ERRO ===== */
.erro {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* ===== ANIMAÇÃO ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   TEMA DARK — login
================================================== */
@media (prefers-color-scheme: dark) {
    body {
        background: #16181d;
        color: #e7e9ee;
    }

    .login {
        background: #262a31;
        border-color: #3a404b;
        box-shadow: 0 24px 55px rgba(0, 0, 0, 0.5);
    }

    .login__body { color: #e7e9ee; }

    .login__icone {
        background: linear-gradient(135deg, #2f333c, #363b46);
        border-color: #3a404b;
    }

    .campo__rotulo { color: #e7e9ee; }
    .login__acesso { color: #9aa0ac; }

    .login input[type="text"],
    .login input[type="password"] {
        background: #333844;
        border-color: #3a404b;
        color: #e7e9ee;
    }
    .login input::placeholder { color: #6b7280; }
    .login input:focus {
        background: #333844;
        border-color: var(--marca);
    }

    .login input:-webkit-autofill,
    .login input:-webkit-autofill:hover,
    .login input:-webkit-autofill:focus {
        -webkit-text-fill-color: #e7e9ee;
        -webkit-box-shadow: 0 0 0 1000px #333844 inset;
        box-shadow: 0 0 0 1000px #333844 inset;
        caret-color: #e7e9ee;
    }

    .mostrar-senha { color: #9aa0ac; }

    .erro {
        background: #3a1a1d;
        color: #f87171;
        border-color: #6b2a2e;
    }
}
