/* =====================================================
   SAFESPLIT AUTH CSS
   Identidade Visual para Login, Cadastro e Recuperação
   ===================================================== */

/* ===========================================
   CSS Variables (Mesmas do Site)
   =========================================== */
:root {
    /* Brand Colors */
    --wo-primary: #1447E6;
    --wo-primary-hover: #0D3AC7;
    --wo-primary-light: #EEF4FF;
    --wo-primary-rgb: 20, 71, 230;
    
    /* Backgrounds */
    --wo-bg-white: #FFFFFF;
    --wo-bg-light: #FBF9FA;
    --wo-bg-gray: #F3F4F6;
    
    /* Text Colors */
    --wo-text-h1: #000000;
    --wo-text-headings: #101828;
    --wo-text-body: #6A7282;
    --wo-text-muted: #9CA3AF;
    
    /* Accent Colors */
    --wo-accent-green: #10B981;
    --wo-accent-green-light: #D1FAE5;
    --wo-accent-purple: #8B5CF6;
    --wo-accent-purple-light: #EDE9FE;
    --wo-accent-orange: #F59E0B;
    --wo-accent-orange-light: #FEF3C7;
    --wo-accent-pink: #EC4899;
    --wo-accent-pink-light: #FCE7F3;
    --wo-accent-cyan: #06B6D4;
    --wo-accent-cyan-light: #CFFAFE;
    --wo-accent-red: #EF4444;
    --wo-accent-red-light: #FEE2E2;
    
    /* Border & Shadows */
    --wo-border: #E5E7EB;
    --wo-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --wo-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --wo-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --wo-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --wo-font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --wo-transition: all 0.3s ease;
    
    /* Border Radius */
    --wo-radius-sm: 6px;
    --wo-radius-md: 10px;
    --wo-radius-lg: 16px;
    --wo-radius-xl: 24px;
    --wo-radius-full: 9999px;
}

/* ===========================================
   Reset & Base Styles
   =========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--wo-font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--wo-text-body);
    background: var(--wo-bg-light);
    min-height: 100vh;
}

/* ===========================================
   Auth Layout - Split Screen
   =========================================== */
.auth-page {
    display: flex;
    min-height: 100vh;
}

/* Left Panel - Branding */
.auth-brand-panel {
    flex: 1;
    display: none;
    background: linear-gradient(135deg, var(--wo-primary) 0%, var(--wo-primary-hover) 100%);
    position: relative;
    overflow: hidden;
    padding: 60px;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-logo svg {
    width: 48px;
    height: 48px;
}

.auth-brand-logo span {
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.auth-brand-text {
    max-width: 400px;
}

.auth-brand-text h1 {
    font-size: 40px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 20px;
}

.auth-brand-text p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--wo-radius-md);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon i {
    font-size: 20px;
}

.auth-feature-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.auth-feature-text p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0;
}

/* Right Panel - Form */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--wo-bg-white);
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-logo-mobile svg {
    width: 40px;
    height: 40px;
}

.auth-logo-mobile span {
    font-size: 24px;
    font-weight: 700;
    color: var(--wo-text-h1);
    letter-spacing: -0.5px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--wo-radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.auth-badge.merchant {
    background: var(--wo-accent-green-light);
    color: var(--wo-accent-green);
}

.auth-badge.admin {
    background: var(--wo-accent-red-light);
    color: var(--wo-accent-red);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--wo-text-h1);
    margin-bottom: 10px;
    line-height: 1.3;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--wo-text-body);
}

/* ===========================================
   Form Styles
   =========================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--wo-text-muted);
    margin-bottom: 4px;
}

.auth-form-section-title i {
    font-size: 14px;
}

.auth-form-divider {
    height: 1px;
    background: var(--wo-border);
    margin: 8px 0;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Labels */
.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--wo-text-headings);
}

.form-label .required {
    color: var(--wo-accent-red);
    margin-left: 2px;
}

/* Inputs */
.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: var(--wo-font-family);
    color: var(--wo-text-headings);
    background: var(--wo-bg-white);
    border: 1.5px solid var(--wo-border);
    border-radius: var(--wo-radius-md);
    transition: var(--wo-transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--wo-text-muted);
}

.form-control:hover {
    border-color: #D1D5DB;
}

.form-control:focus {
    border-color: var(--wo-primary);
    box-shadow: 0 0 0 4px rgba(var(--wo-primary-rgb), 0.1);
}

.form-control.is-invalid {
    border-color: var(--wo-accent-red);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Password Input with Toggle */
.input-password-wrapper {
    position: relative;
}

.input-password-wrapper .form-control {
    padding-right: 50px;
}

.btn-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--wo-text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--wo-transition);
}

.btn-toggle-password:hover {
    color: var(--wo-text-body);
}

/* Help Text */
.form-text {
    font-size: 13px;
    color: var(--wo-text-muted);
}

/* Invalid Feedback */
.invalid-feedback {
    font-size: 13px;
    color: var(--wo-accent-red);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===========================================
   Checkbox
   =========================================== */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1.5px solid var(--wo-border);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--wo-transition);
    flex-shrink: 0;
    accent-color: var(--wo-primary);
}

.form-check-input:checked {
    background-color: var(--wo-primary);
    border-color: var(--wo-primary);
}

.form-check-label {
    font-size: 14px;
    color: var(--wo-text-body);
    cursor: pointer;
    line-height: 1.5;
}

.form-check-label a {
    color: var(--wo-primary);
    text-decoration: none;
    font-weight: 500;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* ===========================================
   Remember & Forgot Row
   =========================================== */
.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-forgot-link {
    font-size: 14px;
    color: var(--wo-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--wo-transition);
}

.auth-forgot-link:hover {
    color: var(--wo-primary-hover);
    text-decoration: underline;
}

/* ===========================================
   Buttons
   =========================================== */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--wo-font-family);
    color: white;
    background: var(--wo-primary);
    border: none;
    border-radius: var(--wo-radius-md);
    cursor: pointer;
    transition: var(--wo-transition);
}

.btn-auth:hover {
    background: var(--wo-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--wo-shadow-lg);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth i {
    font-size: 18px;
}

.btn-auth.btn-admin {
    background: var(--wo-accent-red);
}

.btn-auth.btn-admin:hover {
    background: #DC2626;
}

/* Secondary Button */
.btn-auth-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--wo-font-family);
    color: var(--wo-text-headings);
    background: var(--wo-bg-white);
    border: 1.5px solid var(--wo-border);
    border-radius: var(--wo-radius-md);
    cursor: pointer;
    transition: var(--wo-transition);
}

.btn-auth-secondary:hover {
    background: var(--wo-bg-light);
    border-color: #D1D5DB;
}

/* ===========================================
   Alerts
   =========================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--wo-radius-md);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-danger {
    background: var(--wo-accent-red-light);
    color: var(--wo-accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--wo-accent-green-light);
    color: var(--wo-accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: var(--wo-accent-orange-light);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--wo-primary-light);
    color: var(--wo-primary);
    border: 1px solid rgba(var(--wo-primary-rgb), 0.2);
}

/* ===========================================
   Auth Footer
   =========================================== */
.auth-footer {
    margin-top: 32px;
    text-align: center;
}

.auth-footer-text {
    font-size: 14px;
    color: var(--wo-text-body);
}

.auth-footer-text a {
    color: var(--wo-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--wo-text-body);
    text-decoration: none;
    transition: var(--wo-transition);
    margin-top: 16px;
}

.auth-back-link:hover {
    color: var(--wo-primary);
}

.auth-back-link i {
    font-size: 16px;
}

/* ===========================================
   Social Login (Opcional)
   =========================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--wo-border);
}

.auth-divider span {
    font-size: 13px;
    color: var(--wo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--wo-font-family);
    color: var(--wo-text-headings);
    background: var(--wo-bg-white);
    border: 1.5px solid var(--wo-border);
    border-radius: var(--wo-radius-md);
    cursor: pointer;
    transition: var(--wo-transition);
}

.btn-social:hover {
    background: var(--wo-bg-light);
    border-color: #D1D5DB;
}

.btn-social img {
    width: 20px;
    height: 20px;
}

/* ===========================================
   Trust Badges
   =========================================== */
.auth-trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--wo-border);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--wo-text-muted);
}

.trust-badge i {
    font-size: 14px;
    color: var(--wo-accent-green);
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (min-width: 992px) {
    .auth-brand-panel {
        display: flex;
        align-items: center;
    }
    
    .auth-logo-mobile {
        display: none;
    }
    
    .auth-form-panel {
        flex: 0 0 540px;
    }
}

@media (min-width: 1200px) {
    .auth-brand-panel {
        flex: 1.2;
    }
    
    .auth-form-panel {
        flex: 0 0 580px;
    }
    
    .auth-brand-text h1 {
        font-size: 48px;
    }
}

@media (max-width: 576px) {
    .auth-form-panel {
        padding: 32px 20px;
    }
    
    .auth-form-container {
        max-width: 100%;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .form-group-row {
        grid-template-columns: 1fr;
    }
    
    .auth-remember-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auth-trust-badges {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===========================================
   Admin Theme Override
   =========================================== */
.auth-page.admin-theme .auth-brand-panel {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

.auth-page.admin-theme .auth-brand-panel::before {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 70%);
}

.auth-page.admin-theme .auth-feature-icon {
    background: rgba(239, 68, 68, 0.2);
}

/* ===========================================
   Loading State
   =========================================== */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-auth.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================================
   Animations
   =========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-container {
    animation: fadeIn 0.4s ease-out;
}

/* ===========================================
   Custom Scrollbar
   =========================================== */
.auth-form-panel::-webkit-scrollbar {
    width: 6px;
}

.auth-form-panel::-webkit-scrollbar-track {
    background: var(--wo-bg-light);
}

.auth-form-panel::-webkit-scrollbar-thumb {
    background: var(--wo-border);
    border-radius: 3px;
}

.auth-form-panel::-webkit-scrollbar-thumb:hover {
    background: #D1D5DB;
}
