@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

html, body {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow-x: hidden; /* impede arrasto lateral */
    overflow-y: hidden;   /* mantém scroll normal */
}

/* Efeitos decorativos de fundo */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(10, 165, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(10, 165, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Container principal */
.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
    max-height: 700px;
}

/* Header com gradiente */
.login-header {
    background: linear-gradient(135deg, #0032ac 0%, #001a5c 100%);
    padding: 20px 20px 20px;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(10, 165, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.logo-container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo {
    width: 180px;
    height: auto;
    margin-bottom: 15px;
    filter: brightness(0) invert(1);
}

.login-title {
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 4%;
}

/* Formulário */
.login-form {
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    color: #333;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #0032ac;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95em;
    color: #333;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #0aa5ff;
    box-shadow: 0 0 0 4px rgba(10, 165, 255, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* Botão toggle senha */
.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #0aa5ff;
}

/* Checkbox "Lembrar-me" */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9em;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #333;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0aa5ff;
}

.forgot-link {
    color: #0aa5ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: #0032ac;
    text-decoration: underline;
}

/* Botão de login */
.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0aa5ff 0%, #0032ac 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(10, 165, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 165, 255, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login span {
    position: relative;
    z-index: 1;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
    font-size: 0.85em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    padding: 0 15px;
}

/* Links adicionais */
.additional-links {
    text-align: center;
}

.link-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px;
    background: white;
    color: #0032ac;
    border: 2px solid #0032ac;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 12px;
}

.btn-secondary:hover {
    background: #0032ac;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 50, 172, 0.3);
}

/* Footer */
.login-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #666;
    font-size: 0.85em;
}

.login-footer a {
    color: #0aa5ff;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Botão voltar (para fundo claro) */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.05);          /* leve cinza translúcido */
    backdrop-filter: blur(10px);              /* efeito vidro */
    border: 1px solid rgba(0, 0, 0, 0.1);     /* borda sutil */
    border-color:#0032ac;
    color: #0032ac;                           /* azul escuro da paleta */
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}


.back-button:focus-visible {
    outline: 2px solid #0aa5ff;
    outline-offset: 3px;
}

/* Responsividade */
@media (max-width: 768px) {
     body {
        align-items: flex-start; /* alinha o container no topo */
        padding-top: 10px; /* opcional — ajusta a distância do topo */
    }

    .login-container {
        max-width: 95%;
        border-radius: 20px;
    }

    .login-header {
        padding: 30px 25px 40px;
    }

    .logo {
        width: 150px;
    }

    .login-title {
        font-size: 1.5em;
    }

    .login-form {
        padding: 30px 25px;
    }

    .back-button {
        display: none !important;
    }
    .divider {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-header {
        padding: 25px 20px 35px;
    }

    .logo {
        width: 130px;
    }

    .login-title {
        font-size: 1.3em;
    }

    .login-subtitle {
        font-size: 0.85em;
    }

    .login-form {
        padding: 25px 20px;
    }

    .form-input {
        padding: 12px 12px 12px 40px;
        font-size: 0.9em;
    }

    .btn-login {
        padding: 13px;
        font-size: 0.95em;
    }

    .remember-forgot {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Loading state */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading span::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}