/* Global Styles & Variables */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #004e92;
    --accent-color: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --error-color: #ff4d4d;
    --success-color: #2ecc71;
    --transition-speed: 0.3s;
    --blur-strength: 15px;
}

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

body {
    background: url('../IMAGENS/login_full.png') no-repeat center center fixed;
    /* Updated image path */
    background-size: cover;
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8));
    z-index: -1;
}

/* Glassmorphism Card */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    perspective: 1000px;
    margin-top: 150px;
    /* Offset to appear below the logo in the background image */
}

.login-card {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    animation: fadeInUp 1s ease-out;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    /* Removed scale to prevent blur */
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
}

/* Header */
.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--primary-color);
    margin-bottom: 10px;
}

.card-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Input Styles */
.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: var(--transition-speed);
}

input {
    width: 100%;
    padding: 12px 40px 12px 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-speed);
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

input:focus+label,
input:not(:placeholder-shown)+label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.8);
    padding: 0 5px;
    border-radius: 4px;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 45px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none; 
    transition: all var(--transition-speed);
}

.highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

input:focus~.highlight {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-speed);
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
    user-select: none;
    min-height: 20px;
    pointer-events: auto !important; /* Força o clique a funcionar aqui */
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    /* Remova width: 0 e height: 0 para não bugar o alcance do clique */
    width: 20px; 
    height: 20px;
    z-index: 1; /* Garante que ele esteja acima para receber o clique */
}

.checkmark {
    position: absolute;
    top: 50%;
    /* Center vertically */
    left: 0;
    transform: translateY(-50%);
    /* Center vertically */
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: var(--transition-speed);
}

.custom-checkbox:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid black;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-speed);
    line-height: normal;
    /* Fix alignment */
}

.forgot-password:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px var(--primary-color);
}

/* Button */
.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn-login:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-loader {
    display: none;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loader {
    display: block;
}

/* Footer */
.card-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
    border-color: var(--error-color) !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 20, 40, 0.95);
    border-left: 5px solid var(--success-color);
    border-radius: 4px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hidden {
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
}

.toast-icon {
    font-size: 1.5rem;
    color: var(--success-color);
    margin-right: 15px;
}

.toast-message {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 2px;
}

.toast-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: var(--success-color);
    animation: progress 3s linear forwards;
}

@keyframes progress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
        margin-top: 100px;
    }

    .login-card {
        padding: 25px;
    }

    .card-header h2 {
        font-size: 1.5rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    display: none;
}

.loader-content {
    text-align: center;
    color: var(--primary-color);
}

.loader-content p {
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: #fff;
}