/* ════════════════════════════════════════════════════════════════
   conmotivo.css — base de marca Con Motivo para Motivo ID
   Portado del sistema canónico de motivo-landing (styles/conmotivo.css).
   Regla de oro del workspace: copiado, no importado. A partir de aquí
   evoluciona independiente en este repo.

   Contiene: @font-face (auto-hospedadas, CSP-safe), tokens :root,
   reset base, wordmark/isotipo, botones, .cm-cta, eyebrow, pill,
   primitivas de formulario (auth) y utilidades compartidas.

   Tipografía: Manrope (display + body) + JetBrains Mono (datos/labels).
   Color alma: cobalt --signal #0061ff. Énfasis: <em> → italic + signal.
   ════════════════════════════════════════════════════════════════ */

/* ── FUENTES auto-hospedadas (sin CDNs — CSP default-src 'self') ── */
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}
/* Manrope no trae itálica real: el navegador la sintetiza (oblicua).
   El énfasis de marca (<em> cobalt) lo aprovecha sin necesitar archivo. */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ── TOKENS ── */
:root {
  /* Tints — warm-white system */
  --ink:        #14181f;
  --ink-mid:    #2a2f38;
  --ink-soft:   #4a525e;
  --steel:      #6b7785;
  --slate:      #94a0ad;
  --fog:        #d8dde3;
  --line:       #ebeef2;
  --line-soft:  #f1f3f6;

  --paper:      #fafaf9;
  --paper-warm: #f7f4ee;
  --paper-cool: #f4f6f8;
  --canvas:     #ffffff;

  /* Accent — cobalt signal, el alma de la marca */
  --signal:     #0061ff;
  --signal-mid: #2d7cff;
  --signal-pale:#e7efff;
  --signal-bg:  #f3f7ff;
  --signal-ink: #0042b0;

  /* Warm gold (punto del logo, uso muy limitado) */
  --gold:       #b8801c;
  --gold-light: #f0b429;
  --gold-pale:  #fdf5e0;

  /* Sage (éxito / trial) */
  --sage:       #4f7d5a;
  --sage-pale:  #ecf3ee;
  --success:    #1f9d57;

  --danger:     #c0392b;
  --danger-soft:#fcecec;

  /* Navy del hero inmersivo */
  --ink-dark:   #0b1020;

  /* Fuentes */
  --f-sans: 'Manrope', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii */
  --r:   10px;
  --rl:  16px;
  --rxl: 22px;
  --rxxl:32px;

  /* Radio de los CONTROLES (botones, inputs, chips).
     Cuadrado de bordes redondeados, NO píldora: es la forma que adoptó la
     landing en su migración a Next (components/ui/boton.tsx → `rounded-xl`,
     decisión de Álvaro 2026-07-16). Aquí se replica para que acceso y landing
     se lean como el mismo producto. Copiado, no importado (regla de oro).
     Si vuelve a cambiar allí, se cambia AQUÍ este único valor. */
  --r-ui: 12px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Focus ring cobalt */
  --focus-ring: 0 0 0 3px rgba(0, 97, 255, 0.30);

  /* Z-index */
  --z-sticky:  50;
  --z-overlay: 100;
  --z-modal:   200;
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* El atributo `hidden` solo aplica display:none a nivel UA: cualquier regla de
   autor con `display` (.auth-form, .auth-links...) lo pisa. Con CSP style-src
   'self' no hay inline styles, así que `hidden` ES el mecanismo de ocultar
   de esta app y tiene que ganar siempre. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { max-width: 100%; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--signal); color: #fff; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── LOGO · wordmark 'Con Motivo.' ──
   Con (500 normal) · Motivo (700 italic, cobalt en claro) · . (gold italic).
   Tres piezas, nunca se separan. */
.logo-wordmark {
  font-family: var(--f-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.16em;
  color: var(--ink);
  line-height: 1;
}
.lw-con    { font-style: normal; font-weight: 500; }
.lw-motivo { font-style: italic; font-weight: 700; color: var(--signal); }
.lw-dot    { color: var(--gold); font-style: italic; font-weight: 700; margin-left: -0.04em; }
/* Sobre fondo oscuro: punto en blanco y Motivo en cobalt medio. */
.on-dark .logo-wordmark,
.logo-wordmark.on-dark { color: var(--canvas); }
.on-dark .lw-motivo,
.logo-wordmark.on-dark .lw-motivo { color: var(--signal-mid); }
.on-dark .lw-dot,
.logo-wordmark.on-dark .lw-dot { color: var(--gold-light); }

/* ── ISOTIPO 'M.' (spots compactos: favicon-like, cards auxiliares) ── */
.mark {
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  line-height: 1;
}
.mark-m   { font-style: italic; color: var(--signal); }
.mark-dot { color: var(--gold); font-weight: 800; }
.on-dark .mark { color: var(--canvas); }
.on-dark .mark-m { color: var(--signal-mid); }
.on-dark .mark-dot { color: var(--gold-light); }

/* ── BOTONES ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--r-ui);
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-signal { background: var(--signal); color: var(--canvas); }
.btn-signal:hover { background: var(--signal-ink); transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(0,97,255,0.45); }
.btn-primary { background: var(--ink); color: var(--canvas); }
.btn-primary:hover { background: var(--signal); transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(0,97,255,0.30); }
.btn-ghost { background: var(--canvas); color: var(--ink); border-color: var(--fog); }
.btn-ghost:hover { background: var(--paper); border-color: var(--slate); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── .cm-cta · pills grandes (hero, cierres fuertes, sobre dark o paper) ── */
.cm-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--f-sans);
  font-weight: 600; font-size: 15px;
  padding: 15px 28px;
  border-radius: var(--r-ui);
  text-decoration: none;
  transition: transform .18s var(--ease-out), background .18s, box-shadow .18s;
  white-space: nowrap;
  cursor: pointer;
}
.cm-cta:hover { transform: translateY(-2px); }
.cm-cta.primary {
  background: var(--signal); color: #fff;
  box-shadow: 0 20px 44px -14px rgba(0,97,255,0.65), 0 8px 18px -8px rgba(0,97,255,0.4);
}
.cm-cta.primary:hover {
  background: var(--signal-mid);
  box-shadow: 0 26px 52px -14px rgba(0,97,255,0.7), 0 10px 22px -8px rgba(0,97,255,0.45);
}
.cm-cta.light {
  background: #fff; color: var(--ink);
  box-shadow: 0 18px 36px -14px rgba(0,0,0,0.45), 0 4px 10px -4px rgba(0,0,0,0.25);
}
.cm-cta.light:hover { background: #eef1f5; }

/* ── EYEBROW (label JetBrains Mono) ── */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--signal); }

/* ── PILL / BADGE ── */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  background: var(--signal-bg);
  border: 1px solid var(--signal-pale);
  padding: 6px 12px;
  border-radius: 100px;
  font-weight: 600;
}
.pill.gold  { color: var(--gold); background: var(--gold-pale); border-color: #efe0b8; }
.pill.sage  { color: var(--sage); background: var(--sage-pale); border-color: #c8dccf; }
.pill.soon  { color: var(--steel); background: var(--paper-cool); border-color: var(--line); }

/* ── FORM PRIMITIVES (compartidas acceso + hub) ── */
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form > label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.auth-form input[type="email"],
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="search"] {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--fog);
  border-radius: var(--r-ui);
  padding: 13px 15px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input::placeholder { color: var(--slate); font-weight: 400; }
.auth-form input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(0,97,255,0.14);
}

/* Campo contraseña con toggle ver/ocultar */
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--steel); border-radius: 8px;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper); }
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle .icon-off { display: none; }
.pw-field.showing .pw-toggle .icon-on  { display: none; }
.pw-field.showing .pw-toggle .icon-off { display: inline; }

/* Check de términos */
.auth-check-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  line-height: 1.45;
}
.auth-check-row input[type="checkbox"] {
  margin-top: 2px;
  width: 17px; height: 17px;
  accent-color: var(--signal);
  flex-shrink: 0;
}
.auth-check-row a { color: var(--signal); font-weight: 600; }
.auth-check-row a:hover { text-decoration: underline; }

/* Botón de envío del form.
   Espejo de la variante `primary` de la landing (button-primary del sistema de
   marca): NEGRO en reposo y cobalt al pasar por encima. Elección de Álvaro
   2026-07-18 — con el botón de Google en dorado justo encima, un primario
   cobalt metía un tercer color fuerte en 400px de card; el negro deja que
   manden el dorado y el propio contenido. El cobalt no se pierde: sigue siendo
   el color de la acción, solo que aparece al interactuar.
   Y el hundimiento de 1px al pulsar (`active:translate-y-px` en la landing). */
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 14px 22px;
  border-radius: var(--r-ui);
  background: var(--ink);
  color: #fff;
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 16px rgba(20, 24, 31, 0.22);
  transition: background .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.auth-btn:hover { background: var(--signal); box-shadow: 0 4px 24px rgba(0, 97, 255, 0.42); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Mensajes */
.auth-error {
  font-size: 13px; font-weight: 500; color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--r);
  padding: 10px 13px;
}
.auth-ok {
  font-size: 13px; font-weight: 500; color: var(--sage);
  background: var(--sage-pale);
  border-radius: var(--r);
  padding: 10px 13px;
}

/* Links bajo el form */
.auth-links {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px;
  font-size: 13.5px;
}
.auth-links a, .auth-mode-toggle {
  color: var(--ink-soft); font-weight: 600;
  transition: color .15s;
}
.auth-links a:hover, .auth-mode-toggle:hover { color: var(--signal); }

/* ── REVEAL (scroll-in suave) ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
