/* ============================================================
   BECAMA · Sistema visual "Operador"
   Dark cinematic · neon flame · grotesca con carácter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* — Tinta / fondos warm-black — */
  --ink-900: #0A0908;
  --ink-850: #0D0B0A;
  --ink-800: #110E0C;
  --ink-700: #17120F;
  --surface:   #15110E;
  --surface-2: #1B1511;
  --surface-3: #221A15;

  /* — Llama neón — */
  --flame:      #FF6A1F;
  --flame-2:    #FF8A3D;
  --flame-hi:   #FFB070;
  --ember:      #E5470A;
  --terra:      #C15A2E;
  --flame-grad: linear-gradient(135deg, #FF8A3D 0%, #FF6A1F 52%, #E5470A 100%);
  --flame-soft: rgba(255, 106, 31, 0.14);
  --flame-line: rgba(255, 106, 31, 0.32);

  /* — Texto — */
  --text:   #F6F1EA;
  --text-2: #B7ADA2;
  --text-3: #877E74;
  --text-4: #5C554E;

  /* — Líneas — */
  --line:        rgba(246, 241, 234, 0.09);
  --line-2:      rgba(246, 241, 234, 0.14);
  --line-strong: rgba(246, 241, 234, 0.22);

  --ok: #44C28A;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --glow-sm: 0 0 0 1px rgba(255,106,31,.30), 0 8px 24px -6px rgba(255,106,31,.40);
  --glow:    0 0 0 1px rgba(255,106,31,.28), 0 16px 44px -10px rgba(255,106,31,.55);
  --shadow:  0 30px 70px -28px rgba(0,0,0,.85);
  --shadow-sm: 0 14px 34px -16px rgba(0,0,0,.8);

  --maxw: 1200px;

  --f-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --f-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Red de seguridad anti-scroll-horizontal en móvil (clip no rompe position:sticky) */
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--flame); color: #1a0d04; }

/* warm grain overlay — discreto, da textura cinematográfica */
.grain::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .035;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 700; margin: 0; letter-spacing: -0.02em; line-height: 1.04; }
p { margin: 0; }

.mono { font-family: var(--f-mono); }
.display { font-family: var(--f-display); }

/* ===== Layout ===== */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.wrap--wide { max-width: 1360px; }
@media (max-width: 640px){ .wrap { padding: 0 20px; } }

/* ===== Kicker / etiqueta mono ===== */
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--flame-2);
}
.kicker::before { content:""; width: 22px; height: 1px; background: var(--flame); box-shadow: 0 0 8px var(--flame); }
.kicker--plain::before { display: none; }

/* ===== Chip ===== */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: rgba(255,255,255,0.02);
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip--flame { border-color: var(--flame-line); color: var(--flame-2); background: var(--flame-soft); }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flame); box-shadow: 0 0 8px var(--flame); }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px;
  border: 1px solid transparent; border-radius: 12px;
  font-family: var(--f-display);
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .16s cubic-bezier(.2,.7,.2,1), box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn--flame {
  color: #200f04; background: var(--flame-grad);
  box-shadow: var(--glow-sm);
  position: relative; overflow: hidden;
}
.btn--flame::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,.45), transparent 45%);
  mix-blend-mode: soft-light; pointer-events: none;
}
.btn--flame:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.btn--ghost { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,0.02); }
.btn--ghost:hover { border-color: var(--flame-line); color: var(--flame-2); background: var(--flame-soft); transform: translateY(-2px); }
.btn--block { width: 100%; }
.btn--lg { padding: 18px 34px; font-size: 16.5px; }
.btn--sm { padding: 10px 16px; font-size: 13.5px; }
.btn:active { transform: translateY(0); }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(10,9,8,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__mark { height: 30px; width: auto; }
.brand__word { height: 19px; width: auto; }
.brand__sep { width: 1px; height: 22px; background: var(--line-2); }
.brand__app {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
}
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav__link {
  font-size: 14px; font-weight: 500; color: var(--text-2);
  padding: 9px 14px; border-radius: 999px;
  transition: color .15s, background .15s;
}
.topnav__link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.topnav__user {
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; margin-left: 6px; border-left: 1px solid var(--line-2);
  font-size: 13.5px; color: var(--text-2); font-weight: 500;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--flame-grad); color: #200f04;
  font-family: var(--f-display); font-weight: 700; font-size: 14px;
  box-shadow: var(--glow-sm);
  flex: none;
}
.topnav__logout { margin: 0; display: flex; }
.topnav__logout-btn {
  font-family: var(--f-display); font-size: 13px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,0.02);
  transition: color .15s, border-color .15s, background .15s;
}
.topnav__logout-btn:hover { color: var(--flame-2); border-color: var(--flame-line); background: var(--flame-soft); }

/* Topbar responsive: en móvil colapsa nombre y textos para no desbordar */
@media (max-width:640px){
  .topbar { padding: 13px 16px; gap: 10px; flex-wrap: wrap; }
  .topnav { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .topnav__link { padding: 8px 10px; font-size: 13px; }
  .brand__app { display: none; }
  .topnav__user { gap: 8px; padding-left: 10px; margin-left: 0; }
  .topnav__name { display: none; }
  .topnav__logout-btn { padding: 7px 11px; font-size: 12.5px; }
}
@media (max-width:560px){
  .brand__word { display: none; }
}

/* ===== Cards ===== */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--ink-800) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .25s, box-shadow .25s;
}
.card::before {
  content:""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--flame-grad); opacity: 0; transition: opacity .25s;
  box-shadow: 0 0 16px var(--flame);
}
.card--hover:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card--hover:hover::before { opacity: 1; }

/* ===== Progress ===== */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress__track { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: var(--flame-grad); box-shadow: 0 0 12px rgba(255,106,31,.6); }
.progress__label { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); letter-spacing: .02em; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--line-2); color: var(--text-3);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.badge--flame { color: var(--flame-2); border-color: var(--flame-line); background: var(--flame-soft); }
.badge--ok { color: var(--ok); border-color: rgba(68,194,138,.3); background: rgba(68,194,138,.08); }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
}
.input {
  font-family: var(--f-body);
  font-size: 16px; color: var(--text);
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--text-4); }
.input:focus {
  outline: none; border-color: var(--flame);
  box-shadow: 0 0 0 4px var(--flame-soft);
  background: rgba(255,255,255,0.05);
}

/* ===== Decoración: marco de esquinas (circuit brackets) ===== */
.brackets { position: relative; }
.brackets::before, .brackets::after {
  content:""; position: absolute; width: 26px; height: 26px; pointer-events: none;
  border: 1.5px solid var(--flame-line);
}
.brackets::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.brackets::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* dotted matrix decorativa */
.dotgrid {
  background-image: radial-gradient(var(--flame-line) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ===== Footer ===== */
.foot {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--text-4);
  font-size: 13px;
}
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot a:hover { color: var(--text-2); }

/* ===== Utilidades ===== */
.glow-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.glow-bg::before {
  content:""; position: absolute;
  width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  right: -10%; top: -25%;
  background: radial-gradient(circle, rgba(255,106,31,.30), rgba(255,106,31,.07) 42%, transparent 66%);
  filter: blur(8px);
}
.vignette::after {
  content:""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* Entrance states intentionally disabled: capture/preview environments freeze the
   animation clock, which would strand opacity:0 content. Content is always visible. */
.reveal { opacity: 1 !important; transform: none !important; }
