/* SMAPA Modern UI System - Central Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-main: #334155;
    --text-dark: #0f172a;
    --bg-light: #f8fafc;
    --error-color: #dc2626;
    --success-color: #10b981;
}

body, h1, h2, h3, h4, .page-title {
    font-family: 'Inter', sans-serif !important;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-logos { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 0; 
    margin-bottom: 20px; 
}
.header-logos img { 
    max-height: 55px; 
}

/* ==========================================================================
   Page Titles & Cards
   ========================================================================== */
.page-title { 
    font-size: 32px; 
    font-weight: 800; 
    color: var(--primary-color); 
    margin-bottom: 30px; 
    text-transform: uppercase; 
    letter-spacing: -0.5px; 
}

.premium-card, .registration-container, .status-card, .tramite-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 10px 15px -3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    padding: 30px;
    margin-bottom: 30px;
}

.premium-card-heading, .form-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group label {
    font-weight: 700; 
    color: var(--text-main); 
    font-size: 1.3rem; 
    margin-bottom: 10px; 
    display: block;
}

.form-control {
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    padding: 12px 15px; 
    height: auto; 
    box-shadow: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-color); 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group-addon {
    border-radius: 12px 0 0 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-right: none;
    color: #94a3b8;
}

.error { 
    color: var(--error-color); 
    padding: 6px 12px; 
    font-weight: 600; 
    font-size: 1.1rem; 
    display: block; 
    margin-top: 8px; 
    background: rgba(220, 38, 38, 0.05); 
    border-radius: 6px; 
    border-left: 4px solid var(--error-color);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-premium, .btn-primary-custom, .btn-login {
    background: var(--primary-color); 
    color: white !important; 
    border: none; 
    border-radius: 12px; 
    padding: 12px 30px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.btn-premium:hover, .btn-primary-custom:hover, .btn-login:hover { 
    background: var(--secondary-color); 
    transform: translateY(-2px); 
    box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.3);
    text-decoration: none;
}

.btn-danger-premium {
    background: var(--error-color); 
    color: white !important; 
    border: none; 
    border-radius: 12px; 
    padding: 12px 30px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    transition: all 0.2s ease;
}

.btn-danger-premium:hover { 
    background: #991b1b; 
}

.btn-outline-premium {
    background: transparent; 
    color: var(--primary-color); 
    border: 2px solid var(--primary-color);
    border-radius: 10px; 
    padding: 12px 18px; 
    font-weight: 700; 
    font-size: 1.3rem;
    transition: all 0.2s; 
    text-align: center; 
    width: 100%; 
    margin-bottom: 10px;
    display: inline-block;
    text-decoration: none;
}

.btn-outline-premium:hover { 
    background: var(--primary-color); 
    color: white !important; 
    text-decoration: none; 
}

.btn-secondary-link {
    background: transparent;
    color: #64748b;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 15px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-secondary-link:hover {
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
}

/* ==========================================================================
   Login & Recovery Screens
   ========================================================================== */
.login-body-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    display: flex;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
}

.login-left h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: white !important;
}

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

.login-logos {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center;
}

.login-logos img {
    max-height: 60px;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 12px;
}

.login-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right h2 {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.login-right p.subtitle {
    color: #64748b;
    margin-bottom: 40px;
}

.register-link {
    text-align: center;
    margin-top: 30px;
    font-weight: 500;
    color: #64748b;
}

.register-link a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.register-link a:hover { 
    text-decoration: underline; 
}

.forgot-pass {
    display: block;
    text-align: right;
    margin-top: 10px;
    font-size: 1.3rem;
    color: #64748b;
}

/* ==========================================================================
   Registration Screen
   ========================================================================== */
.registration-container { 
    max-width: 900px; 
    margin: 0 auto 50px auto; 
    overflow: hidden; 
    padding: 0;
}

.registration-header { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%); 
    color: white; 
    padding: 40px 30px; 
    text-align: center; 
}

.registration-header h2 { 
    font-weight: 800; 
    margin-bottom: 5px; 
    font-size: 2.2rem; 
    color: white !important;
}

.registration-body { 
    padding: 40px; 
}

/* ==========================================================================
   Trámites Catalog Grid
   ========================================================================== */
.tramites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.tramite-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    padding-top: 40px;
}

.tramite-card::before {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 6px; 
    background: var(--primary-color);
}

.tramite-icon { 
    margin-bottom: 20px; 
}

.tramite-icon img { 
    height: 70px; 
}

.tramite-title { 
    font-size: 1.6rem; 
    font-weight: 800; 
    color: var(--text-dark); 
    margin-bottom: 12px; 
}

.tramite-desc { 
    color: #64748b; 
    font-size: 1.5rem; 
    line-height: 1.6; 
    flex: 1; 
    margin-bottom: 25px; 
}

/* ==========================================================================
   Trámite Status View
   ========================================================================== */
.tramite-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 18px; 
    border-bottom: 2px solid #f1f5f9; 
    padding-bottom: 12px; 
}

.tramite-id { 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: var(--primary-color); 
}

.tramite-date { 
    font-size: 1rem; 
    color: #64748b; 
    font-weight: 600; 
}

.status-badge { 
    padding: 8px 16px; 
    border-radius: 20px; 
    font-size: 1rem; 
    font-weight: 700; 
    display: inline-flex; 
    align-items: center; 
}

.status-badge i { 
    margin-right: 8px; 
}

.status-pending { 
    background: #fff7ed; 
    color: #c2410c; 
}

.status-process { 
    background: #eff6ff; 
    color: var(--primary-color); 
}

.status-success { 
    background: #f0fdf4; 
    color: #15803d; 
}

.observacion-box { 
    background: #f8fafc; 
    border-left: 5px solid #cbd5e1; 
    padding: 15px 20px; 
    border-radius: 8px; 
    margin-top: 15px; 
    color: #475569; 
    font-style: italic; 
}

/* ==========================================================================
   Stepper & Step Indicators
   ========================================================================== */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
}

.stepper::before {
    content: "";
    position: absolute;
    top: 24px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step {
    text-align: center;
    position: relative;
    z-index: 2;
    width: 25%;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    line-height: 46px;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 auto 12px;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.step.completed .step-circle {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
}

.step-indicator { 
    margin-bottom: 30px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 20px; 
}

.step-indicator .step { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: #94a3b8; 
    font-weight: 600; 
    width: auto;
}

.step-indicator .step.active { 
    color: var(--primary-color); 
}

.step-indicator .step.active .step-num { 
    background: var(--primary-color); 
    color: white; 
}

.step-num { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    background: #e2e8f0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
}

/* ==========================================================================
   File Upload Wrapper & Document List
   ========================================================================== */
.file-upload-wrapper {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.file-upload-wrapper:hover, .file-upload-wrapper.dragover {
    background: #f0fdf4;
    border-color: #10b981;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
    z-index: 10;
}

.upload-icon {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.file-upload-wrapper:hover .upload-icon {
    color: #10b981;
}

.upload-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.text-muted { 
    color: #64748b !important; 
}

.doc-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #ffffff;
}

.doc-status-pending {
    background: #fef3c7;
    color: #d97706;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================================
   Alerts & Utilities
   ========================================================================== */
.alert-custom {
    border-radius: 12px;
    border: none;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.alert-custom i {
    font-size: 28px;
    margin-right: 20px;
    margin-top: 2px;
}

.alert-warning { background: #fffbeb; color: #92400e; }
.alert-success { background: #f0fdf4; color: #166534; }

#mapa { 
    height: 350px; 
    width: 100%; 
    border-radius: 12px; 
    border: 2px solid #e2e8f0; 
    margin-bottom: 15px; 
}

/* ==========================================================================
   Receipt & Checkout Styles (pagarconstancia.php)
   ========================================================================== */
.receipt-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.receipt-header {
    background: #1e293b;
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.receipt-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background-size: 20px 20px;
    background-image: radial-gradient(circle at 10px 0, transparent 10px, #ffffff 11px);
}

.receipt-header h2 {
    font-weight: 700;
    margin: 0;
    font-size: 1.8rem;
    color: white !important;
}

.receipt-header p {
    color: #94a3b8;
    font-size: 1rem;
    margin-top: 5px;
}

.receipt-body {
    padding: 40px 30px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #cbd5e1;
}

.receipt-row:last-of-type {
    border-bottom: none;
}

.receipt-label {
    font-weight: 500;
    color: #64748b;
    font-size: 1.4rem;
}

.receipt-value {
    font-weight: 600;
    color: #0f172a;
    font-size: 1.3rem;
    text-align: right;
}

.receipt-value.status {
    color: #f59e0b;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 1.3rem;
}

.receipt-total {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.receipt-total-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.receipt-total-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e3a8a;
}

.btn-pay {
    background: #1e3a8a;
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    width: 100%;
    transition: all 0.2s;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-pay:hover {
    background: #1d4ed8;
    box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.3);
}

/* ==========================================================================
   Addon Inputs (servicios.php)
   ========================================================================== */
.inner-addon {
    position: relative;
}

.inner-addon .glyphicon {
    position: absolute;
    padding: 10px;
    pointer-events: none;
}

.left-addon .glyphicon { left: 0px; }
.right-addon .glyphicon { right: 0px; }

.left-addon input { padding-left: 30px; }
.right-addon input { padding-right: 30px; }

/* ==========================================================================
   Dashboard Welcome Card & Quick Actions (inicio.php)
   ========================================================================== */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 20px;
    color: white;
    padding: 60px;
    box-shadow: 0 15px 30px -5px rgba(30, 58, 138, 0.3);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.welcome-card h1 { 
    font-weight: 800; 
    margin-top: 0; 
    font-size: 3rem; 
    color: white !important;
}

.welcome-card p { 
    font-size: 1.25rem; 
    opacity: 0.9; 
    line-height: 1.7; 
    max-width: 65%; 
}

.welcome-card .bg-icon {
    position: absolute; 
    right: 30px; 
    bottom: -30px; 
    font-size: 200px; 
    opacity: 0.1;
}

.quick-actions { 
    display: flex; 
    gap: 20px; 
    margin-top: 40px; 
}

.action-btn {
    background: rgba(255,255,255,0.2); 
    border: 2px solid rgba(255,255,255,0.4); 
    color: white !important;
    padding: 15px 30px; 
    border-radius: 12px; 
    text-decoration: none; 
    font-weight: 700;
    transition: all 0.3s; 
    display: inline-flex; 
    align-items: center; 
    backdrop-filter: blur(8px);
}

.action-btn:hover { 
    background: #ffffff; 
    color: var(--primary-color) !important; 
    text-decoration: none; 
    transform: translateY(-3px); 
}

/* ==========================================================================
   Activation Screen (activacion.php)
   ========================================================================== */
.activacion-container {
    max-width: 480px;
    margin: 40px auto;
}

.panel-activacion {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #ffffff;
}

.panel-activacion .panel-heading {
    background: var(--primary-color);
    color: #fff;
    padding: 20px;
}

.panel-activacion .panel-heading h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: white !important;
}

.panel-activacion .panel-body {
    padding: 30px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .header-logos { flex-direction: column; gap: 10px; text-align: center; }
    .col-xs-4 { width: 100%; text-align: center !important; }
    .login-container { flex-direction: column; min-height: auto; border-radius: 0; }
    .login-left { display: none; }
}
