/* Importar arquivos base */
@import url('reset.css');
@import url('variables.css');

body {
    font-family: var(--font-family-sans);
    background: var(--background-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: background-color 0.3s ease;
}

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.login-card {
    background: var(--background-card);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    padding: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* Posição fixa no topo direito */
.theme-toggle-fixed {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--z-fixed);
}

/* Dark mode: borda do toggle mais clara para destaque */
[data-theme="dark"] .theme-toggle {
    border-color: var(--gray-50);
}

@media (max-width: 480px) {
    .theme-toggle-fixed {
        top: 12px;
        right: 12px;
    }
}

.login-header .brand-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.login-header .brand-logo i {
    font-size: 2rem;
    color: var(--white);
}

.login-header .brand-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header .brand-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
}

.form-floating {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-floating .form-control {
    width: 100%;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    outline: none;
}

.form-floating .form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
    background: var(--bg-primary);
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0.75rem;
    padding: 0 0.25rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-green);
    transform: translateY(-0.5rem) scale(0.85);
}

.form-check {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #e1e5e9;
    border-radius: 0.25rem;
    appearance: none;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: bold;
}

.form-check-label {
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: var(--white);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.w-100 {
    width: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

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

.alert-danger {
    border-radius: 10px;
    border: none;
    background: var(--error-bg);
    color: var(--error-color);
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--error-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}


/* Icon styling */
.form-floating .input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 3;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-floating .form-control:focus ~ .input-icon {
    color: var(--primary-green);
}

/* Animation for elements */
.auth-btn-egide {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-delay: 0.1s;
}

.auth-egide-description {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-delay: 0.2s;
}

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

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }

    .brand-title {
        font-size: 1.7rem;
    }

    .login-card {
        padding: 1.5rem;
    }
}

/* Egide Auth Button */
.auth-btn-egide {
    display: flex;              /* coloca ícone + texto lado a lado */
    align-items: center;        /* centraliza verticalmente */
    justify-content: center;    /* centraliza horizontalmente */
    gap: 8px;                   /* espaço entre ícone e texto */
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: var(--white);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.auth-btn-egide:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: var(--white);
    text-decoration: none;
}

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

.auth-egide-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.auth-egide-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
    z-index: 1;
}

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}