/* ==========================================================================
   Operativo de Atención Médica Villa Plaza Mayor - Modern Design System
   Pure Vanilla CSS3 - Mobile-First & Fully Responsive
   ========================================================================== */

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --brand-teal: #0d9488;
    --brand-navy: #0f172a;
    --brand-blue: #0284c7;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #38bdf8;
    
    --danger-bg: #fef2f2;
    --danger-text: #dc2626;
    --danger-border: #fca5a5;
    
    --success-bg: #f0fdf4;
    --success-text: #16a34a;
    --success-border: #86efac;
    
    --warning-bg: #fffbeb;
    --warning-text: #d97706;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    
    --transition-fast: all 0.2s ease-in-out;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.container-wide {
    max-width: 1200px;
}

/* Header & Logo */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .header-content {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 65px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.header-titles h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.header-titles p {
    font-size: 0.9rem;
    color: var(--brand-blue);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Main Content Card */
.main-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .main-card {
        padding: 2.5rem;
    }
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 2px solid var(--bg-subtle);
    padding-bottom: 0.75rem;
}

.section-title i {
    color: var(--brand-blue);
    font-size: 1.5rem;
}

/* Stock Summary Section */
.stock-summary-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.stock-grid-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stock-summary-item {
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-summary-item .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.stock-summary-item .count {
    font-size: 0.95rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.count-available {
    background: var(--success-bg);
    color: var(--success-text);
}

.count-soldout {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* Service Selection Cards Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    user-select: none;
}

.service-card:hover:not(.disabled) {
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.service-card.selected {
    border-color: var(--brand-blue);
    background-color: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.service-card.disabled {
    opacity: 0.65;
    background-color: var(--bg-subtle);
    border-color: #cbd5e1;
    cursor: not-allowed;
}

.service-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #e0f2fe;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.service-card.disabled .service-icon {
    background: #e2e8f0;
    color: var(--text-muted);
}

.service-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.quota-info {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.quota-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-available {
    background: #dcfce7;
    color: #15803d;
}

.badge-soldout {
    background: #fee2e2;
    color: #b91c1c;
}

/* Hidden Radio Input */
.service-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Form Controls */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.form-group label span.required {
    color: var(--danger-text);
    margin-left: 0.2rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-main);
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger-text);
    background-color: var(--danger-bg);
}

.invalid-feedback {
    font-size: 0.8rem;
    color: var(--danger-text);
    font-weight: 600;
    margin-top: 0.2rem;
}

/* Data Authorization Box */
.privacy-box {
    background: var(--bg-subtle);
    border-left: 4px solid var(--brand-blue);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin: 2rem 0;
}

.privacy-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.privacy-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    accent-color: var(--brand-blue);
    cursor: pointer;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #fde68a;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

/* Confirmation Card */
.confirmation-card {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

.confirmation-details {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 600;
}

.detail-value {
    color: var(--brand-navy);
    font-weight: 700;
}

/* Admin Styles */
.admin-navbar {
    background: var(--brand-navy);
    color: #ffffff;
    padding: 0.75rem 1rem;
}

.admin-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-menu {
    display: flex;
    gap: 1rem;
    list-style: none;
    flex-wrap: wrap;
}

.admin-menu a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-menu a:hover, .admin-menu a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-navy);
    margin: 0.25rem 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    background: var(--bg-card);
}

.data-table th {
    background: var(--bg-subtle);
    color: var(--brand-navy);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.data-table tr:hover {
    background: #f8fafc;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    cursor: pointer;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.btn-danger:hover {
    background: #fee2e2;
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
