/* 
   Style Sheet v2 - XVI Jornadas Pediátricas del Puerto
   Fully Responsive — Mobile · Tablet · Laptop · Desktop
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
    --primary-color: #e76f51;
    --primary-hover: rgba(231, 111, 81, 0.9);
    --primary-light: rgba(231, 111, 81, 0.08);
    --primary-glow: rgba(231, 111, 81, 0.12);
    --secondary-color: #a3d6eb;
    --secondary-light: rgba(163, 214, 235, 0.12);
    --accent-color: #0564a2;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ============================================================
   FULL-WIDTH CONTAINER SYSTEM
   Uses max-width only on very large screens
============================================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px)  { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }
@media (min-width: 1280px) { .container { padding: 0 2.5rem; } }

/* ============================================================
   HEADER
============================================================ */
header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-shrink: 0;
}

.header-brand img {
    height: 48px;
    object-fit: contain;
}

@media (min-width: 640px) { .header-brand img { height: 56px; } }
@media (min-width: 1024px) { .header-brand img { height: 64px; } }

.header-title {
    border-left: 2px solid var(--border-color);
    padding-left: 0.875rem;
}

.header-title h1 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

@media (min-width: 640px) { .header-title h1 { font-size: 1.1rem; } }

.header-logo-right {
    height: 40px;
    object-fit: contain;
    max-width: 100px;
    flex-shrink: 0;
}

@media (min-width: 640px) { .header-logo-right { height: 50px; max-width: 120px; } }

/* ============================================================
   PAGE WRAPPER
============================================================ */
.page-wrapper {
    padding: 1.5rem 0 3rem;
}

@media (min-width: 768px) { .page-wrapper { padding: 2rem 0 4rem; } }

/* ============================================================
   MAIN TWO-COLUMN LAYOUT
   Single column on mobile/tablet, 2-col on large screens
============================================================ */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr 360px;
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .main-grid {
        grid-template-columns: 1fr 400px;
    }
}

/* On mobile: show sidebar cards after main card */
.main-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    order: 2;
}

@media (min-width: 1024px) {
    .main-sidebar {
        order: unset;
        position: sticky;
        top: 5rem;
    }
}

/* ============================================================
   CARDS
============================================================ */
.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 640px) { .card-body { padding: 1.75rem; } }
@media (min-width: 1024px) { .card-body { padding: 2rem; } }

/* ============================================================
   FORM STYLES
============================================================ */
.form-group { margin-bottom: 1.125rem; }

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--dark-color);
    font-family: inherit;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(5, 100, 162, 0.12);
}

.form-control::placeholder { color: #c0ccd8; }

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.6rem center;
    background-repeat: no-repeat;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

/* Two-column inner form grids */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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

/* ============================================================
   BUTTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #e76f51, rgba(231, 111, 81, 0.85));
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(231, 111, 81, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, rgba(231, 111, 81, 0.9), rgba(231, 111, 81, 0.7));
    box-shadow: 0 4px 12px rgba(231, 111, 81, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--dark-color);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-secondary:hover {
    background-color: var(--light-color);
    border-color: var(--border-hover);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-full { width: 100%; }

/* Responsive button rows */
.btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ============================================================
   ERROR ALERT
============================================================ */
.alert-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CATEGORY CARDS
============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.category-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.125rem;
    cursor: pointer;
    background-color: #ffffff;
    transition: var(--transition);
    position: relative;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 90px;
}

.category-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.category-card .radio-indicator {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.category-card.selected .radio-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.category-card.selected .radio-indicator::after {
    content: '';
    width: 0.375rem;
    height: 0.375rem;
    background-color: #ffffff;
    border-radius: 50%;
}

.category-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    padding-right: 1.75rem;
    line-height: 1.3;
}

.category-card .price {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* ============================================================
   WIZARD STEPS
============================================================ */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 1.15rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(to right, var(--border-color), var(--border-color));
    z-index: 1;
}

.wizard-step {
    position: relative;
    z-index: 2;
    background-color: var(--light-color);
    padding: 0 0.375rem;
    text-align: center;
    flex: 1;
}

.step-num {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.4rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-step.active .step-num {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.12);
    transform: scale(1.05);
}

.wizard-step.completed .step-num {
    border-color: var(--success-color);
    background-color: var(--success-color);
    color: #ffffff;
}

.step-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

@media (min-width: 480px) { .step-label { font-size: 0.73rem; } }

.wizard-step.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.wizard-panel { display: none; }
.wizard-panel.active {
    display: block;
    animation: panelFadeIn 0.35s ease;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   PAYMENT METHOD SECTION
============================================================ */
.payment-option {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.625rem;
}

.payment-option:hover {
    border-color: var(--accent-color);
}

.payment-option.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

/* ============================================================
   TRANSFER INFO BOX
============================================================ */
.transfer-box {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
}

.transfer-box .transfer-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(231, 111, 81, 0.07);
    border-left: 3px solid var(--primary-color);
    padding: 0.75rem 1rem;
    border-radius: 0 0.375rem 0.375rem 0;
    margin-top: 0.875rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    line-height: 1.4;
}

/* ============================================================
   SIDEBAR SUMMARY (right column)
============================================================ */
.sidebar-summary {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(163, 214, 235, 0.25) 100%);
    border: 1px dashed rgba(231, 111, 81, 0.2);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.summary-row span:first-child {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.summary-total {
    border-top: 1px solid rgba(231, 111, 81, 0.15);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   INFO & CONTACT CARDS
============================================================ */
.info-card-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    line-height: 1.4;
}

.info-list li::before {
    content: '•';
    color: var(--accent-color);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.contact-item {
    font-size: 0.8rem;
    margin-bottom: 0.625rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.contact-item strong { color: var(--dark-color); }

/* ============================================================
   STRIPE ELEMENTS
============================================================ */
#payment-element {
    margin-bottom: 1.5rem;
}

.stripe-loading {
    text-align: center;
    padding: 2rem 1rem;
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(231, 111, 81, 0.15);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   UTILITIES
============================================================ */
.hidden { display: none !important; }

.text-sm  { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }

/* ============================================================
   RESPONSIVENESS HELPERS
============================================================ */
/* Collapsible grid for small screens */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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

/* Responsive step labels — hide on very small screens */
@media (max-width: 380px) {
    .step-label { display: none; }
    .step-num   { margin-bottom: 0; }
}
