/* ObraPay v2.0 - Estilos Principales Premium */

:root {
    /* Design Tokens */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #6b7280;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --light: #f9fafb;
    --dark: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    --gradient-dark: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* General */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--gray-100);
    min-height: 100vh;
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loadingOverlay.d-none {
    display: none !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Stats Cards */
.stat-card {
    border-left: 4px solid var(--primary);
    background: white;
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card.info {
    border-left-color: var(--info);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-card .stat-label {
    color: var(--secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login Page - Premium Split Screen */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: var(--gradient-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></svg>') repeat;
    opacity: 0.5;
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.login-brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.login-brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.login-brand p {
    font-size: 1.1rem;
    opacity: 0.8;
    line-height: 1.6;
}

.login-features {
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.login-feature i {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}

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

.login-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-form-header p {
    color: var(--gray-500);
}

/* Premium Form Controls */
.form-control-premium {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control-premium:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.form-group-premium {
    margin-bottom: 1.5rem;
}

.form-group-premium label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.input-group-premium {
    position: relative;
}

.input-group-premium .form-control-premium {
    padding-right: 3rem;
}

.input-group-premium .btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.input-group-premium .btn-toggle-password:hover {
    color: var(--gray-600);
}

.btn-premium {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* OTP Input Premium */
.otp-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.otp-input {
    width: 52px;
    height: 60px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    transition: var(--transition-fast);
    color: var(--gray-900);
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
    outline: none;
}

.otp-input.filled {
    border-color: var(--primary);
    background: var(--primary-50);
}

/* MFA Setup & Security */
.mfa-setup-qr {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.mfa-setup-qr img {
    max-width: 200px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.mfa-setup-secret {
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--gray-700);
    word-break: break-all;
}

.mfa-recovery-codes {
    background: #fef3c7;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid #fcd34d;
}

.mfa-recovery-codes h5 {
    color: #92400e;
    font-weight: 600;
    margin-bottom: 1rem;
}

.recovery-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.recovery-code {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
    border: 1px solid #fcd34d;
}

/* Alerts Premium */
.alert-premium {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.alert-premium.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-premium.alert-info {
    background: var(--primary-50);
    color: var(--primary-800);
    border: 1px solid var(--primary-200);
}

.alert-premium.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Responsive Login */
@media (max-width: 991.98px) {
    .login-wrapper {
        flex-direction: column;
    }
    
    .login-left {
        padding: 2rem;
        min-height: auto;
    }
    
    .login-brand h1 {
        font-size: 2rem;
    }
    
    .login-features {
        display: none;
    }
    
    .login-right {
        padding: 2rem;
    }
}

/* Legacy Login Support */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.login-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-weight: 700;
}

.login-body {
    padding: 2rem;
}

/* Tables */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: var(--light);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--secondary);
    padding: 1rem;
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table-modern tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status Badges */
.badge-status {
    padding: 0.5em 1em;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-pendiente {
    background-color: #fff3cd;
    color: #856404;
}

.badge-procesando {
    background-color: #cce5ff;
    color: #004085;
}

.badge-pagado {
    background-color: #d4edda;
    color: #155724;
}

.badge-vencido {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-cancelado {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Payment Page */
.payment-container {
    max-width: 600px;
    margin: 0 auto;
}

.payment-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.payment-method {
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.payment-method:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.payment-method.selected {
    border-color: var(--primary);
    background-color: #f0f7ff;
}

.payment-method-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* Sidebar (for admin/partner) */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    width: 250px;
    height: calc(100vh - 56px);
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--light);
    color: var(--primary);
}

.sidebar-link.active {
    background: #e7f1ff;
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-link i {
    width: 24px;
    margin-right: 10px;
}

.main-with-sidebar {
    margin-left: 250px;
    padding: 2rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }
    .main-with-sidebar {
        margin-left: 0;
    }
}

/* Forms */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline-primary:hover {
    background: var(--primary);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 16px;
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 0.5rem;
}

.modal-footer {
    border-top: none;
    padding: 0.5rem 1.5rem 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Quick Actions */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
}

.quick-action:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    color: var(--primary);
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

/* Chart Placeholder */
.chart-placeholder {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

/* PSP Icons */
.psp-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.psp-mercadopago { background: #009ee3; color: white; }
.psp-transferencia { background: #28a745; color: white; }
.psp-rapipago { background: #ff6b00; color: white; }
.psp-pagofacil { background: #1e90ff; color: white; }
.psp-crypto { background: #f7931a; color: white; }
.psp-uala { background: #ff3d71; color: white; }

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
