/* ==========================================================================
   Sistema de cites - Clínica del Mòbil
   Estil public (inspirat en Calendly: blau #006BFF, targetes blanques)
   ========================================================================== */

:root {
  --cl-primary: #006BFF;
  --cl-primary-dark: #0052CC;
  --cl-primary-soft: #EAF2FF;
  --cl-dark: #1A2B49;
  --cl-text: #323C4A;
  --cl-muted: #6B7785;
  --cl-border: #DFE1E6;
  --cl-bg: #F8F9FB;
  --cl-white: #FFFFFF;
  --cl-success: #00A86B;
  --cl-success-soft: #E6F7F0;
  --cl-danger: #DE350B;
  --cl-danger-soft: #FFF0ED;
  --cl-radius: 12px;
  --cl-shadow: 0 1px 3px rgba(26, 43, 73, .08), 0 8px 24px rgba(26, 43, 73, .06);
  --cl-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--cl-font);
  background: var(--cl-bg);
  color: var(--cl-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------- topbar --- */
.topbar {
  background: var(--cl-white);
  border-bottom: 1px solid var(--cl-border);
}
.topbar-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-logo {
  font-weight: 800;
  font-size: 18px;
  color: var(--cl-dark);
  letter-spacing: -.3px;
}
.topbar-link {
  font-size: 13px;
  color: var(--cl-muted);
  text-decoration: none;
}
.topbar-link:hover { color: var(--cl-primary); }

/* ------------------------------------------------------------- layout --- */
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .wrap { padding: 14px 12px 40px; }
}

.card {
  background: var(--cl-white);
  border: 1px solid var(--cl-border);
  border-radius: var(--cl-radius);
  box-shadow: var(--cl-shadow);
}

/* -------------------------------------------------------- targeta esquerra */
.event-card { padding: 28px 26px; }
.event-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cl-primary-soft);
  color: var(--cl-primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.event-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--cl-dark);
  margin: 0 0 14px;
  line-height: 1.25;
  letter-spacing: -.3px;
}
.event-meta { margin-bottom: 14px; }
.event-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cl-muted);
  font-size: 14px;
  padding: 4px 0;
}
.event-meta-row .ico { width: 18px; text-align: center; }
.event-desc {
  font-size: 14px;
  color: var(--cl-muted);
  line-height: 1.55;
  border-top: 1px solid var(--cl-border);
  padding-top: 14px;
  margin: 0;
}

@media (max-width: 820px) {
  .event-card { padding: 20px 18px; }
  .event-avatar { width: 48px; height: 48px; margin-bottom: 12px; }
  .event-title { font-size: 19px; }
}

/* ----------------------------------------------------------- flux / pasos */
.flow-card { padding: 28px 28px 32px; min-height: 420px; }
@media (max-width: 600px) {
  .flow-card { padding: 20px 16px 24px; border-radius: 10px; }
}

.steps {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0 0 26px;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cl-muted);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--cl-bg);
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--cl-border);
  color: var(--cl-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.step.active { background: var(--cl-primary-soft); color: var(--cl-primary); }
.step.active .step-num { background: var(--cl-primary); color: #fff; }
.step.fet .step-num { background: var(--cl-success); color: #fff; }

.pas-titol {
  font-size: 18px;
  font-weight: 700;
  color: var(--cl-dark);
  margin: 0 0 16px;
}

/* ------------------------------------------------------------- calendari */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-titol {
  font-weight: 700;
  color: var(--cl-dark);
  font-size: 16px;
  text-transform: capitalize;
}
.cal-nav {
  border: 1px solid var(--cl-border);
  background: var(--cl-white);
  color: var(--cl-dark);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  transition: .15s;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav:hover:not(:disabled) { border-color: var(--cl-primary); color: var(--cl-primary); }
.cal-nav:disabled { opacity: .35; cursor: default; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.cal-dia-setmana {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cl-muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.cal-dia {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
  color: var(--cl-dark);
  border: 2px solid transparent;
  cursor: default;
  user-select: none;
  position: relative;
  min-height: 38px;
}
.cal-dia.buit { visibility: hidden; }
.cal-dia.disponible { cursor: pointer; background: var(--cl-primary-soft); color: var(--cl-primary); }
.cal-dia.disponible:hover { background: var(--cl-primary); color: #fff; }
.cal-dia.seleccionat { background: var(--cl-primary) !important; color: #fff !important; box-shadow: 0 2px 8px rgba(0,107,255,.4); }
.cal-dia.avui::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.cal-dia.bloquejat { color: #B9C0CA; }

/* --------------------------------------------------------------- slots --- */
.slots-zone { margin-top: 22px; }
.slots-titol {
  font-size: 15px;
  font-weight: 700;
  color: var(--cl-dark);
  margin: 0 0 12px;
}
.slots-titol span { color: var(--cl-muted); font-weight: 500; text-transform: capitalize; }
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.slot {
  border: 1.5px solid var(--cl-primary);
  color: var(--cl-primary);
  background: var(--cl-white);
  border-radius: 10px;
  padding: 12px 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: .12s;
  font-family: var(--cl-font);
  text-align: center;
  min-height: 44px;
}
.slot:hover { background: var(--cl-primary-soft); }
.slot.seleccionat { background: var(--cl-primary); color: #fff; box-shadow: 0 2px 8px rgba(0,107,255,.35); }
.slots-buit {
  color: var(--cl-muted);
  font-size: 14px;
  padding: 14px 0;
}

/* --------------------------------------------------------------- form ---- */
.camp { margin-bottom: 18px; flex: 1; }
.camp-row { display: flex; gap: 14px; }
.camp-row .camp { min-width: 0; }
@media (max-width: 600px) { .camp-row { flex-direction: column; gap: 0; } }

.camp label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--cl-dark);
  margin-bottom: 6px;
}
.camp .opcional { color: var(--cl-muted); font-weight: 500; }

.camp input, .camp textarea {
  width: 100%;
  border: 1.5px solid var(--cl-border);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 16px; /* 16px evita zoom automatic en iOS */
  font-family: var(--cl-font);
  color: var(--cl-dark);
  background: var(--cl-white);
  transition: border-color .15s, box-shadow .15s;
}
.camp input:focus, .camp textarea:focus {
  outline: none;
  border-color: var(--cl-primary);
  box-shadow: 0 0 0 3px rgba(0,107,255,.12);
}
.camp input.invalid { border-color: var(--cl-danger); }
.camp input.valid { border-color: var(--cl-success); }
.camp-ajuda { font-size: 13px; color: var(--cl-muted); margin-top: 5px; min-height: 18px; }
.camp-ajuda.ok { color: var(--cl-success); }
.camp-ajuda.err { color: var(--cl-danger); }

.accions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* ------------------------------------------------------------ bottons ---- */
.btn {
  border: none;
  border-radius: 10px;
  font-family: var(--cl-font);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  cursor: pointer;
  transition: .15s;
  min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-principal { background: var(--cl-primary); color: #fff; flex: 1; }
.btn-principal:hover { background: var(--cl-primary-dark); }
.btn-gran { background: var(--cl-primary); color: #fff; padding: 15px 34px; font-size: 16px; width: 100%; }
.btn-gran:hover { background: var(--cl-primary-dark); }
.btn-gran:disabled { opacity: .6; cursor: wait; }
.btn-secundari {
  background: var(--cl-white);
  color: var(--cl-text);
  border: 1.5px solid var(--cl-border);
}
.btn-secundari:hover { border-color: var(--cl-muted); }

/* ------------------------------------------------------------- resum ----- */
.resum-mini {
  background: var(--cl-bg);
  border: 1px solid var(--cl-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--cl-dark);
  font-weight: 600;
  margin-top: 6px;
  margin-bottom: 6px;
}
.resum-mini:empty { display: none; }

.resum-targeta {
  border: 1.5px solid var(--cl-border);
  border-radius: var(--cl-radius);
  padding: 20px;
  margin-bottom: 18px;
  background: var(--cl-white);
}
.resum-fila { display: flex; gap: 12px; padding: 8px 0; font-size: 15px; }
.resum-fila .etq { color: var(--cl-muted); width: 110px; flex-shrink: 0; }
.resum-fila .val { font-weight: 600; color: var(--cl-dark); word-break: break-word; }

.avis-rgpd {
  font-size: 13px;
  color: var(--cl-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.avis-rgpd a { color: var(--cl-primary); }

/* ------------------------------------------------------------- exit ------ */
.exit {
  text-align: center;
  padding: 10px 0;
}
.exit-check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--cl-success-soft);
  color: var(--cl-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.exit h2 { color: var(--cl-dark); margin: 0 0 8px; font-size: 22px; }
.exit p { color: var(--cl-muted); margin: 4px 0 18px; }
.exit .resum-targeta { text-align: left; }
.exit-gcal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cl-white);
  border: 1.5px solid var(--cl-border);
  color: var(--cl-dark);
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  margin-top: 8px;
  min-height: 46px;
}
.exit-gcal:hover { border-color: var(--cl-primary); color: var(--cl-primary); }

/* ------------------------------------------------------------- avissos --- */
.notice {
  border-radius: var(--cl-radius);
  padding: 22px 24px;
  font-size: 15px;
  line-height: 1.6;
}
.notice h2 { margin: 0 0 8px; font-size: 18px; color: var(--cl-dark); }
.notice p { margin: 0; color: var(--cl-muted); }
.notice-error { background: var(--cl-danger-soft); border: 1px solid #FFC9BC; }

/* ----------------------------------------------------------- cookies ----- */
.cookies-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 43, 73, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.cookies-overlay[hidden],
.cookies-overlay.amagada {
  display: none !important;
}
.cookies-modal {
  background: var(--cl-white);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  padding: 26px 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  max-height: 94vh;
  overflow-y: auto;
}
.cookies-icon { font-size: 32px; margin-bottom: 4px; }
.cookies-modal h2 { margin: 0 0 6px; color: var(--cl-dark); font-size: 20px; }
.cookies-intro { color: var(--cl-muted); font-size: 13.5px; margin: 0 0 16px; line-height: 1.5; }

.cookie-bloc {
  border: 1.5px solid var(--cl-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.cookie-obligatories { background: var(--cl-bg); }
.cookie-opcionals { background: var(--cl-primary-soft); border-color: #C4DCFF; }
.cookie-bloc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cookie-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-obligatoria { background: #E3E7ED; color: var(--cl-dark); }
.badge-opcional { background: var(--cl-primary); color: #fff; }
.cookie-sempre { font-size: 12px; color: var(--cl-muted); font-weight: 600; }
.cookie-bloc p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--cl-text); }

.cookies-btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.cookies-btns .btn { flex: 1; min-width: 140px; }
.cookies-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--cl-muted);
}
.cookies-link:hover { color: var(--cl-primary); }

/* switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #C4CCD6;
  border-radius: 999px;
  transition: .2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .switch-slider { background: var(--cl-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ------------------------------------------------------------- toast ----- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cl-dark);
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  max-width: 92vw;
  text-align: center;
}
.toast.error { background: var(--cl-danger); }

/* --------------------------------------------------- pagina politica ----- */
.politica {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 16px 70px;
}
.politica h1 { color: var(--cl-dark); font-size: 24px; }
.politica h2 { color: var(--cl-dark); font-size: 18px; margin-top: 26px; }
.politica p, .politica li { color: var(--cl-text); line-height: 1.7; font-size: 14.5px; }
.politica .card { padding: 22px 20px; }
