.auth-body {
    background: #f8fafc;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.auth-wrapper {
    width: 100%;
    max-width: 860px;
    min-height: 520px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.2);
}

/* ===== VISUAL SIDE ===== */
.auth-visual {
    position: relative;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    color: white;
    padding: 40px 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.register-visual {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
}

.auth-visual-content {
    position: relative;
    z-index: 2;
}

.auth-brand-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.25);
}

.auth-brand-icon svg { width: 30px; height: 30px; }

.auth-visual h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.auth-visual p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.5;
}

.auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-features li {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}

.blob-1 {
    width: 240px; height: 240px;
    background: #a78bfa;
    bottom: -80px; right: -80px;
}

.blob-2 {
    width: 180px; height: 180px;
    background: #60a5fa;
    top: -60px; left: -60px;
}

/* ===== FORM SIDE ===== */
.auth-form-side {
    padding: 48px 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form { width: 100%; max-width: 380px; }

.auth-header { margin-bottom: 28px; }
.auth-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-bottom: 6px;
}
.auth-header p { color: #64748b; font-size: 0.95rem; }

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 18px;
    animation: shake 0.4s;
}

.auth-alert svg { width: 18px; height: 18px; flex-shrink: 0; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > svg:first-child {
    position: absolute;
    left: 14px;
    width: 18px; height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input-wrap input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s;
    outline: none;
}

.auth-input-wrap input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.auth-input-wrap input:focus ~ svg,
.auth-input-wrap:focus-within > svg:first-child {
    color: #6366f1;
}

.toggle-password {
    position: absolute;
    right: 8px;
    width: 34px; height: 34px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
}

.toggle-password:hover { background: #f1f5f9; color: #475569; }
.toggle-password.active { color: #6366f1; }
.toggle-password svg { width: 17px; height: 17px; }

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 20px;
    font-size: 0.85rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #475569;
    font-weight: 500;
    user-select: none;
}

.auth-checkbox input {
    width: 17px; height: 17px;
    accent-color: #6366f1;
    cursor: pointer;
}

.auth-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover { color: #4f46e5; text-decoration: underline; }

.auth-submit {
    width: 100%;
    padding: 14px 22px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -4px rgba(99, 102, 241, 0.6);
}

.auth-submit:active { transform: translateY(0); }
.auth-submit svg { width: 18px; height: 18px; }

.auth-footer-text {
    text-align: center;
    margin-top: 22px;
    font-size: 0.9rem;
    color: #64748b;
}

/* ===== USER MENU (dashboard) ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu { position: relative; }

.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
}

.user-trigger:hover { border-color: var(--primary-light); background: #f8fafc; }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-name { color: var(--text); }

.user-trigger .chev {
    width: 14px; height: 14px;
    color: var(--text-muted);
    transition: transform 0.25s;
}

.user-menu.open .chev { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dropdown-header strong { font-size: 0.92rem; color: var(--text); }
.dropdown-header small { font-size: 0.8rem; color: var(--text-muted); word-break: break-all; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item:hover { background: #f1f5f9; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-item svg { width: 17px; height: 17px; }

/* ===== RESPONSIVE AUTH ===== */
@media (max-width: 860px) {
    .auth-wrapper { grid-template-columns: 1fr; min-height: auto; }
    .auth-visual {
        padding: 36px 28px;
        min-height: 240px;
    }
    .auth-visual h1 { font-size: 1.7rem; }
    .auth-features { display: none; }
    .auth-form-side { padding: 36px 28px; }
    .user-name { display: none; }
    .user-trigger { padding: 6px; }
}

@media (max-width: 480px) {
    .auth-body { padding: 0; }
    .auth-wrapper { border-radius: 0; min-height: 100vh; }
    .auth-form-side { padding: 28px 22px; }
    .auth-header h2 { font-size: 1.4rem; }
    .header-actions { flex-wrap: wrap; }
}

/* ===== MENSAGENS DE ERRO EM CAMPOS ===== */
.auth-input-wrap.invalid input {
    border-color: #ef4444;
    background: #fef2f2;
}

.auth-input-wrap.invalid > svg:first-child {
    color: #ef4444;
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #dc2626;
    font-weight: 500;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FORÇA DE SENHA ===== */
.password-strength {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bars .bar {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e2e8f0;
    transition: background 0.3s;
}

.strength-bars .bar.filled.weak { background: #ef4444; }
.strength-bars .bar.filled.medium { background: #f59e0b; }
.strength-bars .bar.filled.strong { background: #10b981; }

.strength-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 42px;
    text-align: right;
}

.password-strength.weak .strength-label { color: #ef4444; }
.password-strength.medium .strength-label { color: #f59e0b; }
.password-strength.strong .strength-label { color: #10b981; }

/* ===== SPINNER NO BOTÃO SUBMIT ===== */
.auth-submit.loading {
    cursor: wait;
    opacity: 0.85;
}

.auth-submit .spinner {
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ANIMAÇÃO SHAKE ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}