/* ============================================
   PORTAL MAYORISTAS - CSS PRINCIPAL
   Diseño moderno inspirado en SoloCamas.com.do
   ============================================ */

/* ===========================================
   1. VARIABLES CSS
   =========================================== */
:root {
    /* Colores principales */
    --primary: #1a1a2e;
    --primary-dark: #0f0f1a;
    --primary-light: #2d2d44;
    
    --secondary: #16213e;
    --accent: #e94560;
    --accent-light: rgba(233, 69, 96, 0.1);
    --accent-dark: #c73e54;
    
    /* Neutros */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --black: #000000;
    
    /* Estados */
    --success: #00b894;
    --success-light: rgba(0, 184, 148, 0.1);
    --warning: #fdcb6e;
    --warning-light: rgba(253, 203, 110, 0.1);
    --danger: #d63031;
    --danger-light: rgba(214, 48, 49, 0.1);
    --info: #0984e3;
    --info-light: rgba(9, 132, 227, 0.1);
    
    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Poppins', var(--font-primary);
    
    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 8px 24px rgba(233, 69, 96, 0.25);
    
    /* Bordes */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Espaciado */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
}

/* ===========================================
   2. RESET Y BASE
   =========================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===========================================
   3. LAYOUT AUTH (LOGIN/REGISTRO)
   =========================================== */
.auth-layout {
    min-height: 100vh;
    display: flex;
}

.auth-sidebar {
    width: 45%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-3xl);
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, transparent 50%);
    animation: pulse 15s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 400px;
}

.auth-sidebar .logo {
    width: 180px;
    margin-bottom: var(--space-xl);
}

.auth-sidebar h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 var(--space-md);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-sidebar p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin: 0;
    line-height: 1.7;
}

.auth-features {
    margin-top: var(--space-2xl);
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.auth-feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon i {
    font-size: 20px;
    color: var(--accent);
}

.auth-feature-text h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.auth-feature-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.7;
}

/* Main content area */
.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-3xl);
    background: var(--white);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-header {
    margin-bottom: var(--space-xl);
}

.auth-header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 var(--space-sm);
    color: var(--gray-900);
}

.auth-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 15px;
}

/* ===========================================
   4. FORMULARIOS
   =========================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-light);
}

/* Input con ícono */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-input {
    padding-left: 48px;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--accent);
}

/* Toggle password */
.input-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.input-toggle:hover {
    color: var(--gray-600);
}

/* Checkbox custom */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-600);
}

.form-checkbox input {
    display: none;
}

.form-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.form-checkbox .checkmark i {
    font-size: 12px;
    color: transparent;
}

.form-checkbox input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.form-checkbox input:checked + .checkmark i {
    color: var(--white);
}

/* Error message */
.form-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    font-size: 13px;
    color: var(--danger);
}

.form-error i {
    font-size: 14px;
}

/* ===========================================
   5. BOTONES
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-primary);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-weight: 500;
}

.btn-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading::after {
    border-top-color: var(--white);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   6. ALERTAS
   =========================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 14px;
}

.alert-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon i {
    font-size: 12px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success);
}

.alert-success .alert-icon {
    background: var(--success);
    color: var(--white);
}

.alert-success .alert-title {
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    border: 1px solid var(--danger);
}

.alert-danger .alert-icon {
    background: var(--danger);
    color: var(--white);
}

.alert-danger .alert-title {
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
}

.alert-warning .alert-icon {
    background: var(--warning);
    color: var(--gray-800);
}

.alert-warning .alert-title {
    color: var(--gray-800);
}

/* ===========================================
   7. UTILIDADES
   =========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 13px; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--gray-400);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ===========================================
   8. RESPONSIVE
   =========================================== */
@media (max-width: 1024px) {
    .auth-sidebar {
        width: 40%;
        padding: var(--space-xl);
    }
    
    .auth-sidebar h1 {
        font-size: 2rem;
    }
    
    .auth-features {
        display: none;
    }
}

@media (max-width: 768px) {
    .auth-layout {
        flex-direction: column;
    }
    
    .auth-sidebar {
        width: 100%;
        padding: var(--space-xl) var(--space-lg);
        min-height: auto;
    }
    
    .auth-sidebar-content {
        max-width: 100%;
    }
    
    .auth-sidebar h1 {
        font-size: 1.5rem;
    }
    
    .auth-sidebar p {
        font-size: 14px;
    }
    
    .auth-main {
        padding: var(--space-xl) var(--space-lg);
    }
}

@media (max-width: 480px) {
    .auth-sidebar {
        padding: var(--space-lg);
    }
    
    .auth-main {
        padding: var(--space-lg);
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 12px 14px;
    }
    
    .btn {
        padding: 12px 20px;
    }
}

/* ===========================================
   9. ANIMACIONES
   =========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slideIn {
    animation: slideIn 0.4s ease forwards;
}

/* Stagger animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
