/* Llantería Campos · Citas — estilos */

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --ink: #16181d;
  --ink-2: #3a3d45;
  --muted: #6b6f78;
  --line: #e6e5e1;
  --line-2: #d6d4cf;
  --accent: #e8a33d;
  --accent-soft: #fbf1df;
  --ok: #2f7d4f;
  --ok-soft: #e7f3ec;
  --warn: #a8650b;
  --warn-soft: #fcf1de;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 4px 16px rgba(22, 24, 29, .05);
  --shadow-lg: 0 10px 40px rgba(22, 24, 29, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.error { color: var(--bad); font-size: 14px; min-height: 0; margin: 6px 0; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #2a2d35; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.btn--sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--del { color: var(--bad); }
.btn--del:hover:not(:disabled) { border-color: #eab0aa; background: var(--bad-soft); }
.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245,245,243,.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar__actions { display: flex; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.brand__logo { width: 40px; height: auto; display: block; }
.brand__sub { color: var(--muted); font-weight: 500; margin-left: 4px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- Portada ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: center; padding: 16px 0 40px; }
.hero__logo { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 12px 28px rgba(22,24,29,.16)); animation: logoIn .6s var(--ease); }
@keyframes logoIn { from { opacity: 0; transform: scale(.94) rotate(-2deg); } }
.hero__text h1 { font-size: 36px; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 12px; }
.hero__text .muted { font-size: 17px; }
.hero__facts { display: grid; gap: 8px; margin: 20px 0 24px; color: var(--ink-2); }
.hero__facts li { display: flex; align-items: center; gap: 10px; }
.hero__facts .ico { color: var(--ok); }

/* ---------- Agendar ---------- */
.booking { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; scroll-margin-top: 80px; }
.booking__head { margin-bottom: 22px; }
.booking__head h2 { font-size: 26px; letter-spacing: -.02em; }
.step { padding: 18px 0; border-top: 1px solid var(--line); }
.step h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 12px; }
.step__n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.step__hint { font-size: 14px; margin: -4px 0 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.day {
  flex: none; width: 74px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; justify-items: center; gap: 2px; position: relative; transition: background .15s, border-color .15s, color .15s;
}
.day:hover { border-color: var(--ink); }
.day.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.day__wd { font-size: 12px; text-transform: capitalize; color: var(--muted); }
.day.is-active .day__wd, .day.is-active .day__m { color: rgba(255,255,255,.75); }
.day__n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.day__m { font-size: 12px; color: var(--muted); }
.day--closed { opacity: .55; }
.day__badge { font-size: 12px; font-weight: 700; background: var(--accent); color: var(--ink); border-radius: 999px; padding: 0 8px; }

.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.slot {
  height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  transition: background .15s, border-color .15s, color .15s;
}
.slot:hover:not(:disabled) { border-color: var(--ink); }
.slot.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.slot.is-off { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; }
.slot small { font-size: 11px; font-weight: 500; color: var(--muted); }
.slots__loading { grid-column: 1 / -1; color: var(--muted); padding: 10px 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input { height: 48px; padding: 0 14px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,24,29,.08); }
.pass { position: relative; display: block; }
.pass .input { padding-right: 84px; }
.pass__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin: 4px 0 12px; }
.summary strong { font-size: 16px; }
.step--form .btn--block { margin-top: 6px; }
.step--form .small { margin-top: 10px; text-align: center; }

.done { text-align: center; padding: 20px 0 8px; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.done__check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.done__check svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { font-size: 26px; letter-spacing: -.02em; }
.done__code { font-size: 40px; font-weight: 800; letter-spacing: .08em; margin: 12px 0 18px; font-variant-numeric: tabular-nums; }
.done__details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; text-align: left; margin-bottom: 18px; }
.done__details div { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.done__details small { display: block; color: var(--muted); font-size: 12px; }
.done .btn--block + .btn--block { margin-top: 8px; }
.done .small { margin-top: 14px; }

/* ---------- Información ---------- */
.info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.info__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.info__card h3 { font-size: 15px; margin-bottom: 8px; }
.info__card li { padding: 3px 0; color: var(--ink-2); }
.info__card li::before { content: "•"; color: var(--accent); margin-right: 8px; }
.foot { max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; max-width: 380px; animation: toastIn .35s var(--ease); pointer-events: auto; }
.toast--bad { background: var(--bad); }
.toast.is-leaving { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Panel del dueño ---------- */
.screen--login { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 32px 16px; }
.login { width: 100%; max-width: 400px; text-align: center; display: grid; gap: 10px; }
.login__logo { width: min(240px, 70vw); height: auto; margin: 0 auto 8px; }
.login h1 { font-size: 24px; letter-spacing: -.02em; }
.login .field { text-align: left; margin-top: 8px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 28px; letter-spacing: -.02em; line-height: 1.2; }
.daynav { display: flex; gap: 8px; }
.daynav .btn { min-width: 44px; padding: 0 14px; font-size: 18px; }
.daynav #todayBtn { font-size: 15px; }
.days--admin { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.appts { display: grid; gap: 10px; }
.appt { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); animation: fadeUp .3s var(--ease) both; }
.appt--atendida { opacity: .75; }
.appt--cancelada { opacity: .6; background: var(--surface-2); }
.appt--cancelada .appt__name { text-decoration: line-through; }
.appt__time strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.1; }
.appt__time small { font-size: 12px; color: var(--muted); font-weight: 500; }
.appt__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.appt__name { font-size: 16px; }
.appt__svc { color: var(--ink-2); margin-top: 2px; }
.appt__notes { color: var(--muted); font-style: italic; margin-top: 2px; }
.appt__meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.appt__meta b { color: var(--ink); }
.appt__meta a { font-weight: 600; }
.appt__actions { display: flex; flex-direction: column; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--pendiente { background: var(--warn-soft); color: var(--warn); }
.badge--atendida { background: var(--ok-soft); color: var(--ok); }
.badge--cancelada { background: #eceae6; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 12px; padding-bottom: 28px; }
  .hero__logo { max-width: 300px; }
  .hero__facts { justify-items: center; }
  .hero__facts li { justify-content: center; }
  .slots { grid-template-columns: repeat(4, 1fr); }
  .info { grid-template-columns: 1fr; }
}

/* ---------- Celular ---------- */
@media (max-width: 680px) {
  .wrap { padding: 18px 16px 48px; }
  .topbar__inner { padding: 8px 16px; }
  .topbar .btn span, .brand__sub { display: none; }
  .topbar .btn--sm { width: 36px; padding: 0; }
  .topbar .btn--sm#seedBtn { width: auto; padding: 0 10px; font-size: 13px; }
  .hero__text h1 { font-size: 27px; }
  .hero__text .muted { font-size: 15px; }
  .hero .btn--lg { width: 100%; }
  .booking { padding: 18px 14px; border-radius: 16px; }
  .booking__head h2 { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .slots { grid-template-columns: repeat(3, 1fr); }
  .done__code { font-size: 34px; }
  .page-head { align-items: stretch; }
  .page-title { font-size: 24px; }
  .daynav { justify-content: stretch; }
  .daynav .btn { flex: 1; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 22px; }
  .appt { grid-template-columns: 70px 1fr; gap: 10px 12px; padding: 12px 14px; }
  .appt__time strong { font-size: 18px; }
  .appt__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .appt__actions .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; bottom: 16px; justify-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
