/* ==========================================================================
   Barber SaaS — base compartida (landing, plataforma y reservas)
   Tokens de marca, reset y componentes comunes.
   ========================================================================== */

:root {
  /* ---- Marca: la barbería de noche ---- */
  --negro: #0c0b0b;          /* fondo base, negro navaja */
  --carbon: #141313;         /* superficie */
  --grafito: #1c1a1a;        /* superficie 2 */
  --grafito-2: #252222;      /* superficie 3 / hover */
  --linea: rgba(255, 255, 255, 0.08);
  --linea-2: rgba(255, 255, 255, 0.14);
  --espuma: #f5f1ea;         /* texto sobre oscuro · fondo claro (espuma de afeitar) */
  --espuma-2: #ebe5db;
  --humo: #a8a29e;           /* texto secundario sobre oscuro */
  --humo-2: #7c7672;         /* texto terciario sobre oscuro */
  --tinta: #141212;          /* texto sobre claro */
  --tinta-2: #57524e;        /* texto secundario sobre claro */

  --neon: #ff4b2b;           /* acento: rojo poste de barbero */
  --neon-2: #ff6a4d;
  --neon-tinta: #c42d0e;     /* el acento cuando va como texto sobre claro */
  --neon-suave: rgba(255, 75, 43, 0.14);

  /* ---- Estados (siempre con ícono + texto, nunca solo color) ---- */
  --ok: #3ddc97;
  --ok-suave: rgba(61, 220, 151, 0.13);
  --alerta: #ffb547;
  --alerta-suave: rgba(255, 181, 71, 0.14);
  --error: #ff5a4e;
  --error-suave: rgba(255, 90, 78, 0.13);
  --info: #7aa2ff;
  --info-suave: rgba(122, 162, 255, 0.14);

  /* ---- Chat ---- */
  --chat-fondo: #0f0e0e;
  --chat-entrante: #222020;
  --chat-saliente: #1d5640;

  /* ---- Forma ---- */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --sombra: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --sombra-flota: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* ---- Tipografía ---- */
  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-rebote: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: dark;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--espuma);
  background: var(--negro);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--neon); color: var(--negro); }

[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--f-mono); }
.num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   El poste: rayas diagonales de barbero. Firma visual de la marca.
   Se usa en el logo, en barras de progreso y para "automatización corriendo".
   ========================================================================== */
.poste {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--neon) 0 7px,
    var(--espuma) 7px 14px
  );
  background-size: 19.8px 19.8px; /* 14px * √2 para que el loop sea continuo */
  animation: poste-gira 1.1s linear infinite;
  animation-play-state: paused;
}
.poste.is-on, .is-on > .poste { animation-play-state: running; }
@keyframes poste-gira { to { background-position: 19.8px 0; } }

/* ---- Logo ---- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 20px; letter-spacing: -0.02em; line-height: 1; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grafito);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--linea-2); flex: none;
}
.logo-mark .poste { width: 12px; height: 24px; border-radius: 99px; box-shadow: 0 0 0 2px var(--negro), 0 0 14px rgba(255, 75, 43, 0.45); }
.logo:hover .poste { animation-play-state: running; }
.logo b { font-weight: 800; }
.logo span { font-weight: 300; color: var(--humo); margin-left: 1px; }

/* ---- Botones ---- */
.btn {
  --b-bg: var(--neon); --b-fg: #170805;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.2s;
  box-shadow: 0 10px 30px -10px rgba(255, 75, 43, 0.55);
}
.btn:hover { background: var(--neon-2); transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(255, 75, 43, 0.65); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg.flecha { transform: translateX(3px); }
.btn--ghost { --b-bg: transparent; --b-fg: var(--espuma); box-shadow: inset 0 0 0 1px var(--linea-2); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.btn--claro { --b-bg: var(--espuma); --b-fg: var(--tinta); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); }
.btn--claro:hover { background: #fff; }
.btn--suave { --b-bg: rgba(255, 255, 255, 0.07); --b-fg: var(--espuma); box-shadow: none; }
.btn--suave:hover { background: rgba(255, 255, 255, 0.12); box-shadow: none; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; gap: 7px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---- Eyebrow / etiquetas ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--humo);
}
.eyebrow .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 0 4px var(--neon-suave); animation: late 2s var(--ease) infinite; }
@keyframes late { 50% { box-shadow: 0 0 0 7px rgba(255, 75, 43, 0); } }

/* ---- Estados (chips) ---- */
.estado {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1;
  background: rgba(255, 255, 255, 0.07); color: var(--espuma);
}
.estado svg { width: 13px; height: 13px; flex: none; }
.estado--ok { background: var(--ok-suave); color: #8ff0c4; }
.estado--alerta { background: var(--alerta-suave); color: #ffd28c; }
.estado--error { background: var(--error-suave); color: #ffa39b; }
.estado--info { background: var(--info-suave); color: #b4caff; }
.estado--neon { background: var(--neon-suave); color: #ffab99; }
.estado--neutro { background: rgba(255, 255, 255, 0.07); color: var(--humo); }

/* ==========================================================================
   Chat estilo WhatsApp (vista del cliente)
   ========================================================================== */
.chat { background: var(--chat-fondo); display: flex; flex-direction: column; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #171515; border-bottom: 1px solid var(--linea);
}
.chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--grafito-2); box-shadow: inset 0 0 0 1px var(--linea-2);
}
.chat-avatar .poste { width: 9px; height: 18px; border-radius: 99px; }
.chat-head b { display: block; font-size: 14px; font-weight: 600; line-height: 1.2; }
.chat-head small { display: block; font-size: 11.5px; color: var(--ok); line-height: 1.3; }
.chat-body {
  flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
}
.msg {
  max-width: 84%; padding: 7px 10px 6px; border-radius: 12px; font-size: 13.5px; line-height: 1.38;
  position: relative; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg--in { align-self: flex-start; background: var(--chat-entrante); border-top-left-radius: 4px; }
.msg--out { align-self: flex-end; background: var(--chat-saliente); border-top-right-radius: 4px; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 10.5px; color: rgba(245, 241, 234, 0.55); }
.msg-meta svg { width: 14px; height: 14px; color: #6fd3ff; }
.msg-auto { display: flex; width: fit-content; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--neon-2); margin-bottom: 3px; }
.msg-auto svg { width: 11px; height: 11px; }
.msg-dia { align-self: center; font-size: 11px; color: var(--humo); background: #1a1818; padding: 3px 10px; border-radius: 8px; margin: 4px 0; }
.msg-boton {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 8px 10px;
  border-radius: 9px; background: rgba(255, 255, 255, 0.06); color: #8fd9ff; font-weight: 600; font-size: 13px;
}
.msg-pago {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 4px 0;
  padding: 6px 12px; border-radius: 999px; background: var(--ok-suave); color: #8ff0c4; font-size: 12px; font-weight: 600;
}
.msg-pago svg { width: 14px; height: 14px; }
.escribiendo { align-self: flex-start; background: var(--chat-entrante); border-radius: 12px; border-top-left-radius: 4px; padding: 10px 12px; display: inline-flex; gap: 4px; }
.escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: var(--humo); animation: tecleo 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: 0.15s; }
.escribiendo i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tecleo { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---- Teléfono (marco) ---- */
.telefono {
  position: relative; width: 300px; border-radius: 42px; padding: 10px;
  background: linear-gradient(160deg, #2a2626, #121010 40%, #1d1a1a);
  box-shadow: var(--sombra-flota), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.telefono-pantalla { border-radius: 33px; overflow: hidden; height: 600px; display: flex; flex-direction: column; background: var(--chat-fondo); position: relative; }
.telefono-isla { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 3; }
.telefono-barra { height: 44px; flex: none; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 26px 6px; font-size: 12px; font-weight: 600; background: #171515; }

/* ---- Toast ---- */
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 12px 12px;
  border-radius: 16px; background: rgba(30, 28, 28, 0.92); box-shadow: var(--sombra-flota);
  animation: toast-entra 0.45s var(--ease-rebote) both;
}
@supports (backdrop-filter: blur(12px)) { .toast { background: rgba(30, 28, 28, 0.78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); } }
.toast.is-saliendo { animation: toast-sale 0.3s var(--ease) both; }
.toast-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--neon-suave); color: var(--neon-2); }
.toast-ico svg { width: 18px; height: 18px; }
.toast-ico--ok { background: var(--ok-suave); color: var(--ok); }
.toast-ico--alerta { background: var(--alerta-suave); color: var(--alerta); }
.toast-ico--info { background: var(--info-suave); color: var(--info); }
.toast small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--humo); margin-bottom: 2px; }
.toast p { font-size: 13.5px; line-height: 1.4; }
.toast p b { font-weight: 600; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-sale { to { opacity: 0; transform: translateX(30px); } }

/* ---- Interruptor ---- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--grafito-2); box-shadow: inset 0 0 0 1px var(--linea-2); transition: background 0.25s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--humo); transition: transform 0.3s var(--ease-rebote), background 0.25s; }
.switch input:checked + span { background: var(--neon); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--neon); outline-offset: 3px; }

/* ---- Avatar con iniciales ---- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--espuma);
  background: linear-gradient(145deg, #3a3434, #221f1f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }

/* Movimiento: solo se apaga lo intrusivo (regla Windows de la skill) */
@media (prefers-reduced-motion: reduce) {
  .eyebrow .punto { animation: none; }
}
