/* =========================================================
   IAUTOMAE — Sistema de diseño "Cybernetic Precision" (minimalista)
   ========================================================= */

:root {
  --bg:            #090b0f;
  --surface:       #0e1116;
  --surface-2:     #12161d;
  --surface-3:     #1a1f28;
  --border:        rgba(150, 160, 178, 0.11);
  --border-strong: rgba(150, 160, 178, 0.22);
  --text:          #e8ebf1;
  --text-muted:    #98a0ad;
  --text-faint:    #616875;
  --primary:       #57f1db;
  --primary-dim:   #2dd4bf;
  --primary-ink:   #00332d;
  --radius:        14px;
  --radius-sm:     10px;
  --maxw:          1140px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:          'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fondo sutil con rejilla técnica */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(150, 165, 190, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 165, 190, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 35%, transparent 80%);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.display { font-size: clamp(2.4rem, 5vw, 3.7rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 14px;
  display: inline-block;
}

.accent { color: var(--primary); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 19, 38, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.03em; font-size: 1.15rem; }
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary-ink); font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; object-fit: cover;
  display: block; border: 1px solid var(--border);
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-muted); font-size: 0.93rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dim)); color: var(--primary-ink); }
.btn-primary:hover { box-shadow: 0 0 24px rgba(87, 241, 219, 0.25); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary-dim); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; text-align: center; }
.hero .lead { max-width: 620px; margin: 20px auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--primary); background: rgba(87, 241, 219, 0.08);
  border: 1px solid rgba(87, 241, 219, 0.22); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 24px;
}
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(87,241,219,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(87,241,219,0); } 100% { box-shadow: 0 0 0 0 rgba(87,241,219,0); } }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .25s, transform .25s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.card .icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(87, 241, 219, 0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Encabezado de sección */
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin: 14px 0 0; color: var(--text-muted); }

/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 40px; }
.stat .n { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.stat .l { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

/* CTA banner */
.cta {
  background: linear-gradient(135deg, var(--surface-3), var(--surface));
  border: 1px solid var(--border);
  border-radius: 24px; padding: 56px 40px; text-align: center;
}
.cta p { max-width: 520px; margin: 14px auto 28px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; font-weight: 500; }
.footer a { display: block; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 10px; transition: color .2s; }
.footer a:hover { color: var(--primary); }
.footer .brand { margin-bottom: 14px; }
.footer .col-brand p { color: var(--text-muted); font-size: 0.92rem; max-width: 280px; margin: 0; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Formularios / Login ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 38px 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.input {
  width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 0.95rem;
  color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 10px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { border-color: var(--primary-dim); box-shadow: 0 0 0 3px rgba(87,241,219,0.12); }
.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 0.86rem; }
.row-between label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; }
.row-between a { color: var(--primary); }
.auth-foot { text-align: center; margin-top: 22px; font-size: 0.9rem; color: var(--text-muted); }
.auth-foot a { color: var(--primary); font-weight: 600; }
.note { font-size: 0.78rem; color: var(--text-faint); text-align: center; margin-top: 20px; line-height: 1.5; }

/* ---------- Documentos legales ---------- */
.doc { max-width: 800px; margin: 0 auto; padding: 60px 24px 80px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 10px; }
.doc .updated { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); letter-spacing: 0.06em; margin-bottom: 40px; display: block; }
.doc h2 { font-size: 1.25rem; margin: 40px 0 14px; color: var(--text); }
.doc h3 { font-size: 1.02rem; margin: 24px 0 10px; }
.doc p, .doc li { color: var(--text-muted); font-size: 0.97rem; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--primary); }
.doc strong { color: var(--text); font-weight: 600; }
.doc .toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 40px; }
.doc .toc ol { margin: 0; padding-left: 20px; }
.doc .toc li { margin-bottom: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 30px; }
.back-link:hover { color: var(--primary); }

/* ---------- Dashboard ---------- */
.dash { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 26px 18px; display: flex; flex-direction: column;
}
.sidebar .brand { padding: 0 8px 8px; }
.sidebar .tier { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--primary); opacity: .7; padding: 0 8px 22px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--text-muted); font-size: 0.92rem; font-weight: 500; margin-bottom: 4px; transition: background .2s, color .2s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: rgba(87, 241, 219, 0.1); color: var(--primary); }
.nav-item .mi { width: 18px; text-align: center; font-family: var(--mono); font-size: 0.9rem; }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dim)); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }

.dash-main { flex: 1; padding: 34px 40px; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 34px; }
.dash-head p { margin: 6px 0 0; color: var(--text-muted); max-width: 460px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); }
.chip .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse 2s infinite; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; margin-bottom: 24px; }
.panel-meta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.panel-meta p { margin: 8px 0 0; color: var(--text-muted); max-width: 420px; }
.btn-fb { background: #1877F2; color: #fff; }
.btn-fb:hover { background: #166fe5; box-shadow: none; }

table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 14px 18px; border-bottom: 1px solid var(--border); }
tbody td { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 0.68rem; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.status.ok { color: var(--primary); background: rgba(87,241,219,.1); border: 1px solid rgba(87,241,219,.22); }
.status.wait { color: #ffc48a; background: rgba(255,172,90,.1); border: 1px solid rgba(255,172,90,.22); }
.mono { font-family: var(--mono); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.kpi .k-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.kpi .k-val { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; }
.kpi .k-val.accent { color: var(--primary); }

/* ---------- Modal de contacto ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 7, 10, 0.74); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 440px; position: relative;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 32px 30px 34px;
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 1.4rem; margin-bottom: 6px; }
.modal .sub { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 24px; }
.modal .close {
  position: absolute; top: 14px; right: 16px; width: 32px; height: 32px;
  background: none; border: none; color: var(--text-faint); font-size: 1.5rem;
  cursor: pointer; line-height: 1; border-radius: 8px; transition: background .2s, color .2s;
}
.modal .close:hover { color: var(--text); background: var(--surface-2); }
textarea.input { resize: vertical; min-height: 100px; font-family: var(--font); }
.form-success { text-align: center; padding: 14px 0 6px; }
.form-success .ok-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(87, 241, 219, 0.12); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 1.6rem;
}
.form-success h3 { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer .col-brand { grid-column: 1 / -1; }
  .kpis { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-main { padding: 24px 20px; }
  .nav-links .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; }
}
