/* _sistema.css — CobraNex Design System — v1.0.0 */
/* Importado en todas las páginas via <link rel="stylesheet" href="_sistema.css"> */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,600;0,800;1,800&family=JetBrains+Mono:wght@400;700&display=swap');

/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  --bg-page:       #F8F7F4;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #FFFCFD;
  --bg-dark:       #0f0a0d;

  --brand-deep:    #4c0519;
  --brand-mid:     #9d174d;
  --brand-light:   #fdf2f8;
  --brand-border:  #fbcfe8;

  --text-primary:  #1e293b;
  --text-muted:    #64748b;
  --text-hint:     #94a3b8;
  --text-inverse:  #f8fafc;

  --border-soft:   #f1e8ed;
  --border-mid:    #e2c8d5;

  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;

  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-xl:     40px;

  --shadow-sm:     0 1px 3px rgba(76,5,25,.06), 0 1px 2px rgba(76,5,25,.04);
  --shadow-md:     0 4px 16px rgba(76,5,25,.08), 0 1px 4px rgba(76,5,25,.04);
  --shadow-lg:     0 12px 40px rgba(76,5,25,.12), 0 4px 12px rgba(76,5,25,.06);

  --font-body:     'Plus Jakarta Sans', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --header-h:      72px;
  --sidebar-w:     240px;
  --content-max:   1200px;
  --section-gap:   96px;
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────────── */
.display-1 { font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; font-style: italic; line-height: .92; letter-spacing: -.03em; }
.display-2 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; font-style: italic; line-height: .95; letter-spacing: -.025em; }
.heading-1 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.heading-2 { font-size: clamp(1.35rem, 2vw, 1.875rem); font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
.heading-3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.label-caps { font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.mono { font-family: var(--font-mono); }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-gap) 0; }
.section-sm { padding: 48px 0; }

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

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  :root { --section-gap: 64px; }
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(248,247,244,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brand-border);
}
.site-header .inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.site-logo {
  font-size: 1.375rem; font-weight: 800; font-style: italic;
  letter-spacing: -.04em; color: var(--text-primary); white-space: nowrap;
}
.site-logo span { color: var(--brand-mid); }
.site-logo .parent {
  font-size: .6rem; font-weight: 600; font-style: normal;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-hint); display: block; margin-top: -2px;
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .8125rem; font-weight: 600; color: var(--text-muted);
  transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--brand-deep); background: var(--brand-light); }
.site-nav a.active { color: var(--brand-deep); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-deep); color: #fff !important;
  padding: 9px 20px; border-radius: 100px;
  font-size: .8125rem; font-weight: 700;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--brand-mid) !important; }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; border: none; background: none; cursor: pointer;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
  background: var(--bg-card); z-index: 99; padding: 24px;
  flex-direction: column; gap: 8px;
  border-top: 1px solid var(--brand-border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  display: block; padding: 14px 16px; border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 600; color: var(--text-primary);
  border: 1px solid transparent;
}
.nav-mobile a:hover { background: var(--brand-light); border-color: var(--brand-border); }
.nav-mobile .nav-cta { text-align: center; margin-top: 8px; }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand .site-logo { color: #fff; font-size: 1.5rem; }
.footer-brand p { font-size: .8125rem; color: #94a3b8; margin-top: 12px; line-height: 1.6; }
.footer-col h4 { font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #475569; margin-bottom: 16px; }
.footer-col a { display: block; font-size: .8125rem; color: #94a3b8; padding: 4px 0; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: .75rem; color: #475569; }
.footer-bottom .parent-brand { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-mid); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; border-radius: 100px; transition: all .15s;
  cursor: pointer; border: none; font-family: var(--font-body);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--brand-deep); color: #fff;
  padding: 14px 32px; font-size: .875rem;
}
.btn-primary:hover { background: var(--brand-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent; color: var(--brand-deep);
  padding: 13px 30px; font-size: .875rem;
  border: 2px solid var(--brand-deep);
}
.btn-secondary:hover { background: var(--brand-light); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  padding: 12px 24px; font-size: .875rem;
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-lg { padding: 18px 40px; font-size: 1rem; }
.btn-sm { padding: 9px 20px; font-size: .75rem; }
.btn:active { transform: scale(.98); }

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm);
  padding: 32px;
}
.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
}
.badge-brand { background: var(--brand-light); color: var(--brand-deep); border: 1px solid var(--brand-border); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-neutral { background: #f1f5f9; color: var(--text-muted); }

/* ── FORMS ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--bg-card); font-size: .9375rem; font-family: var(--font-body);
  color: var(--text-primary); transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(157,23,77,.1);
}
.form-input::placeholder { color: var(--text-hint); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── SEMÁFORO ────────────────────────────────────────────────────────────── */
.semaforo-verde  { background: var(--success-bg); color: var(--success); }
.semaforo-amarillo { background: var(--warning-bg); color: var(--warning); }
.semaforo-rojo   { background: var(--danger-bg);  color: var(--danger); }

/* ── SECTION LABEL ───────────────────────────────────────────────────────── */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .6875rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-mid); margin-bottom: 16px;
}
.section-eyebrow::before {
  content: ''; display: block; width: 20px; height: 2px; background: var(--brand-mid);
}

/* ── TRIANGLE VISUAL ─────────────────────────────────────────────────────── */
.triangle-vertex {
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.vertex-collector { background: #E1F5EE; border: 1px solid #9FE1CB; }
.vertex-imagen    { background: #FAEEDA; border: 1px solid #FAC775; }
.vertex-emitter   { background: #EEEDFE; border: 1px solid #CECBF6; }
.vertex-number {
  font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.vertex-collector .vertex-number { color: #0F6E56; }
.vertex-imagen    .vertex-number { color: #854F0B; }
.vertex-emitter   .vertex-number { color: #534AB7; }
.vertex-score {
  font-size: .75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 100px; display: inline-block; margin-top: 4px;
}
.vertex-collector .vertex-score { background: rgba(15,110,86,.1); color: #0F6E56; }
.vertex-imagen    .vertex-score { background: rgba(133,79,11,.1);  color: #854F0B; }
.vertex-emitter   .vertex-score { background: rgba(83,74,183,.1);  color: #534AB7; }

/* ── SIDEBAR LAYOUT (Portales) ───────────────────────────────────────────── */
.portal-layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.portal-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-sidebar); border-right: 1px solid var(--brand-border);
  padding: 24px 12px; position: sticky;
  top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.sidebar-section { font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-hint); padding: 12px 12px 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: .8125rem; font-weight: 600;
  color: var(--text-muted); transition: all .15s; cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--brand-light); color: var(--brand-deep); }
.sidebar-link.active {
  background: var(--brand-light); color: var(--brand-deep);
  border-left: 3px solid var(--brand-deep); margin-left: -12px; padding-left: 21px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.sidebar-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.portal-content { flex: 1; padding: 32px; background: var(--bg-page); min-width: 0; }

@media (max-width: 900px) {
  .portal-sidebar { display: none; }
}

/* ── STEP INDICATOR ──────────────────────────────────────────────────────── */
.steps-sidebar { padding: 32px 24px; }
.step-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6875rem; font-weight: 800;
}
.step-circle.done    { background: var(--success); color: #fff; }
.step-circle.active  { background: var(--brand-deep); color: #fff; }
.step-circle.pending { background: var(--border-soft); color: var(--text-hint); border: 1.5px solid var(--border-mid); }
.step-line { width: 2px; height: 24px; background: var(--border-soft); margin-left: 13px; }
.step-text .step-title { font-size: .8125rem; font-weight: 700; color: var(--text-primary); }
.step-text .step-sub { font-size: .6875rem; color: var(--text-hint); margin-top: 2px; }

/* ── MISC ────────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0; }
.text-brand { color: var(--brand-mid); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.hidden { display: none !important; }

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; } 50% { opacity: .4; }
}
.animate-fade-up { animation: fadeUp .5s ease forwards; }
.animate-fade-up-2 { animation: fadeUp .5s .1s ease both; }
.animate-fade-up-3 { animation: fadeUp .5s .2s ease both; }
.animate-fade-up-4 { animation: fadeUp .5s .3s ease both; }
.pulse-dot { animation: pulse-dot 2s infinite; }
