/* UNYX · agenda.css · la ventana de reservar la llamada de 30 minutos (js/agenda.js).
   El paso de día y hora sigue el «Slot Week Picker» que eligió Guillermo (29-11-2026): tarjeta redondeada
   con relieve, la semana en tira, la píldora líquida, rejilla de 3 y botón con degradado. El degradado va
   en los azules de UNYX en vez del morado y coral del original (--ag-degradado: cambiarlo es una línea). */
html.agenda-abierta { overflow: hidden; }
.agenda {
  --ag-degradado: linear-gradient(120deg, #1830C0, #2240F2 55%, #6b7bff);
  --ag-borde: rgba(22, 24, 28, 0.12);
  --ag-suave: #F3F3EE;
  width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 22px; margin: auto; border: 0; background: transparent; color: var(--ink);
  overflow: visible; perspective: 1100px;
}
.agenda::backdrop { background: rgba(22, 24, 28, 0.5); backdrop-filter: blur(3px); }
.ag-defs { position: absolute; }
.ag-halo {
  position: absolute; inset: 10px; border-radius: 2rem; pointer-events: none;
  background: conic-gradient(from 90deg, #2240F2, #22d3ee, #8fa0ff, #2240F2); filter: blur(28px); opacity: .3;
  animation: ag-halo 6s ease-in-out infinite;
}
@keyframes ag-halo { 50% { opacity: .5; transform: rotate(6deg); } }
.ag-caja {
  --rx: 0deg; --ry: 0deg;
  position: relative; max-height: calc(100dvh - 68px); overflow: auto; overscroll-behavior: contain;
  padding: 20px; border-radius: 18px; border: 1px solid var(--ag-borde); background: var(--sheet);
  box-shadow: 0 40px 70px -35px rgba(24, 48, 192, .55);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.agenda[open] .ag-caja { animation: ag-entra .55s cubic-bezier(.16,1,.3,1); }
@keyframes ag-entra { from { opacity: 0; transform: translateY(24px); } }
.ag-brillo {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--bx, -300px) var(--by, -300px), rgba(34, 64, 242, .12), transparent 70%);
}
.ag-cerrar {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 12px;
  font-size: 16px; color: var(--ink-2); background: none; border: 0; cursor: pointer;
}
.ag-cerrar:hover { color: var(--cobalt); background: var(--ag-suave); }
.ag-kicker { position: relative; margin: 0 40px 12px 0; font: 500 11px/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cobalt); }
.ag-cuerpo { position: relative; }

/* cabecera */
.ag-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ag-titulo { margin: 0; font: 700 21px/1.15 var(--font-display); letter-spacing: -.02em; }
.ag-rango { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-3); }
.ag-flechas { display: flex; gap: 6px; }
.ag-flecha {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 1px solid var(--ag-borde); color: var(--ink); transition: transform .2s, background .2s;
}
.ag-flecha svg, .ag-zona svg, .ag-falta svg, .ag-confirmar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ag-flecha:hover:not(:disabled) { background: var(--ag-suave); transform: translateY(-2px); }
.ag-flecha:active:not(:disabled) { transform: scale(.88); }
.ag-flecha:disabled { opacity: .4; cursor: default; }
.ag-aviso { margin: 0 0 12px; padding: 9px 12px; font-size: 13.5px; border-radius: 10px; background: #fff3ef; color: var(--signal); }

/* la píldora líquida */
/* ocupa toda la zona: con un filtro SVG, lo que se sale de la caja del elemento se recorta (a 0×0 no se veía nada) */
.ag-liquido { position: absolute; inset: -12px; pointer-events: none; filter: url(#ag-goo); opacity: 0; transition: opacity .25s; }
.ag-liquido.ver { opacity: 1; }
.ag-mancha {
  position: absolute; left: 0; top: 0; width: var(--ag-w, 10px); height: var(--ag-h, 10px); border-radius: var(--ag-radio, 12px);
  background: var(--ag-degradado); box-shadow: 0 8px 24px -6px rgba(34, 64, 242, .8);
  transform: translate(calc(var(--ag-x, 0px) + 12px), calc(var(--ag-y, 0px) + 12px));
}
.ag-mancha--a { transition: transform .38s cubic-bezier(.34,1.56,.64,1), width .3s, height .3s; }
.ag-mancha--b { transition: transform .75s cubic-bezier(.34,1.45,.64,1), width .5s, height .5s; scale: .92; }

/* la semana */
.ag-tira-caja { overflow: hidden; margin: 0 -2px; padding: 0 2px; }
.ag-tira { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); touch-action: pan-y; }
.ag-tira.entra-der { animation: ag-tira-der .5s cubic-bezier(.34,1.45,.64,1); }
.ag-tira.entra-izq { animation: ag-tira-izq .5s cubic-bezier(.34,1.45,.64,1); }
@keyframes ag-tira-der { from { transform: translateX(60px); opacity: .3; } }
@keyframes ag-tira-izq { from { transform: translateX(-60px); opacity: .3; } }
.ag-dia {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 64px; min-width: 40px; border-radius: 14px; background: none; border: 0; cursor: pointer; color: var(--ink);
}
.ag-dia-sem { font: 500 11px var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); transition: color .2s; }
.ag-dia-num { font: 700 16px var(--font-body); font-variant-numeric: tabular-nums; transition: color .2s; }
.ag-puntos { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.ag-puntos i { width: 4px; height: 4px; border-radius: 50%; background: rgba(34, 64, 242, .6); }
.ag-dia.on .ag-dia-sem { color: rgba(255,255,255,.85); }
.ag-dia.on .ag-dia-num { color: #fff; }
.ag-dia.on .ag-puntos i { background: rgba(255,255,255,.85); }
.ag-dia.vacio { cursor: default; }
.ag-dia.vacio .ag-dia-num { color: var(--ink-3); opacity: .6; }
.ag-dia:focus-visible, .ag-hora:focus-visible, .ag-flecha:focus-visible, .ag-confirmar:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* las horas */
.ag-rejilla-caja { position: relative; margin-top: 16px; min-height: 13rem; }
.ag-rejilla { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ag-hora {
  position: relative; height: 44px; border-radius: 12px; cursor: pointer;
  font: 600 14px var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink);
  background: #fff; border: 1px solid var(--ag-borde);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), border-color .2s, color .2s, background .2s;
  animation: ag-hora .5s cubic-bezier(.34,1.45,.64,1) both; animation-delay: calc(var(--i, 0) * 30ms);
}
@keyframes ag-hora { from { opacity: 0; transform: translateY(16px) scale(.9) rotate(-3deg); } }
.ag-hora:nth-child(odd) { animation-name: ag-hora-b; }
@keyframes ag-hora-b { from { opacity: 0; transform: translateY(16px) scale(.9) rotate(3deg); } }
.ag-hora:hover { border-color: rgba(34, 64, 242, .6); transform: translateY(-2px) scale(1.04); }
.ag-hora:active { transform: scale(.92, .86); }
.ag-hora.on { background: transparent; border-color: transparent; color: #fff; }
.ag-nada { display: grid; place-items: center; height: 13rem; margin: 0; font-size: 14px; color: var(--ink-3); text-align: center; }
.ag-destello { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
.ag-destello i {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; filter: blur(1px);
  animation: ag-chispa .9s cubic-bezier(.1,.8,.3,1) forwards;
}
@keyframes ag-chispa { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* el pie */
.ag-pie { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ag-borde); }
.ag-zona { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--ink-3); }
.ag-zona svg { width: 14px; height: 14px; }
.ag-pie-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.ag-elegido { min-width: 0; font-size: 14px; }
.ag-elegido p { margin: 0; }
.ag-cuando { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cuando::first-letter { text-transform: uppercase; }
.ag-falta { display: flex; align-items: center; gap: 5px; margin-top: 2px !important; font-size: 12px; color: var(--ink-3); }
.ag-falta svg { width: 12px; height: 12px; }
.ag-sin { color: var(--ink-3); }
.ag-confirmar {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  font: 600 14px var(--font-body); color: #fff; background: var(--ag-degradado); border: 0;
  transition: transform .2s; animation: ag-late 2.4s ease-in-out infinite;
}
.ag-confirmar:hover:not(:disabled) { transform: translateY(-2px); }
.ag-confirmar:active:not(:disabled) { transform: scale(.94); }
.ag-confirmar:disabled { opacity: .45; cursor: default; animation: none; }
.ag-confirmar.ocupado svg { animation: ag-gira 1s linear infinite; }
@keyframes ag-late { 50% { box-shadow: 0 8px 30px -4px rgba(107, 123, 255, .75); } 0%, 100% { box-shadow: 0 8px 20px -8px rgba(34, 64, 242, .5); } }
@keyframes ag-gira { to { transform: rotate(360deg); } }

/* paso 2 y 3 */
.ag-resumen { margin: 6px 0 16px; font-size: 15px; }
.ag-resumen b { display: inline-block; }
.ag-resumen b::first-letter { text-transform: uppercase; }
.ag-resumen span { font: 12px var(--font-mono); color: var(--ink-3); }
.ag-resumen--grande { font-size: 18px; }
.ag-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag-form label { display: grid; gap: 6px; font: 500 12.5px/1.3 var(--font-body); color: var(--ink-2); }
.ag-form input, .ag-form textarea {
  width: 100%; padding: 11px 12px; font: 15px/1.4 var(--font-body); color: var(--ink);
  background: #fff; border: 1px solid var(--ag-borde); border-radius: 12px;
}
.ag-form input:focus, .ag-form textarea:focus { outline: 2px solid var(--cobalt); outline-offset: 0; border-color: transparent; }
.ag-form textarea { resize: vertical; min-height: 84px; }
.ag-ancho, .ag-consent, .ag-estado, .ag-botones { grid-column: 1 / -1; }
.ag-trampa { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ag-form .ag-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.ag-consent input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--cobalt); }
.ag-consent a, .ag-texto a { color: var(--cobalt); }
.ag-estado { margin: 0; font-size: 14px; color: var(--signal); }
.ag-botones { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.ag-volver { padding: 8px 0; font: 600 13.5px var(--font-body); color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.ag-volver:hover { color: var(--cobalt); }
.ag-texto { margin: 0 0 20px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

@media (max-width: 520px) {
  .agenda { width: 100vw; max-width: 100vw; padding: 8px; }
  .ag-caja { padding: 16px; max-height: calc(100dvh - 16px); }
  .ag-form { grid-template-columns: 1fr; }
  .ag-botones { flex-direction: column-reverse; align-items: stretch; }
  .ag-botones .ag-confirmar { justify-content: center; }
  .ag-dia { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-halo, .agenda[open] .ag-caja, .ag-hora, .ag-tira, .ag-confirmar { animation: none !important; }
  .ag-mancha, .ag-caja { transition: none !important; }
  .ag-liquido { filter: none; }
}
