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

html, 
body.login {
    height: 100%;
    min-height: 100vh;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== FUNDO COM DEGRADÊ SUPER SUAVE E BLUR ===== */
body.login {
    background: linear-gradient(
        145deg,
        var(--inaed-primary-light) 0%,
        var(--inaed-primary-medium) 25%,
        var(--inaed-primary) 50%,
        var(--inaed-primary-dark) 75%,
        var(--inaed-primary-dark) 100%
    ) !important;
    background-size: 400% 400% !important;
    animation: gradientFlow 15s ease infinite !important;
    font-family: var(--inaed-font-family);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow-x: hidden;
}

/* Animação suave do gradiente */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Camada de blur no fundo */
body.login::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 50%,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 1;
    animation: rotate 30s linear infinite;
}

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

/* Overlay com blur adicional */
body.login::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: radial-gradient(
        circle at 70% 30%,
        rgba(255, 117, 0, 0.03) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 2;
}

/* ===== CONTAINER PRINCIPAL ===== */
body.login div#login {
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 32px;
    padding: 32px 32px !important;
    width: 100%;
    max-width: 400px !important;
    margin: 0 auto !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.35);
    border-right-color: rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 25px 40px -15px rgba(0, 75, 129, 0.25),
        0 10px 20px -5px rgba(0, 75, 129, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset,
        0 -2px 0 rgba(0, 0, 0, 0.02) inset !important;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: glassAppear 0.8s ease-out;
}

@keyframes glassAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(20px);
    }
}

body.login div#login:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 30px 50px -15px rgba(0, 75, 129, 0.35),
        0 15px 30px -8px rgba(0, 75, 129, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    transform: translateY(-2px);
}

/* ===== LOGO ===== */
body.login h1 {
    margin-bottom: 20px !important;
    text-align: center;
    position: relative;
}

body.login h1 a {
    background-image: var(--inaed-logo-url) !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto 4px !important;
    display: block !important;
    transition: all 0.4s ease;
    filter: drop-shadow(0 15px 15px rgba(0, 75, 129, 0.2)) brightness(1.1);
    border-radius: 30px;
}

body.login h1 a:hover {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 20px 20px rgba(0, 75, 129, 0.3)) brightness(1.15);
}

body.login h1::after {
    content: "INAED";
    display: block;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--inaed-primary), #1a6aa8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
    margin-top: 4px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 75, 129, 0.2);
}

/* ===== FORMULÁRIO ===== */
body.login form {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Labels com cor corrigida para #004b81 */
body.login label {
    color: #004b81 !important;
    font-weight: 600;
    font-size: 13px !important;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* Labels específicas para páginas de recuperação de senha */
body.login .forgot-password label,
body.login .resetpass label,
body.login .setpassword label,
body.login #resetpassform label,
body.login #pass-strength-result {
    color: #004b81 !important;
}

/* Inputs */
body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"] {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-family: var(--inaed-font-family);
    transition: all 0.3s ease;
    color: #1a1a1a;
    width: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 
        0 4px 6px -2px rgba(0,0,0,0.02),
        inset 0 1px 3px rgba(0,0,0,0.02),
        inset 0 0 0 1px rgba(255,255,255,0.7);
}

body.login input[type="text"]:hover,
body.login input[type="password"]:hover,
body.login input[type="email"]:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.8);
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus,
body.login input[type="email"]:focus {
    background: white;
    border-color: rgba(0, 75, 129, 0.3);
    box-shadow: 
        0 0 0 4px rgba(0, 75, 129, 0.06),
        0 8px 12px -4px rgba(0, 75, 129, 0.1),
        inset 0 1px 2px rgba(0,0,0,0.02);
    outline: none;
}

/* ===== BOTÃO PRINCIPAL ===== */
body.login .button-primary,
body.login input[type="submit"] {
    background: linear-gradient(145deg, #005a9e, #003d6b) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 16px !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-family: var(--inaed-font-family) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    letter-spacing: 0.5px;
    box-shadow: 
        0 10px 0 #002a48,
        0 15px 25px -8px rgba(0, 75, 129, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 -2px 0 rgba(0, 0, 0, 0.1) inset !important;
    width: 100% !important;
    transform: translateY(0);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

/* Efeito de brilho no botão */
body.login .button-primary::after,
body.login input[type="submit"]::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.login .button-primary:hover::after,
body.login input[type="submit"]:hover::after {
    opacity: 1;
}

body.login .button-primary:hover,
body.login input[type="submit"]:hover {
    background: linear-gradient(145deg, #0066b3, #004b81) !important;
    transform: translateY(4px) !important;
    box-shadow: 
        0 6px 0 #002a48,
        0 20px 30px -8px rgba(0, 75, 129, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset !important;
}

body.login .button-primary:active,
body.login input[type="submit"]:active {
    transform: translateY(8px) !important;
    box-shadow: 
        0 2px 0 #002a48,
        0 15px 25px -8px rgba(0, 75, 129, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset !important;
}

/* ===== MENSAGENS ===== */
body.login .message,
body.login .success,
body.login #login_error {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 16px !important;
    padding: 14px 18px !important;
    margin: 16px 0 !important;
    font-size: 13px !important;
    line-height: 1.5;
    box-shadow: 
        0 8px 16px -6px rgba(0, 75, 129, 0.08),
        0 0 0 1px rgba(255,255,255,0.3) inset;
}

body.login #login_error {
    border-left: 4px solid #ff7500 !important;
}

body.login .message {
    border-left: 4px solid #004b81 !important;
}

/* ===== LINKS ===== */
body.login #nav,
body.login #backtoblog {
    text-align: center;
    padding: 12px 0 0 !important;
    margin: 16px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

body.login #nav a,
body.login #backtoblog a {
    color: #004b81 !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
    color: #ff7500 !important;
    text-decoration: underline;
}

body.login #backtoblog {
    margin-top: 8px !important;
}

body.login #backtoblog a {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    padding: 6px 16px;
    display: inline-block;
}

body.login #backtoblog a:hover {
    background: rgba(0, 75, 129, 0.1);
    border-color: rgba(0, 75, 129, 0.2);
    transform: translateY(-1px);
}

/* ===== PÁGINA DE RECUPERAÇÃO DE SENHA ===== */
body.login .resetpass-submit .button-primary,
body.login .setpassword-submit .button-primary {
    margin-top: 20px !important;
}

body.login .pw-weak {
    margin: 15px 0 !important;
}

body.login .pw-weak label {
    color: #004b81 !important;
    font-weight: normal !important;
}

body.login #pass-strength-result {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 16px !important;
    padding: 10px !important;
    margin: 10px 0 !important;
    text-align: center;
    font-weight: 600;
}

body.login #pass-strength-result.short,
body.login #pass-strength-result.bad {
    color: #d63638 !important;
}

body.login #pass-strength-result.good {
    color: #ff7500 !important;
}

body.login #pass-strength-result.strong {
    color: #004b81 !important;
}

/* ===== RESPONSIVIDADE ===== */
@media screen and (max-width: 768px) {
    body.login div#login {
        max-width: 90% !important;
        padding: 28px 24px !important;
        margin: 20px !important;
    }
    
    body.login h1 a {
        width: 100px !important;
        height: 100px !important;
    }
    
    body.login::after {
        backdrop-filter: blur(5px);
    }
}

@media screen and (max-width: 480px) {
    body.login div#login {
        padding: 24px 20px !important;
    }
}