/* ══════════════════════════════════════════════════════
   PsicoReservas – Frontend Styles v4.0
   Multi-región: México + España
══════════════════════════════════════════════════════ */
:root {
    --pr-primary: #7C3AED;
    --pr-primary-light: rgba(124,58,237,.1);
    --pr-primary-lighter: rgba(124,58,237,.05);
    --pr-secondary: #A78BFA;
    --pr-accent: #F59E0B;
    --pr-text: #1F2937;
    --pr-text-muted: #6B7280;
    --pr-text-light: #9CA3AF;
    --pr-bg: #FAFAFA;
    --pr-card: #FFFFFF;
    --pr-border: #E5E7EB;
    --pr-border-light: #F3F4F6;
    --pr-success: #10B981;
    --pr-danger: #EF4444;
    --pr-radius-sm: 8px;
    --pr-radius: 14px;
    --pr-radius-lg: 20px;
    --pr-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --pr-shadow: 0 4px 16px rgba(0,0,0,.08);
    --pr-shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --pr-transition: all .25s cubic-bezier(.4,0,.2,1);
    --pr-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────── */
.pr-booking-wizard *, .pr-booking-wizard *::before, .pr-booking-wizard *::after { box-sizing: border-box; }
.pr-booking-wizard { font-family: var(--pr-font); color: var(--pr-text); max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════
   BADGE DE REGIÓN (MX / ES)
   Identifica visualmente el wizard activo
══════════════════════════════════════════════════════ */
.pr-region-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 18px;
    border: 1.5px solid;
}
.pr-region-mx {
    background: rgba(0,104,71,.06);
    color: #064E3B;
    border-color: rgba(0,104,71,.2);
}
.pr-region-es {
    background: rgba(196,30,58,.06);
    color: #7F1D1D;
    border-color: rgba(196,30,58,.2);
}

/* ── Progress bar ──────────────────────────────────── */
.pr-progress-wrap { margin-bottom: 36px; }
.pr-progress-bar { height: 6px; background: var(--pr-border); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.pr-progress-fill { height: 100%; background: linear-gradient(90deg, var(--pr-primary), var(--pr-secondary)); border-radius: 99px; transition: width .4s cubic-bezier(.4,0,.2,1); width: 0%; }
.pr-steps-labels { display: flex; justify-content: space-between; }
.pr-step-label { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; font-size: 11px; color: var(--pr-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; transition: var(--pr-transition); }
.pr-step-label.active, .pr-step-label.done { color: var(--pr-primary); }
.pr-step-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--pr-border-light); display: flex; align-items: center; justify-content: center; font-size: 16px; border: 2px solid var(--pr-border); transition: var(--pr-transition); }
.pr-step-label.active .pr-step-circle { background: var(--pr-primary-light); border-color: var(--pr-primary); transform: scale(1.1); }
.pr-step-label.done .pr-step-circle { background: var(--pr-primary); border-color: var(--pr-primary); }

/* ── Step ──────────────────────────────────────────── */
.pr-step { animation: prFadeIn .3s ease; }
@keyframes prFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.pr-step-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.pr-step-header-icon { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.pr-step-header > div { flex: 1; }
.pr-step-header h2 { font-size: 24px; font-weight: 800; color: var(--pr-text); margin: 0 0 4px; }
.pr-step-header p  { color: var(--pr-text-muted); margin: 0; font-size: 15px; }
.pr-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--pr-text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* ── Layout columnas ───────────────────────────────── */
.pr-wizard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-bottom: 20px; }
@media (max-width: 760px) { .pr-wizard-columns { grid-template-columns: 1fr; } }
.pr-col-services { display: flex; flex-direction: column; gap: 10px; }
.pr-col-calendar { background: var(--pr-card); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); padding: 18px; }
.pr-cal-placeholder { text-align: center; padding: 40px 20px; color: var(--pr-text-muted); }
.pr-cal-placeholder p { margin-top: 10px; font-size: 14px; line-height: 1.6; }

/* ── Treatment cards ───────────────────────────────── */
.pr-treatments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 28px; }
.pr-wizard-columns .pr-treatments-grid { display: flex; flex-direction: column; gap: 10px; }
.pr-treatment-card { position: relative; background: var(--pr-card); border: 2px solid var(--pr-border); border-radius: var(--pr-radius); padding: 20px 18px 18px; cursor: pointer; transition: var(--pr-transition); }
.pr-wizard-columns .pr-treatment-card { padding: 14px 16px; }
.pr-treatment-card:hover { border-color: var(--pr-secondary); box-shadow: var(--pr-shadow); transform: translateY(-3px); }
.pr-treatment-card.selected { border-color: var(--pr-primary); background: var(--pr-primary-lighter); box-shadow: 0 0 0 3px var(--pr-primary-light); }
.pr-treatment-card.selected::after { content:'✓'; position:absolute; top:10px; right:12px; background:var(--pr-primary); color:#fff; width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.pr-treatment-color { width: 48px; height: 6px; border-radius: 99px; margin-bottom: 14px; }
.pr-treatment-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 99px; margin-bottom: 8px; }
.pr-treatment-title { font-size: 16px; font-weight: 700; color: var(--pr-text); margin: 0 0 6px; }
.pr-treatment-desc  { font-size: 13px; color: var(--pr-text-muted); margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Duration options ──────────────────────────────── */
.pr-duration-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pr-duration-option { position: relative; }
.pr-duration-option input[type=radio] { position: absolute; opacity: 0; }
.pr-duration-label { display: flex; flex-direction: column; align-items: center; padding: 14px 20px; background: var(--pr-card); border: 2px solid var(--pr-border); border-radius: var(--pr-radius); cursor: pointer; transition: var(--pr-transition); min-width: 100px; }
.pr-duration-label:hover { border-color: var(--pr-secondary); }
.pr-duration-option input:checked + .pr-duration-label { border-color: var(--pr-primary); background: var(--pr-primary-lighter); }
.pr-duration-min  { font-size: 22px; font-weight: 800; color: var(--pr-primary); }
.pr-duration-unit { font-size: 11px; color: var(--pr-text-muted); text-transform: uppercase; letter-spacing: .5px; }
.pr-duration-price{ font-size: 13px; font-weight: 700; color: var(--pr-accent); margin-top: 4px; }

/* ── Price preview ─────────────────────────────────── */
.pr-price-preview { background: linear-gradient(135deg, var(--pr-primary), var(--pr-secondary)); color: #fff; border-radius: var(--pr-radius); padding: 20px 24px; margin-top: 20px; display: flex; align-items: center; justify-content: space-between; }
.pr-price-label   { font-size: 14px; opacity: .85; }
.pr-price-amount  { font-size: 32px; font-weight: 900; }
.pr-price-duration{ font-size: 13px; opacity: .75; }

/* ── Calendar + Flatpickr ──────────────────────────── */
.flatpickr-calendar { box-shadow: var(--pr-shadow-lg) !important; border-radius: var(--pr-radius) !important; border: 1px solid var(--pr-border) !important; font-family: var(--pr-font) !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--pr-primary) !important; border-color: var(--pr-primary) !important; }
.flatpickr-day:hover { background: var(--pr-primary-light) !important; }
.flatpickr-day.today { border-color: var(--pr-secondary) !important; }
.flatpickr-day.disabled, .flatpickr-day.disabled:hover { color: var(--pr-border) !important; background: none !important; cursor: not-allowed !important; }
.pr-inline-cal .flatpickr-calendar { width: 100% !important; max-width: 100% !important; box-shadow: var(--pr-shadow-lg) !important; border-radius: var(--pr-radius) !important; }
.pr-inline-cal .flatpickr-rContainer, .pr-inline-cal .flatpickr-days, .pr-inline-cal .dayContainer { width: 100% !important; max-width: 100% !important; }
.pr-inline-cal .flatpickr-day { flex: 1 !important; max-width: 100% !important; }
.pr-cal-loading { display: flex; align-items: center; gap: 8px; color: var(--pr-text-muted); font-size: 13px; margin-top: 8px; }
.pr-no-avail-warn { color: var(--pr-accent); font-size: 13px; margin-top: 8px; text-align: center; }

/* ── Slots ─────────────────────────────────────────── */
.pr-slots-container { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.pr-slots-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 160px; color: var(--pr-text-light); gap: 10px; font-size: 14px; text-align: center; }
.pr-slots-placeholder span { font-size: 36px; }
.pr-slot-btn { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--pr-card); border: 2px solid var(--pr-border); border-radius: var(--pr-radius-sm); cursor: pointer; font-size: 15px; font-weight: 600; color: var(--pr-text); transition: var(--pr-transition); width: 100%; text-align: left; }
.pr-slot-btn:hover { border-color: var(--pr-primary); background: var(--pr-primary-lighter); color: var(--pr-primary); }
.pr-slot-btn.selected { border-color: var(--pr-primary); background: var(--pr-primary); color: #fff; }
.pr-slot-time  { font-size: 16px; }
.pr-slot-badge { font-size: 11px; font-weight: 600; opacity: .7; }
.pr-selected-datetime { background: var(--pr-primary-lighter); border: 1px solid rgba(124,58,237,.2); border-radius: var(--pr-radius-sm); padding: 12px 16px; font-size: 14px; color: var(--pr-primary); font-weight: 600; margin-top: 4px; }

/* ── Patient form ──────────────────────────────────── */
.pr-form-group { margin-bottom: 20px; }
.pr-form-group label { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; color: var(--pr-text); margin-bottom: 8px; flex-wrap: wrap; }
.pr-required { color: var(--pr-danger); }
.pr-optional  { color: var(--pr-text-light); font-size: 12px; font-weight: 400; }
.pr-form-group input, .pr-form-group textarea { width: 100%; padding: 13px 16px; font-size: 15px; font-family: var(--pr-font); border: 2px solid var(--pr-border); border-radius: var(--pr-radius-sm); color: var(--pr-text); background: var(--pr-card); transition: var(--pr-transition); outline: none; -webkit-appearance: none; }
.pr-form-group input:focus, .pr-form-group textarea:focus { border-color: var(--pr-primary); box-shadow: 0 0 0 3px var(--pr-primary-light); }
.pr-form-group input.error { border-color: var(--pr-danger); }
.pr-field-error { display: block; color: var(--pr-danger); font-size: 12px; margin-top: 4px; font-weight: 600; min-height: 16px; }
.pr-privacy-note { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: var(--pr-radius-sm); font-size: 13px; color: #065F46; margin-top: 8px; }
.pr-booking-mini-summary { margin-bottom: 20px; }
.pr-mini-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; background: var(--pr-primary-light); border-radius: 10px; padding: 12px 16px; font-size: 14px; border-left: 4px solid var(--pr-primary); }
.pr-mini-summary span { display: flex; align-items: center; gap: 5px; }

/* ── Summary card ──────────────────────────────────── */
.pr-summary-card { background: var(--pr-card); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); overflow: hidden; margin-bottom: 24px; }
.pr-summary-header { background: linear-gradient(135deg, var(--pr-primary), var(--pr-secondary)); color: #fff; padding: 24px; }
.pr-summary-header h3 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.pr-summary-header p  { opacity: .85; margin: 0; font-size: 14px; }
.pr-summary-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--pr-border-light); font-size: 15px; }
.pr-summary-row:last-child { border-bottom: none; }
.pr-summary-icon  { font-size: 20px; min-width: 28px; }
.pr-summary-label { color: var(--pr-text-muted); font-size: 13px; margin-bottom: 2px; }
.pr-summary-value { font-weight: 700; color: var(--pr-text); }
.pr-summary-total { background: var(--pr-primary-lighter); border-top: 2px solid rgba(124,58,237,.15); }
.pr-summary-total .pr-summary-value { font-size: 22px; color: var(--pr-primary); }

/* ── Navigation ────────────────────────────────────── */
.pr-step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 12px; }
.pr-step-nav-center { justify-content: center; }
.pr-btn-back, .pr-btn-next, .pr-btn-pay { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: 50px; font-size: 15px; font-weight: 700; cursor: pointer; border: none; transition: var(--pr-transition); font-family: var(--pr-font); }
.pr-btn-back { background: var(--pr-border-light); color: var(--pr-text-muted); }
.pr-btn-back:hover { background: var(--pr-border); color: var(--pr-text); }
.pr-btn-next { background: var(--pr-primary); color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.35); }
.pr-btn-next:hover:not(:disabled) { background: #6D28D9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,.4); }
.pr-btn-next:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.pr-btn-pay { background: linear-gradient(135deg, var(--pr-primary), var(--pr-secondary)); color: #fff; padding: 16px 40px; font-size: 17px; box-shadow: 0 6px 20px rgba(124,58,237,.35); }
.pr-btn-pay:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,.45); }
.pr-btn-pay:disabled { opacity: .6; cursor: not-allowed; }
.pr-secure-note { text-align: center; font-size: 12px; color: var(--pr-text-light); margin-top: 14px; }

/* ── Hero ──────────────────────────────────────────── */
.pr-treatment-hero { --hero-color: var(--pr-primary); background: var(--pr-card); border: 1px solid var(--pr-border); border-radius: var(--pr-radius-lg); overflow: hidden; margin-bottom: 28px; box-shadow: var(--pr-shadow); }
.pr-hero-color-bar { height: 6px; background: var(--hero-color); }
.pr-hero-body { display: flex; align-items: center; gap: 20px; padding: 24px 28px; }
.pr-hero-left { flex: 1; }
.pr-hero-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 3px 10px; border-radius: 99px; margin-bottom: 8px; }
.pr-hero-title { font-size: 22px; font-weight: 800; color: var(--pr-text); margin: 0 0 6px; line-height: 1.2; }
.pr-hero-desc  { font-size: 14px; color: var(--pr-text-muted); margin: 0; line-height: 1.5; }
.pr-hero-img { width: 90px; height: 90px; border-radius: var(--pr-radius); object-fit: cover; flex-shrink: 0; border: 2px solid var(--pr-border); }
.pr-hero-header-icon { width: 36px; height: 36px; object-fit: contain; margin-bottom: 8px; }

/* ── Separación entre instancias ───────────────────── */
.pr-booking-wizard + .pr-booking-wizard { margin-top: 60px; padding-top: 40px; border-top: 2px dashed var(--pr-border); }

/* ── Spinners ──────────────────────────────────────── */
.pr-spinner { width: 36px; height: 36px; border: 3px solid var(--pr-border); border-top-color: var(--pr-primary); border-radius: 50%; animation: prSpin .7s linear infinite; margin: 20px auto; }
.pr-spinner-sm { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: prSpin .7s linear infinite; }
@keyframes prSpin { to { transform: rotate(360deg); } }
.pr-loading-placeholder { text-align: center; padding: 40px; color: var(--pr-text-muted); }
.pr-global-error { background: #FEE2E2; border: 1px solid #FECACA; border-radius: var(--pr-radius-sm); padding: 14px 16px; color: #991B1B; font-size: 14px; font-weight: 600; margin-top: 16px; animation: prFadeIn .3s; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 500px) {
    .pr-treatments-grid { grid-template-columns: 1fr; }
    .pr-step-header h2  { font-size: 20px; }
    .pr-btn-pay { padding: 14px 28px; font-size: 15px; }
    .pr-steps-labels { gap: 0; }
    .pr-step-label span { display: none; }
    .pr-hero-body { flex-direction: column; padding: 20px; }
    .pr-hero-img  { width: 60px; height: 60px; }
    .pr-hero-title { font-size: 18px; }
}
