/* ============================================
   FAIFEX · Calculadora ROI Monitoreo Predictivo
   Reusa tokens de marca del sitio principal.
============================================ */

:root {
  --bg: #0a0d0c;
  --surface: #101312;
  --surface-2: #141817;
  --elevated: #181c1b;
  --border: #22262a;
  --border-strong: #2d3236;

  --text: #f3f3f5;
  --text-secondary: #a5a8ac;
  --text-muted: #6c7074;

  --orange: #ff6a00;
  --orange-2: #ff8c3a;
  --orange-soft: rgba(255, 106, 0, 0.10);
  --orange-ring: rgba(255, 106, 0, 0.25);

  --green-live: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --container: 1160px;

  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'DM Sans', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, legend {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.mono { font-family: var(--font-mono); }
a { color: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; }

/* ─── Botones ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-2); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-link { background: transparent; color: var(--orange); padding: 10px 0; }
.btn-sm { padding: 9px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── Page intro ─── */
.page { padding: 40px 20px 80px; }
.intro { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.eyebrow {
  display: inline-block;
  color: var(--orange);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.intro h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  margin-bottom: 14px;
}
.intro .lead { color: var(--text-secondary); font-size: 1.02rem; max-width: 620px; margin: 0 auto; }

/* ─── Layout calculadora ─── */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.results-card { position: sticky; top: 90px; }

/* ─── Form ─── */
.fgroup {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
}
.fgroup:last-child { margin-bottom: 0; }
.fgroup legend {
  font-size: 1.05rem;
  color: var(--orange);
  padding: 0 0 14px;
  width: 100%;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.help { font-size: 0.8rem; color: var(--text-muted); margin: 6px 0 0; line-height: 1.5; }

input[type="number"], input[type="text"], input[type="email"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-ring); }
input::placeholder { color: var(--text-muted); }

.input-money { display: flex; }
.input-money input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.input-prefix, .select-moneda {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.select-moneda {
  border-right: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  cursor: pointer;
}

.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.88rem; cursor: pointer; }
.checkbox-label input { width: auto; }

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
  margin-top: 4px;
}
.value-pill {
  display: inline-block;
  background: var(--orange-soft);
  color: var(--orange);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.8rem;
  margin-left: 8px;
}

.form-error {
  background: var(--red-soft);
  color: #ff8a8a;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-top: 16px;
}

/* ─── Resultados ─── */
.result-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.result-label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.result-hero-value {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--orange);
  line-height: 1.1;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.result-row span:last-child { color: var(--text); font-weight: 600; }
.result-row.highlight span:last-child { color: var(--green-live); }
.result-row:last-of-type { border-bottom: 0; }

.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

.disclaimer {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

/* ─── Modal lead gate ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal { max-width: 420px; width: 100%; position: relative; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: 0; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 8px; padding-right: 24px; }
.modal-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.modal-privacy { font-size: 0.74rem; color: var(--text-muted); margin-top: 12px; line-height: 1.4; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: center;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.site-footer a { color: var(--orange); text-decoration: none; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .results-card { position: static; order: -1; }
  .field-row { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}
@media (max-width: 480px) {
  .header-inner .btn-sm { font-size: 0.78rem; padding: 8px 10px; }
}
