/*
 * Marikaf AI — sistema visual común (login, portal del cliente y panel).
 * Oscuro y amarillo, como marikafai.com. Sin estilos inline: la CSP no los deja.
 */

:root {
  --bg: #090909;
  --bg-2: #0d0d0d;
  --surface: #121212;
  --surface-2: #181818;
  --surface-3: #202020;
  --fg: #f5f5f4;
  --fg-2: #c9c9c6;
  --muted: #262626;
  --muted-fg: #9a9a96;
  --faint: #5c5c59;
  --border: #232323;
  --border-2: #2f2f2f;
  --accent: #f2b10d;
  --accent-hi: #ffc53d;
  --accent-fg: #141006;
  --accent-soft: rgba(242, 177, 13, 0.1);
  --accent-line: rgba(242, 177, 13, 0.35);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.1);
  --warning: #fb923c;
  --destructive: #f87171;
  --info: #7cb4ff;

  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 9999px;
  --topbar-h: 64px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
/* hidden siempre oculta, aunque el componente tenga su propio display. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
::selection { background: var(--accent); color: var(--accent-fg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }

/* Un toque editorial: «Diagnóstico Inicial». */
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.acento { color: var(--accent); }

/* ---------- Marca ---------- */

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--fg);
  min-width: 0;
}
.marca-logo { width: 38px; height: 38px; flex: none; display: block; filter: drop-shadow(0 4px 14px rgba(242, 177, 13, 0.25)); }
.marca-texto { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.marca-texto b { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.02em; }
.marca-texto small { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-fg); }
.marca-sello {
  margin-left: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}

/* ---------- Barra superior ---------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: rgba(9, 9, 9, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-bar-inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ---------- Botones ---------- */

.submit-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.submit-btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px -12px rgba(242, 177, 13, 0.55);
}
.submit-btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.submit-btn:active { transform: translateY(1px); }
.submit-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.ghost-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-2);
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.flecha { transition: transform 0.2s var(--ease); }
.submit-btn:hover .flecha, .ghost-btn:hover .flecha { transform: translateX(3px); }

/* ---------- Rejilla de puntos (fondo interactivo) ---------- */

.dot-grid { position: absolute; inset: 0; overflow: hidden; }
.dot-grid__wrap { position: absolute; inset: 0; }
.dot-grid__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

/* ---------- Cabecera del portal ---------- */

.hero-band {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(120% 140% at 50% 0%, #15120a 0%, var(--bg) 60%);
}
.hero-band::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 9, 9, 0) 40%, var(--bg) 100%), radial-gradient(60% 80% at 50% 40%, rgba(9, 9, 9, 0) 0%, rgba(9, 9, 9, 0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 84px) clamp(16px, 3vw, 32px) clamp(40px, 6vw, 64px);
  pointer-events: none;
}
.hero-content > * { pointer-events: auto; }
.onboarding-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  padding: 0.42rem 0.85rem;
  backdrop-filter: blur(6px);
}
.onboarding-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero-band h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin: 1.1rem 0 0.9rem;
}
.hero-band h1 .serif { font-size: 1.08em; color: var(--accent); }
.hero-sub { max-width: 60ch; margin: 0; color: var(--muted-fg); font-size: 1.02rem; line-height: 1.6; }

/* ---------- Aviso «Entrar como» ---------- */

.suplantacion {
  position: sticky;
  top: var(--topbar-h);
  z-index: 25;
  background:
    repeating-linear-gradient(-45deg, rgba(20, 16, 6, 0.12) 0 12px, rgba(20, 16, 6, 0) 12px 24px),
    var(--accent);
  color: var(--accent-fg);
}
.suplantacion-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.6rem clamp(16px, 3vw, 32px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  font-size: 0.86rem;
}
.suplantacion-inner b { font-weight: 800; }
.suplantacion-inner span { opacity: 0.8; }
.suplantacion button {
  margin-left: auto;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-fg);
  border: 0;
  border-radius: var(--r-pill);
  padding: 0.45rem 0.95rem;
  cursor: pointer;
}

/* ---------- Carga ---------- */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.4s var(--ease);
}
.page-loader.loader-hidden { opacity: 0; pointer-events: none; }
.loader-logo { width: 56px; height: 56px; animation: latido 1.4s var(--ease) infinite; }
@keyframes latido { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.92); opacity: 0.7; } }

/* ---------- Aparición escalonada ---------- */

.aparece { opacity: 0; transform: translateY(14px); animation: aparecer 0.8s var(--ease) forwards; }
.aparece.d1 { animation-delay: 0.08s; }
.aparece.d2 { animation-delay: 0.16s; }
.aparece.d3 { animation-delay: 0.24s; }
.aparece.d4 { animation-delay: 0.32s; }
.aparece.d5 { animation-delay: 0.4s; }
@keyframes aparecer { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .aparece { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 56px; }
  .marca-logo { width: 32px; height: 32px; }
  .marca-texto small { display: none; }
  .marca-sello { display: none; }
}

/* ---------- Pie legal ---------- */
.pie-legal { margin: 0; padding: 1.6rem 16px 2.2rem; text-align: center; font-size: 0.76rem; color: var(--faint); }
.pie-legal a { color: var(--muted-fg); text-decoration: none; }
.pie-legal a:hover { color: var(--accent); }
