/* ===== RESET E ESTILOS GLOBAIS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: #031638;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

/* Círculos decorativos - ajustados para não causarem overflow */
body::before,
body::after {
    content: "";
    position: fixed;
    width: 500px;
    height: 500px;
    border: 2px solid rgba(214, 171, 74, 0.12);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
body::before {
    top: -250px;
    left: -250px;
}
body::after {
    bottom: -250px;
    right: -250px;
}

/* ===== CONTAINER PRINCIPAL ===== */
.login {
    width: 400px;
    max-width: 100%;
    position: relative;
    z-index: 1;
    /* Ajuste para subir levemente em telas pequenas */
    margin-top: -20px;
}

/* ===== TOPO ===== */
.top {
    text-align: center;
    margin-bottom: 20px;
}

.brasao {
    width: 180px;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 0 20px rgba(255, 196, 54, 0.4));
    transition: transform 0.3s ease;
}
.brasao:hover {
    transform: scale(1.04);
}

.top h1 {
    font-size: 56px;
    font-weight: 900;
    font-style: italic;
    color: #d9af4d;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 198, 64, 0.25);
    line-height: 1.1;
    margin-bottom: 4px;
}

.top p {
    color: #d7b46f;
    letter-spacing: 6px;
    font-size: 13px;
    font-weight: 300;
    margin-top: 0;
    text-transform: uppercase;
}

/* ===== CARD ===== */
.card {
    background: #08234d;
    padding: 28px 24px 24px;
    border-radius: 28px;
    border: 1px solid rgba(214, 171, 74, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

/* ===== LABELS ===== */
.card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: #d7b46f;
    text-transform: uppercase;
}

/* ===== CAMPOS DE ENTRADA ===== */
.input-group-custom {
    height: 52px;
    background: #102d5c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 18px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.input-group-custom:focus-within {
    border-color: #d9af4d;
    box-shadow: 0 0 0 3px rgba(217, 175, 77, 0.2);
}

.input-group-custom i {
    color: #bfa15a;
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: color 0.3s;
}
.input-group-custom:focus-within i {
    color: #f3cf6d;
}

.input-group-custom input {
    flex: 1;
    height: 100%;
    background: transparent !important;
    border: none;
    outline: none;
    padding: 0 12px;
    color: #fff;
    font-size: 16px;
    letter-spacing: 0.3px;
}

/* Corrige autofill branco */
.input-group-custom input:-webkit-autofill,
.input-group-custom input:-webkit-autofill:hover,
.input-group-custom input:-webkit-autofill:focus,
.input-group-custom input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #102d5c inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
    background-color: #102d5c !important;
    background: #102d5c !important;
}
.input-group-custom input:autofill,
.input-group-custom input:autofill:hover,
.input-group-custom input:autofill:focus {
    box-shadow: 0 0 0 1000px #102d5c inset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    background-color: #102d5c !important;
}

.input-group-custom input::placeholder {
    color: #6a7fa0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.input-group-custom .toggle-password {
    cursor: pointer;
    font-size: 18px;
    color: #bfa15a;
    transition: color 0.3s;
    margin-left: 6px;
}
.input-group-custom .toggle-password:hover {
    color: #f3cf6d;
}

/* ===== BOTÃO ===== */
.btn-entrar {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(145deg, #f3cf6d, #c6932d);
    color: #132547;
    margin-top: 6px;
    box-shadow: 0 4px 20px rgba(255, 196, 54, 0.35);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.btn-entrar::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    transform: scale(0.8);
}
.btn-entrar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(255, 215, 0, 0.5);
}
.btn-entrar:hover::after {
    opacity: 1;
    transform: scale(1);
}
.btn-entrar:active {
    transform: translateY(0px);
    box-shadow: 0 2px 15px rgba(255, 215, 0, 0.3);
}
.btn-entrar i {
    font-size: 20px;
}

/* ===== LINHA DE RECUPERAÇÃO ===== */
.forgot-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}
.forgot-row a {
    color: #8ea0c3;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}
.forgot-row a:hover {
    color: #d9af4d;
    text-decoration: none;
}

/* ===== RODAPÉ ===== */
.footer {
    margin-top: 28px;
    text-align: center;
    color: #d7b46f;
}
.footer i {
    font-size: 30px;
    margin-bottom: 6px;
    display: block;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.footer i:hover {
    opacity: 1;
}
.footer p {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.footer .version {
    font-size: 12px;
    color: #6f84aa;
    letter-spacing: 1px;
}

/* ===== TÍTULO DO CARD (para esqueci senha) ===== */
.card-title {
    text-align: center;
    color: #d9af4d;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ===== MENSAGENS DE RETORNO (para esqueci senha) ===== */
.msg-retorno {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
    font-size: 15px;
}
.msg-retorno.sucesso {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}
.msg-retorno.erro {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* ===== LINK VOLTAR AO LOGIN (para esqueci senha) ===== */
.back-link {
    text-align: center;
    margin-top: 16px;
    color: #8ea0c3;
    font-size: 15px;
}
.back-link a {
    color: #d9af4d;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.back-link a:hover {
    color: #f3cf6d;
    text-decoration: underline;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    .login {
        margin-top: -10px; /* Ajuste fino para subir um pouco */
    }
    .brasao {
        width: 180px;
        margin-bottom: 8px;
    }
    .top h1 {
        font-size: 60px;
        line-height: 70px;
        margin-bottom: 0px;
    }
    .top p {
        font-size: 11px;
        letter-spacing: 4px;
    }
    .card {
        padding: 20px 16px 18px;
        border-radius: 22px;
    }
    .input-group-custom {
        height: 48px;
        padding: 0 14px;
        margin-bottom: 14px;
    }
    .input-group-custom i {
        font-size: 16px;
        width: 20px;
    }
    .input-group-custom input {
        font-size: 15px;
        padding: 0 10px;
    }
    .btn-entrar {
        height: 46px;
        font-size: 17px;
    }
    .btn-entrar i {
        font-size: 18px;
    }
    .footer p {
        font-size: 16px;
    }
    .footer i {
        font-size: 26px;
    }
    .forgot-row a {
        font-size: 17px;
    }
    .card-title {
        font-size: 20px;
    }
}

@media (max-width: 380px) {
    body {
        padding: 10px;
    }
    .login {
        margin-top: 0; /* Remove o ajuste extra para telas muito pequenas */
    }
    .top h1 {
        font-size: 32px;
    }
    .brasao {
        width: 100px;
    }
    .card {
        padding: 16px 12px 14px;
    }
    .input-group-custom {
        height: 44px;
        padding: 0 12px;
    }
    .btn-entrar {
        height: 42px;
        font-size: 15px;
        gap: 8px;
    }
    .btn-entrar i {
        font-size: 16px;
    }
    .footer p {
        font-size: 14px;
    }
}

/* Ajuste para telas muito pequenas (altura) */
@media (max-height: 700px) {
    body {
        padding: 10px;
    }
    .login {
        margin-top: -15px;
    }
    .top {
        margin-bottom: 12px;
    }
    .brasao {
        width: 170px;
        margin-bottom: -5px;
    }
    .top h1 {
        font-size: 36px;
    }
    .top p {
        font-size: 17px;
        letter-spacing: 2px;
        text-transform: capitalize;
        font-weight: 300;
    }
    .card {
        padding: 16px 14px 14px;
    }
    .input-group-custom {
        height: 42px;
        margin-bottom: 12px;
    }
    .btn-entrar {
        height: 42px;
        font-size: 16px;
    }
    .footer {
        margin-top: 16px;
    }
    .footer i {
        font-size: 24px;
        margin-bottom: 4px;
    }
    .footer p {
        font-size: 14px;
    }
}

/* Ajuste para celulares com barra de navegação inferior (ex: iPhone com notch) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    .login {
        margin-top: calc(-20px + env(safe-area-inset-top, 0px));
    }
}