/* ============ AGENDAR DEMO (/agendar) — estilos propios de la página ============
   Copia el lenguaje visual de la homepage: título serif Playfair con cursiva,
   badge con chip (.hero-badge de homepage.css), botones slate y acento cyan del
   tema shadcn. Funciona en claro y oscuro sin duplicar colores. */

.ag-main { max-width: 680px; margin: 0 auto; padding: 130px 24px 90px; position: relative; z-index: 1; }

/* Mismas líneas verticales sutiles del hero de la homepage, desvanecidas hacia abajo */
.ag-main::before { content: ''; position: absolute; inset: 0 50% auto; transform: translateX(-50%); width: 100vw; height: 460px; background: repeating-linear-gradient(90deg, rgba(20, 40, 48, 0.05) 0 1px, transparent 1px 46px); -webkit-mask-image: linear-gradient(180deg, black 40%, transparent); mask-image: linear-gradient(180deg, black 40%, transparent); pointer-events: none; z-index: -1; }
html.dark .ag-main::before { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 46px); }

.ag-top { text-align: center; }
.ag-badge { margin-bottom: 24px; }
.ag-h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2.1rem, 6.5vw, 3.6rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.08; margin: 0 0 18px; color: #262626; }
.ag-h1 em { font-style: italic; font-weight: 500; }
html.dark .ag-h1 { color: var(--foreground); }
.ag-lead { font-size: clamp(1rem, 2.2vw, 1.1rem); color: oklch(from var(--muted-foreground) calc(l * 0.8) c h); line-height: 1.6; max-width: 52ch; margin: 0 auto 40px; }

.ag-body { display: flex; flex-direction: column; gap: 14px; }
.ag-loading, .ag-error { text-align: center; color: var(--muted-foreground); padding: 40px 10px; font-size: 0.95rem; }
.ag-error p { margin-bottom: 20px; }
.ag-error .ag-btn { display: inline-flex; width: auto; }

/* ---- Acordeón ---- */
.ag-blk { border: 1px solid var(--border); border-radius: 16px; background: var(--card); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.ag-blk.open { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 20px 50px -30px var(--primary); }
.ag-blk.locked { opacity: 0.5; }
.ag-blk-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 20px; background: none; border: none; color: var(--foreground); font-family: inherit; text-align: left; cursor: pointer; }
.ag-blk-head:disabled { cursor: default; }
.ag-blk.done .ag-blk-head:hover { background: var(--muted); }
.ag-blk-num { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.82rem; font-weight: 700; color: var(--muted-foreground); background: var(--muted); border: 1px solid var(--border); }
.ag-blk.open .ag-blk-num { color: #fff; background: var(--primary); border-color: transparent; }
.ag-blk.done .ag-blk-num { color: var(--accent-foreground); background: var(--accent); border-color: transparent; }
.ag-blk-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ag-blk-title b { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.ag-blk-title small { color: var(--muted-foreground); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-blk-edit { color: var(--muted-foreground); font-size: 0.8rem; font-weight: 500; flex: none; }
.ag-blk.done .ag-blk-head:hover .ag-blk-edit { color: var(--primary); }
.ag-blk-body { padding: 4px 20px 22px; border-top: 1px solid var(--border); }
.ag-blk-body > .ag-form { padding-top: 18px; }

.ag-form { display: flex; flex-direction: column; gap: 22px; }
.ag-q { display: flex; flex-direction: column; gap: 10px; }
.ag-q > .ag-label { font-size: 0.88rem; font-weight: 600; color: var(--foreground); letter-spacing: -0.005em; }
.ag-q .ag-label small { font-weight: 400; color: var(--muted-foreground); margin-left: 6px; }
.ag-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.ag-input { width: 100%; background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; color: var(--foreground); font-size: 0.95rem; font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.ag-input::placeholder { color: var(--muted-foreground); opacity: 0.7; }
.ag-input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 20%, transparent); }
textarea.ag-input { resize: vertical; min-height: 96px; line-height: 1.55; }

/* Chips (opciones compactas) */
.ag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-chip { position: relative; display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font-size: 0.86rem; font-weight: 500; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; user-select: none; }
.ag-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ag-chip:hover { border-color: var(--muted-foreground); color: var(--foreground); }
.ag-chip:has(input:checked) { border-color: var(--primary); background: var(--accent); color: var(--accent-foreground); }
.ag-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent); }

/* Botones */
.ag-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
/* Mismo botón principal de la homepage (.btn-cta): slate en claro, cyan en oscuro */
.ag-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; border: none; border-radius: 999px; font-family: inherit; font-size: 0.95rem; font-weight: 600; color: #fff; cursor: pointer; background: #17272E; transition: all 0.2s ease; text-decoration: none; }
.ag-btn:hover { background: #22383f; transform: translateY(-1px); }
.ag-btn:active { transform: scale(0.99); }
.ag-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
html.dark .ag-btn { background: var(--primary); color: #0d1519; }
html.dark .ag-btn:hover { background: oklch(from var(--primary) calc(l + 0.05) c h); }
.ag-btn-ghost { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--muted-foreground); font-family: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer; padding: 8px 0; }
.ag-btn-ghost:hover { color: var(--primary); }
.ag-msg-error { color: #B91C1C; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); border-radius: 12px; padding: 11px 14px; font-size: 0.86rem; }
.dark .ag-msg-error { color: #FCA5A5; }
/* Error debajo del campo puntual que falta */
.ag-field-error { color: #B91C1C; font-size: 0.82rem; font-weight: 600; margin-top: 6px; line-height: 1.4; }
.dark .ag-field-error { color: #FCA5A5; }
.ag-input.is-error { border-color: rgba(220, 38, 38, 0.7); }
.ag-input.is-error:focus { border-color: rgba(220, 38, 38, 0.85); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14); }
.ag-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Bloque 3: calendario */
.ag-dias { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.ag-dia { flex: none; width: 68px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font-family: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: 0.15s; }
.ag-dia span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ag-dia b { font-size: 1.25rem; color: var(--foreground); font-weight: 700; letter-spacing: -0.02em; }
.ag-dia:hover { border-color: var(--muted-foreground); color: var(--foreground); }
.ag-dia.sel { background: var(--accent); border-color: var(--primary); color: var(--accent-foreground); }
.ag-dia.sel b { color: var(--accent-foreground); }
.ag-turnos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ag-turno { padding: 11px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); font-family: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: 0.15s; font-variant-numeric: tabular-nums; }
.ag-turno:hover { border-color: var(--primary); background: var(--accent); }
.ag-turno.sel { background: var(--primary); color: #fff; border-color: transparent; }
.ag-tz { color: var(--muted-foreground); font-size: 0.78rem; line-height: 1.5; }
.ag-tz a { color: var(--primary); text-decoration: none; }

/* Confirmación */
.ag-ok { text-align: center; padding: 8px 0; }
.ag-ok-ico { width: 60px; height: 60px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; font-weight: 900; color: #fff; background: var(--primary); box-shadow: 0 0 48px color-mix(in oklab, var(--primary) 40%, transparent); }
.ag-ok-cuando { font-size: 1.15rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.ag-ok p { color: var(--muted-foreground); font-size: 0.95rem; line-height: 1.6; margin-bottom: 22px; }
.ag-ok p b { color: var(--foreground); }
.ag-ok-links { display: flex; justify-content: center; gap: 24px; margin-top: 24px; flex-wrap: wrap; }
.ag-ok-links a { color: var(--muted-foreground); font-size: 0.88rem; text-decoration: none; }
.ag-ok-links a:hover { color: var(--primary); }

.ag-alt { margin-top: 40px; text-align: center; color: var(--muted-foreground); font-size: 0.88rem; }
.ag-alt a { color: var(--primary); text-decoration: none; font-weight: 600; }
.ag-alt a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .ag-main { padding-top: 110px; }
    .ag-row { grid-template-columns: 1fr; }
    .ag-turnos { grid-template-columns: repeat(3, 1fr); }
    .ag-blk-head { padding: 16px 16px; }
    .ag-blk-body { padding: 4px 16px 18px; }
    .ag-blk-edit { display: none; }
    .ag-actions .ag-btn { width: 100%; }
}
