/* ===============================
   BACKGROUND & CONTAINER
================================ */
body:has(.auth-container) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    max-width: 1000px;
    height: 600px;
    background: white;
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* ===============================
   PANELS
================================ */
.side {
    width: 50%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.brand-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.form-bg {
    background: white;
}

/* ===============================
   BRAND BOX
================================ */
.brand-box {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideIn 0.8s ease forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.brand-logo svg {
    color: white;
}

.brand-box h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.brand-box p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 32px;
    line-height: 1.6;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    opacity: 0.9;
}

.feature-item svg {
    flex-shrink: 0;
}

/* ===============================
   FORM BOX
================================ */
.form-box {
    opacity: 0;
    transform: translateX(30px);
    animation: slideIn 0.8s ease forwards;
    animation-delay: 0.2s;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-muted);
}

/* ===============================
   ISOLAR DO TEMA ESCURO
================================ */
/* Garantir que as páginas de autenticação sempre usam tema claro */
/* Redefinir variáveis CSS para forçar tema claro (variáveis CSS não suportam !important) */
body:has(.auth-container),
body:has(.auth-container) .auth-container,
body:has(.auth-container) .auth-container * {
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
}

/* Garantir que o tema escuro não afete páginas de autenticação */
[data-theme="dark"] body:has(.auth-container),
[data-theme="dark"] body:has(.auth-container) .auth-container,
[data-theme="dark"] body:has(.auth-container) .auth-container * {
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
}

/* Forçar cores diretas em elementos críticos (backup para garantir funcionamento) */
.auth-container .form-header h2 {
    color: #111827 !important;
}

.auth-container .form-subtitle {
    color: #6b7280 !important;
}

.auth-container .input-group label {
    color: #111827 !important;
}

.auth-container .input-group input {
    background: white !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
}

.auth-container .input-group input::placeholder {
    color: #6b7280 !important;
}

.auth-container .password-wrapper input {
    background: white !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
}

.auth-container .password-wrapper input::placeholder {
    color: #6b7280 !important;
}

.auth-container .password-validation {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

.auth-container .switch-text {
    color: #6b7280 !important;
}

.auth-container .form-box {
    background: white !important;
}

.auth-container .side.form-bg {
    background: white !important;
}

.form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===============================
   INPUT GROUPS
================================ */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-size: 15px;
    color: var(--text);
    transition: all 0.2s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

/* ===============================
   PASSWORD WRAPPER
================================ */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding: 12px 14px;
    padding-right: 45px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-size: 15px;
    color: var(--text);
    transition: all 0.2s ease;
}

.password-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ===============================
   PASSWORD VALIDATION
================================ */
.password-validation {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-top: -8px;
}

.validation-header {
    margin-bottom: 12px;
}

.validation-status {
    font-size: 13px;
    font-weight: 600;
}

.password-rules {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #dc2626;
    transition: all 0.2s ease;
}

.password-rules li svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.password-rules li[style*="none"] {
    color: #16a34a;
}

/* ===============================
   BUTTONS
================================ */
.btn-auth {
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-auth.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

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

.btn-auth svg {
    transition: transform 0.2s ease;
}

.btn-auth:hover svg {
    transform: translateX(4px);
}

/* ===============================
   DIVIDER
================================ */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===============================
   SWITCH TEXT & LINKS
================================ */
.switch-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ===============================
   ERROR MESSAGES
================================ */
.error-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    margin-top: -8px;
    transition: all 0.3s ease;
}

.error-message:not(:empty) {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ===============================
   UTILITY
================================ */
.hidden {
    display: none !important;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    body:has(.auth-container) {
        padding: 0;
    }

    .auth-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        flex-direction: column;
    }

    .side {
        width: 100%;
        height: 50%;
        padding: 30px;
    }

    .brand-box h1 {
        font-size: 28px;
    }

    .brand-features {
        display: none;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .form-content {
        gap: 16px;
    }
}