/* Marca Demencia (Manual de Marca 2026, Efyra Studio):
   café #270f0d (fondo principal) · vino #733635 (fondo) · grafito #1f1f1f · beige #ececdc (texto/logo)
   hueso #f5f4ed · terracota #cd664b (atención). Tipografía: Montserrat (títulos Bold, textos Regular).
   El logotipo y el isotipo son vectores (public/brand/*.svg). */

@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url(fonts/montserrat-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format('woff2'); }

:root {
  --fondo: #270f0d;
  --vino: #733635;
  --grafito: #1f1f1f;
  --beige: #ececdc;
  --hueso: #f5f4ed;
  --terracota: #cd664b;

  --bg: var(--hueso);
  --card: #fffefa;
  --ink: var(--grafito);
  --muted: #6b615c;
  --line: #dcd8c6;          /* beige oscurecido */
  --brand: var(--vino);
  --brand-ink: var(--beige);
  --accent: var(--vino);
  --focus: var(--terracota);
  --ok-bg: #ececdc;
  --ok-ink: #4f2422;
  --err-bg: #f8e3dc;
  --err-ink: #9c3a22;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--fondo);
    --card: #351714;
    --ink: var(--beige);
    --muted: #bcaea3;
    --line: #4d2723;
    --brand: var(--terracota);
    --brand-ink: var(--fondo);
    --accent: var(--terracota);
    --focus: var(--beige);
    --ok-bg: #3f1d19;
    --ok-ink: var(--beige);
    --err-bg: #4a1c13;
    --err-ink: #f2a993;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.45 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[hidden] { display: none !important; }

/* ---------- Encabezado: barra café con isotipo ---------- */
.barra {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--fondo); color: var(--beige);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca img { height: 18px; width: auto; display: block; }
.marca-sep { width: 1px; align-self: stretch; background: rgba(236, 236, 220, .35); }
.marca-app { font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.usuario { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.usuario .enlace { color: var(--beige); opacity: .8; }

main { max-width: 560px; margin: 0 auto; padding: 18px 16px 120px; }

/* ---------- Login / estados ---------- */
.vista.centro { text-align: center; padding-top: 7vh; }
.logo-login { width: min(300px, 80%); height: auto; margin: 0 auto 28px; display: block; }
.logo-login.claro { display: none; }
@media (prefers-color-scheme: dark) { .logo-login.oscuro { display: none; } .logo-login.claro { display: block; } }
h1 {
  font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  margin: 0 0 6px;
}
.sub, .nota { color: var(--muted); }
.sub { font-size: 14px; margin: 0; }
.nota { font-size: 14px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
}
.btn-google { margin-top: 28px; background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn-pri {
  width: 100%; background: var(--brand); color: var(--brand-ink);
  font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
}
.btn-pri:disabled { opacity: .6; cursor: progress; }
.btn-sec { margin-top: 16px; background: transparent; color: var(--ink); border-color: var(--ink); }
.enlace { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 4px; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.tab {
  flex: 1; min-height: 42px; border: 0; background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.tab + .tab { border-left: 1.5px solid var(--ink); }
.tab.activa { background: var(--ink); color: var(--bg); }

/* ---------- Campos ---------- */
.campo { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.campo > label, .campo > legend {
  display: block; padding: 0; margin-bottom: 8px;
  font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.opc { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 13px; }
input:not([type=radio]), textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 16px; /* evita zoom en iOS */
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terracota) 35%, transparent); }
.con-error input, .con-error textarea, .con-error .chip label { border-color: var(--err-ink); }
.error { color: var(--err-ink); font-size: 13px; font-weight: 600; margin: 6px 0 0; }

.fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 360px) { .fila2 { grid-template-columns: 1fr; } }

/* ---------- Chips (radio) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; user-select: none; font-weight: 600; font-size: 14px;
}
.chip input:checked + label { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.grupo-fecha + .grupo-fecha { margin-top: 12px; }
.grupo-titulo { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .14em; }

.stepper { display: flex; }
.stepper input { text-align: center; border-radius: 0; min-width: 0; font-weight: 700; }
.stepper button {
  width: 50px; flex: none; font-size: 22px; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); cursor: pointer; font-family: inherit;
}
.stepper button:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
.stepper button:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }

/* ---------- Botón fijo inferior ---------- */
.enviar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.enviar .btn { max-width: 528px; margin: 0 auto; display: flex; }

/* ---------- Avisos ---------- */
.aviso {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; margin-bottom: 20px;
  border-radius: var(--radius); border-left: 4px solid currentColor; scroll-margin-top: 80px; font-size: 14px;
}
.aviso strong { font-size: 15px; }
.aviso-ok { background: var(--ok-bg); color: var(--ok-ink); }
.aviso-error { background: var(--err-bg); color: var(--err-ink); }
.aviso-extra { font-size: 13px; }

/* ---------- Mis mesas ---------- */
.lista { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.item-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.item-sub { color: var(--muted); font-size: 13px; }
.pill { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 1px 10px; font-size: 12px; white-space: nowrap; }

.spinner {
  width: 32px; height: 32px; margin: 24px auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: gira .8s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Páginas de texto (privacidad) ---------- */
a.marca { color: inherit; text-decoration: none; }
.texto-legal { padding-bottom: 48px; }
.texto-legal h1 { margin-top: 8px; }
.texto-legal h2 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 28px 0 6px; color: var(--brand); }
.texto-legal p { margin: 0 0 10px; }
.texto-legal a { color: var(--brand); font-weight: 600; }
.pie { margin-top: 40px; } .pie a { color: var(--muted); }

.stepper-corto { max-width: 220px; }
.chips-hora { display: grid; grid-template-columns: repeat(4, 1fr); }
.chips-hora .chip label { justify-content: center; width: 100%; padding: 0 6px; }

.pill-error { background: var(--err-ink); color: #fff; }

.item-acciones { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-eliminar {
  background: none; border: 1.5px solid var(--err-ink); color: var(--err-ink); border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 14px; cursor: pointer;
}
.btn-eliminar:disabled { opacity: .5; cursor: progress; }

.item-acciones { gap: 8px; }
.btn-accion {
  background: none; border: 1.5px solid var(--brand); color: var(--brand); border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 14px; cursor: pointer;
}
.editor-hora { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-hora .chips-hora { margin-top: 6px; }
.editor-botones { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; }
.btn-chico { width: auto; min-height: 40px; padding: 0 20px; font-size: 12px; }

.editor-sub { margin-top: 14px; }
.editor-hora .stepper { margin-top: 6px; }
