/* AGR Productions — agenda.
   Idea: el selector de hora es una línea de tiempo de edición (regla + clips + cabezal), no una lista de botones.
   Una sola familia (Archivo): ancho condensado para los títulos, ancho normal para la interfaz. */

:root {
  --bg: #e7eaee;
  --panel: #ffffff;
  --ink: #000000;
  --ink-2: #4a5058;
  --ink-3: #6b727b;
  --line: #d3d8de;
  --line-2: #e6e9ed;
  --playhead: #2b6bff;
  --playhead-ink: #ffffff;
  --danger: #b3261e;
  --ok: #17663a;
  --radius: 4px;
  --rail: 64px;
  --row: 46px;
  --gap-row: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--playhead); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }

/* ---------- barra superior ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 40px; }
.brand img { display: block; height: 40px; width: 40px; border-radius: var(--radius); }
.brand .wordmark { font-stretch: 70%; font-weight: 800; font-size: 24px; letter-spacing: 0.01em; line-height: 1; }
.lang { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.lang button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- hoja principal ---------- */
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 1fr; }
.pane { padding: 24px 20px; min-width: 0; }
.pane + .pane { border-top: 1px solid var(--line-2); }

@media (min-width: 960px) {
  .sheet.pick { grid-template-columns: 300px minmax(320px, 1fr) 300px; }
  .sheet.form { grid-template-columns: 300px 1fr; }
  .sheet.single { grid-template-columns: 300px 1fr; }
  .pane { padding: 32px 28px; }
  .pane + .pane { border-top: 0; border-left: 1px solid var(--line-2); }
}

/* ---------- columna de información ---------- */
.eyebrow-back { background: none; border: 0; padding: 0; margin: 0 0 18px; cursor: pointer; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.who { margin: 0 0 4px; color: var(--ink-2); font-size: 15px; }
.title {
  margin: 0 0 18px;
  font-weight: 800;
  font-size: 38px;
  line-height: 0.98;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.font-ok .title { font-stretch: 68%; font-size: clamp(44px, 6.4vw, 60px); line-height: 0.94; letter-spacing: 0; }
.facts { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.facts li { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); }
.facts svg { flex: none; width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desc { margin: 0; max-width: 34ch; color: var(--ink-2); font-size: 15px; }
.chosen { margin: 18px 0 0; padding: 12px 14px; border-left: 4px solid var(--playhead); background: #f3f6ff; font-weight: 600; }
.chosen small { display: block; font-weight: 400; color: var(--ink-2); }

/* ---------- calendario ---------- */
.pane-title { margin: 0 0 16px; font-size: 20px; font-weight: 700; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.cal-head h2::first-letter, .tl-head::first-letter { text-transform: uppercase; }
.nav { display: flex; gap: 6px; }
.nav button { width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); cursor: pointer; display: grid; place-items: center; }
.nav button:hover:not(:disabled) { border-color: var(--ink); }
.nav button:disabled { opacity: 0.35; cursor: default; }
.nav svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 0; text-transform: capitalize; }
.day {
  aspect-ratio: 1; min-height: 42px; border: 0; background: transparent; border-radius: var(--radius);
  font-size: 15px; color: var(--ink-3); cursor: default; position: relative;
}
.day.open { color: var(--ink); font-weight: 700; background: #f0f3f7; cursor: pointer; }
.day.open:hover { background: #e2e8f1; }
.day.open[aria-pressed="true"] { background: var(--ink); color: #fff; }
.day.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

.tz { margin-top: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.tz select { max-width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---------- línea de tiempo (la pieza central) ---------- */
.tl-head { margin: 0 0 14px; font-size: 20px; font-weight: 700; }
.tl { position: relative; }
.tl-row { display: grid; grid-template-columns: var(--rail) 1fr; align-items: center; }
.tl-row .t { position: relative; height: 100%; display: flex; align-items: center; font-size: 12px; color: var(--ink-3); padding-right: 12px; justify-content: flex-end; }
.tl-row .t::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-row.free { min-height: var(--row); padding: 3px 0; }
.tl-row.gap { height: var(--gap-row); }
.tl-row.gap .t::after { background: repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 6px); }
.tl-row.hour .t { color: var(--ink); font-weight: 600; }
.clip {
  width: 100%; height: 100%; min-height: 40px; text-align: left; padding: 0 14px; margin-left: 8px; width: calc(100% - 8px);
  border: 1px solid var(--ink); background: #fff; border-radius: var(--radius); cursor: pointer; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.clip:hover { background: var(--ink); color: #fff; }
.clip[aria-pressed="true"] { background: var(--playhead); border-color: var(--playhead); color: var(--playhead-ink); }
.clip .go { font-weight: 600; font-size: 14px; display: none; }
.clip[aria-pressed="true"] .go { display: inline; }
.tl-row.sel .t { color: var(--playhead); font-weight: 700; }
.tl-row.sel .t::after { width: 3px; right: -1px; background: var(--playhead); }
.tl-row.sel .t::before { content: ""; position: absolute; right: -7px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left-color: var(--playhead); border-right: 0; }

.empty { padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); font-size: 15px; }
.empty button { margin-top: 10px; }

/* ---------- formulario ---------- */
.form-grid { display: grid; gap: 16px; max-width: 520px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.field input, .field textarea { padding: 11px 12px; border: 1px solid #aab1b9; border-radius: var(--radius); background: #fff; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--playhead); }
.two { display: grid; gap: 16px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; font-size: 16px; }
.btn:hover:not(:disabled) { background: #222; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: #f0f3f7; }
.btn.blue { background: var(--playhead); border-color: var(--playhead); }
.btn.blue:hover:not(:disabled) { background: #1f56d6; }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.err { margin: 0; padding: 12px 14px; border-left: 4px solid var(--danger); background: #fdf1f0; color: #6b1a15; font-size: 15px; }
.note { margin: 0; padding: 12px 14px; border-left: 4px solid var(--ok); background: #eef8f1; font-size: 15px; }

/* ---------- confirmación / gestión ---------- */
.done-title { margin: 0 0 6px; font-weight: 800; font-size: 36px; line-height: 1; overflow-wrap: break-word; }
.font-ok .done-title { font-stretch: 68%; font-size: clamp(38px, 6vw, 56px); line-height: 0.95; }
.detail { margin: 0 0 20px; display: grid; gap: 10px; max-width: 480px; }
.detail .row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.detail .k { color: var(--ink-3); font-size: 14px; padding-top: 2px; }
.detail .v { font-weight: 600; word-break: break-word; }
.center { max-width: 640px; margin: 0 auto; }
.single-col { padding: 32px 20px; }

.foot { margin-top: 20px; font-size: 13px; color: var(--ink-3); text-align: center; }
.foot a { text-underline-offset: 3px; }

.loading { color: var(--ink-3); padding: 12px 0; }
.skeleton { height: var(--row); margin: 6px 0 6px var(--rail); background: linear-gradient(90deg, #eef1f4, #f7f8fa, #eef1f4); border-radius: var(--radius); }

@media (prefers-reduced-motion: no-preference) {
  .sheet.enter { animation: rise 220ms ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .skeleton { background-size: 200% 100%; animation: sheen 1.2s linear infinite; }
  @keyframes sheen { to { background-position: -200% 0; } }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }


/* ---------- selector de tipo de evento ---------- */
.choices { display: grid; gap: 10px; max-width: 560px; }
.choice {
  display: grid; grid-template-columns: 6px 1fr 20px; gap: 16px; align-items: center; text-align: left;
  padding: 16px 16px 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer;
}
.choice:hover { border-color: var(--ink); }
.choice .swatch { align-self: stretch; background: var(--c, var(--ink)); border-radius: var(--radius) 0 0 var(--radius); margin: -16px 0; }
.choice-body { display: grid; gap: 2px; min-width: 0; }
.choice-body strong { font-size: 18px; }
.choice-body small { color: var(--ink-2); font-size: 14px; }
.choice-desc { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.choice svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field select { padding: 11px 12px; border: 1px solid #aab1b9; border-radius: var(--radius); background: #fff; width: 100%; }
.field [aria-invalid="true"] { border-color: var(--danger); }

/* ---------- modo embed (iframe en otra web) ---------- */
html.embed body { background: transparent; }
html.embed .shell { padding: 8px 8px 12px; max-width: none; }
html.embed .brand .wordmark, html.embed .brand img { display: none; }
html.embed .top { justify-content: flex-end; margin-bottom: 8px; }
html.embed .foot { display: none; }

/* barra fija "Continuar" al elegir una hora */
.selbar { position: sticky; bottom: 0; margin: 14px -1px 0; padding: 12px 0; background: var(--panel); border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 5; }
.selbar-txt { display: grid; gap: 2px; min-width: 0; }
.selbar-txt strong { font-size: 18px; }
.selbar-txt span { font-size: 13px; color: var(--ink-2); }
.selbar .btn { flex: none; min-width: 140px; }
