* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2196F3;
    --primary-dark: #1565C0;
    --primary-light: #42A5F5;
    --accent: #00BCD4;
    --secondary: #0D1B2A;
    --text-primary: #1a1a2e;
    --text-secondary: #5a6170;
    --text-muted: #8b92a5;
    --bg-light: #f7f9fc;
    --bg-subtle: #eef2f7;
    --border: #e3e8ef;
    --white: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    color: var(--text-primary);
}

/* ===== SPLIT LAYOUT ===== */
.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- LEFT PANEL (Brand) --- */
.auth-brand {
    flex: 0 0 44%;
    background: linear-gradient(160deg, #1565C0 0%, #2196F3 40%, #00BCD4 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    margin-top: auto;
    margin-bottom: auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 3rem;
} 

.brand-logo-image {
    max-width: 150px;
    height: auto;
}

.brand-logo svg {
    flex-shrink: 0;
}

.brand-logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.brand-headline {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -1px;
}

.brand-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.65;
    margin-bottom: 3rem;
    max-width: 400px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.brand-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.brand-feature-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 3rem;
}

.brand-trust {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.brand-trust-dots {
    display: flex;
    gap: 4px;
}

.brand-trust-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.brand-trust-dots span.active {
    background: rgba(255, 255, 255, 0.7);
}

/* --- RIGHT PANEL (Forms) --- */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--white);
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.auth-tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.auth-tab:hover:not(.active) {
    color: var(--text-secondary);
}

/* ===== FORM PANELS ===== */
.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header {
    margin-bottom: 1.75rem;
}

.form-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.5px;
}

.form-header p {
    font-size: 0.938rem;
    color: var(--text-muted);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.938rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input::placeholder {
    color: #c1c7d0;
}

.form-input.no-icon {
    padding-left: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

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

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

.form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: -0.25rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-checkbox span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* ===== BUTTONS ===== */
.btn-submit {
    width: 100%;
    padding: 13px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(33, 150, 243, 0.3);
}

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

.btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== DIVIDER ===== */
.divider {
    text-align: center;
    margin: 1.75rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border);
}

.divider span {
    position: relative;
    background: var(--white);
    padding: 0 14px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DEMO ACCOUNTS ===== */
.demo-accounts {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1rem;
}

.demo-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-title svg {
    color: var(--primary);
}

.demo-account {
    background: var(--white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.demo-account:hover {
    border-color: var(--primary-light);
    background: rgba(33, 150, 243, 0.03);
}

.demo-account:last-child {
    margin-bottom: 0;
}

.demo-account-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.demo-account-badge.admin { background: rgba(33, 150, 243, 0.1); }
.demo-account-badge.empresa { background: rgba(0, 188, 212, 0.1); }

.demo-account-info {
    flex: 1;
    min-width: 0;
}

.demo-account-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.demo-account-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.demo-account-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.demo-account:hover .demo-account-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* ===== ALERT ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    display: none;
    font-weight: 500;
    align-items: center;
    gap: 0.5rem;
}

.alert.show {
    display: flex;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.alert-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

/* ===== LOADING ===== */
.loading-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== FOOTER ===== */
.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.auth-footer a:hover {
    color: var(--primary);
}

.auth-footer .footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 6px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: all 0.3s ease;
    width: 0%;
}

.strength-fill.weak { width: 33%; background: var(--danger); }
.strength-fill.medium { width: 66%; background: var(--warning); }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.strength-text.weak { color: var(--danger); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* ===== TERMS CHECKBOX ===== */
.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.4;
    cursor: pointer;
    margin-bottom: 1.25rem;
}

.terms-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.terms-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.terms-label a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .auth-brand {
        flex: 0 0 40%;
        padding: 3rem 2.5rem;
    }

    .brand-headline {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-brand {
        flex: none;
        padding: 2rem 1.5rem;
    }

    .brand-headline { font-size: 1.5rem; }
    .brand-description { display: none; }
    .brand-features { display: none; }
    .brand-footer { display: none; }

    .auth-form-panel {
        padding: 2rem 1.5rem;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-brand {
        padding: 1.5rem;
    }

    .brand-logo-text { font-size: 1.375rem; }

    .auth-form-panel {
        padding: 1.5rem 1.25rem;
    }
}

/* ===== PASSWORD RECOVERY ===== */
.auth-success-message {
    display: none;
    padding: 1rem 1.25rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
    color: #16a34a;
    font-size: 0.9rem;
    font-weight: 500;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-success-message svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-error-message {
    display: none;
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ===== SELECTED PLAN BANNER ===== */
.selected-plan-banner {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(0, 188, 212, 0.08) 100%);
    border: 1.5px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.selected-plan-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.selected-plan-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.selected-plan-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.selected-plan-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.selected-plan-change {
    flex-shrink: 0;
    padding: 0.45rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.selected-plan-change:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    color: var(--primary);
}
