/* ═══════════════════════════════════════════════════════════════
   booking-flow.css — Shared styles for the multi-step booking flow
   (tipo-paziente, seleziona-laboratorio, register, payment)
   ═══════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #111827;
    background: #f5f5f7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Step Progress (below fixed booking header ~56px) ── */
.step-progress {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
    position: sticky;
    top: 56px;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.step-progress-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
}
.step-item.active { color: #2563eb; font-weight: 600; }
.step-item.completed { color: #10b981; }
.step-number {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #e5e7eb; color: #6b7280;
    transition: all 0.3s ease;
}
.step-item.active .step-number {
    background: #2563eb; color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}
.step-item.completed .step-number {
    background: #10b981; color: #fff;
}
.step-connector {
    width: 32px; height: 2px;
    background: #e5e7eb; border-radius: 1px;
}
.step-connector-done { background: #10b981; }
.step-item.completed .step-number i { font-size: 10px; }

/* ── Hero — compact banner ── */
.page-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #2563eb 100%);
    padding: 28px 24px 36px;
    text-align: center;
    color: #fff;
    position: relative;
}
.page-hero h1 {
    font-size: clamp(1.4em, 3.5vw, 1.9em);
    font-weight: 800;
    margin-bottom: 6px;
    color: #fff;
    letter-spacing: -0.02em;
}
.page-hero .subtitle {
    font-size: 0.95em;
    color: rgba(255,255,255,0.8);
}
.page-hero .subtitle-secondary {
    margin-top: 8px;
    font-size: 0.9em;
    opacity: 0.85;
}
.page-hero .subtitle-secondary i { margin-right: 4px; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.18);
}

/* ── Shared buttons ── */
.btn {
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 52px;
}
.btn-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37,99,235,0.4);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}
.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}
.btn-secondary:active {
    transform: translateY(0);
    background-color: #d1d5db;
}

/* ── Back link pill ── */
.back-link {
    text-align: center;
    margin-top: 28px;
}
.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.back-link a:hover {
    color: #2563eb;
    border-color: #93c5fd;
    background: #eff6ff;
}

/* ── Info boxes ── */
.info-box {
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.93em;
    line-height: 1.7;
    border-left: 4px solid;
}
.info-box p { margin: 0; }
.info-box p i { margin-right: 6px; }
.info-box-blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left-color: #3b82f6;
}
.info-box-blue p { color: #1e40af; }
.info-box-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left-color: #f59e0b;
    font-size: 0.85em;
}
.info-box-warning p { color: #92400e; }

/* ── Alert/popup modal (shared) ── */
.alert-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 100000;
    align-items: center; justify-content: center;
}
.alert-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.alert-modal {
    position: relative;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    max-width: 480px;
    width: 92%;
    overflow: hidden;
    animation: alertIn 0.25s ease;
}
@keyframes alertIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.alert-header {
    padding: 28px 24px;
    text-align: center;
}
.alert-header-icon {
    width: 64px; height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.alert-header-icon i { color: #fff; font-size: 28px; }
.alert-header h3 { margin: 0; color: #fff; font-size: 19px; font-weight: 700; }
.alert-header p { margin: 8px 0 0; color: rgba(255,255,255,0.9); font-size: 14px; }
.alert-body {
    padding: 24px 26px;
    text-align: center;
}
.alert-body p { font-size: 15px; color: #374151; line-height: 1.6; margin: 0 0 8px; }
.alert-body p.secondary { font-size: 14px; color: #6b7280; margin: 0 0 22px; }
.alert-footer {
    padding: 0 26px 22px;
    display: flex;
    justify-content: center;
}

/* Alert color variants */
.alert-header-red { background: linear-gradient(135deg, #e74c3c, #f87171); }
.alert-header-amber { background: linear-gradient(135deg, #f59e0b, #ef4444); }

/* Alert action buttons */
.alert-btn-primary {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; width: 100%;
    padding: 15px 24px;
    border-radius: 12px;
    font-size: 1em; font-weight: 700;
    text-decoration: none; color: #fff;
    border: none; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 12px;
}
.alert-btn-primary:hover {
    transform: translateY(-2px);
}
.alert-btn-primary-red {
    background: linear-gradient(135deg, #e74c3c, #f87171);
    box-shadow: 0 4px 14px rgba(231,76,60,0.35);
}
.alert-btn-primary-red:hover { box-shadow: 0 8px 20px rgba(231,76,60,0.4); }
.alert-btn-primary-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.alert-btn-outline {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%;
    padding: 13px 24px;
    background: #f3f4f6; color: #374151;
    border: 2px solid #e5e7eb; border-radius: 12px;
    font-size: 0.95em; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}
.alert-btn-outline:hover {
    border-color: #2563eb; background: #eef2ff;
}

/* ── Section title ── */
.section-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { color: #2563eb; }

/* ── No results ── */
.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

body.modal-open { overflow: hidden; }

/* ── Responsive: shared breakpoints ── */
@media (max-width: 768px) {
    .step-progress {
        padding: 10px 12px;
        scrollbar-width: none;
        top: 48px;
    }
    .step-progress::-webkit-scrollbar { display: none; }
    .step-progress-inner {
        gap: 4px;
        font-size: 12px;
        justify-content: flex-start;
        min-width: max-content;
        padding-right: 20px;
    }
    .step-item { gap: 6px; }
    .step-item span:not(.step-number) {
        font-size: 11px;
        max-width: 65px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .step-connector { width: 18px; }
    .step-number { width: 24px; height: 24px; font-size: 11px; }

    .page-hero { padding: 20px 16px 28px; }
    .page-hero h1 { font-size: 1.3em; }
    .page-hero .subtitle { font-size: 0.88em; }
    .hero-badge { font-size: 11px; padding: 6px 12px; }

    .btn {
        padding: 16px 24px;
        font-size: 1em;
        min-height: 54px;
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .page-hero { padding: 16px 14px 24px; }
    .page-hero h1 { font-size: 1.2em; }
    .page-hero .subtitle { font-size: 0.82em; }
    .step-item span:not(.step-number) { font-size: 10px; max-width: 52px; }
    .step-connector { width: 14px; }
}
