/* ============================================================
   SoftwaCAP — Swiss-editorial design system
   Inspirado en ai.softwalabs.com con paleta violeta como accent
   ============================================================ */

:root {
  /* Colores — dark theme (default) */
  --bg:         #0a0a0c;
  --bg-1:       #111114;
  --bg-2:       #17171b;
  --bg-3:       #1d1d22;
  --line:       #25252b;
  --line-2:     #2f2f36;
  --ink:        #f4f4f5;
  --ink-2:      #c5c5cc;
  --ink-3:      #8a8a93;
  --ink-4:      #55555d;

  /* Accent — violeta SoftwaCAP */
  --accent:        #a855f7;
  --accent-ink:    #150529;
  --accent-2:      #d946ef;
  --accent-2-ink:  #1f0518;

  /* Estado */
  --success:    #34d399;
  --warn:       #fbbf24;
  --danger:     #f87171;

  /* EU stripe colors (no se usan, sólo referencia) */
  --eu-blue:    #003399;
  --eu-yellow:  #ffcc00;

  /* Tipografía */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-serif:   'Fraunces', Georgia, serif;
  --font-mono:    'JetBrains Mono', Consolas, Monaco, monospace;

  /* Spacing */
  --gutter: 24px;
  --section-pad: 96px;
  --section-pad-sm: 48px;
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, svg { max-width: 100%; display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.container-md { max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); }

.section {
  padding: var(--section-pad) 0;
  border-bottom: 1px solid var(--line);
}
.section-sm { padding: var(--section-pad-sm) 0; }

.row { display: flex; }
.col { flex: 1; }
.center { text-align: center; }

@media (max-width: 900px) {
  :root { --section-pad: 64px; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.logo:hover { color: var(--ink); }

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; }

.logo-tag {
  font-size: 0.7rem;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1;
  letter-spacing: 0.06em;
  margin-left: -6px;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav a { transition: color 0.2s; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 860px) {
  .nav { display: none; }
}

/* Hamburger + nav móvil fullscreen */
.hamburger {
  display: none;
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
}
.hamburger span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 860px) { .hamburger { display: flex; } }

.nav-mobile {
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--bg);
  z-index: 90;
  padding: 32px var(--gutter);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile a {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 14px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:last-of-type { border-bottom: none; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: transparent; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h1 { font-size: clamp(36px, 6vw, 84px); line-height: 0.95; }
h2 { font-size: clamp(28px, 4.5vw, 56px); }
h3 { font-size: clamp(20px, 2vw, 28px); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.underline-accent {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
}

.kicker, .label-mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.lead {
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
}

.muted { color: var(--ink-3); }
.dim   { color: var(--ink-4); }
.mono  { font-family: var(--font-mono); }

/* Drop cap (primera letra estilo editorial) */
.drop-cap::first-letter {
  font-family: var(--font-serif);
  font-size: 3.6rem;
  font-weight: 400;
  font-style: italic;
  float: left;
  line-height: 0.78;
  margin-right: 8px;
  margin-top: 6px;
  color: var(--ink);
}

/* ============================================================
   Meta bar (banda superior bajo el header)
   ============================================================ */
.meta-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  gap: 0;
}
.meta-bar span {
  white-space: nowrap;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}
.meta-bar span:last-child { border-right: none; }
.meta-bar span:first-child { padding-left: 0; }

@media (max-width: 720px) {
  .meta-bar span { border-right: none; padding: 4px 12px; }
}

/* ============================================================
   Hero (editorial)
   ============================================================ */
.hero { padding: 64px 0 0 0; border-bottom: 1px solid var(--line); }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 56px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.2vw, 100px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 100%;
}

.hero-meta {
  text-align: right;
  flex-shrink: 0;
}
.hero-chapter {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  font-style: italic;
  color: var(--line-2);
  line-height: 1;
}

.hero-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.hero-col {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.hero-col p + p { margin-top: 1em; }

.hero-signature {
  padding: 24px 0 56px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

@media (max-width: 900px) {
  .hero-top { flex-direction: column; gap: 20px; }
  .hero-meta { text-align: left; }
  .hero-columns { grid-template-columns: 1fr; gap: 24px; }
  .hero-signature { text-align: left; }
}

/* ============================================================
   Section header
   ============================================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 60px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.card-hover:hover { border-color: var(--ink-4); transform: translateY(-2px); }
.card-pad-lg { padding: 48px 40px; }
.card-tight { padding: 20px 22px; }

.card-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.card-accent .muted, .card-accent .dim { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.card-accent .label-mono { color: color-mix(in srgb, var(--accent-ink) 60%, transparent); }
.card-accent a { color: var(--accent-ink); text-decoration: underline; }

/* Feature card editorial */
.feature-card {
  border-radius: 12px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.feature-card.is-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.feature-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0.65;
}
.feature-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
}
.feature-heading .serif-italic {
  display: block;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 500;
}
.feature-desc {
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.85;
  flex: 1;
}

/* Grids */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.gap-lg { gap: 32px; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="url"], input[type="number"],
input[type="tel"], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 11px 14px;
  background: var(--bg-1);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
textarea { resize: vertical; min-height: 100px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='%238a8a93'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  vertical-align: middle;
}

.form-help { font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; }
.form-error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.form-success {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.input-copy {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.input-copy input { font-family: var(--font-mono); font-size: 0.82rem; }

/* ============================================================
   Tables
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.table tbody tr:hover { background: var(--bg-2); }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  vertical-align: middle;
}
.badge-accent  { color: var(--accent); }
.badge-success { color: var(--success); }
.badge-warn    { color: var(--warn); }
.badge-danger  { color: var(--danger); }
.badge-mute    { color: var(--ink-3); }
.badge-fill    { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ============================================================
   Pricing
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.plan {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 24px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s;
}
.plan-featured {
  border-color: var(--accent);
  background: var(--bg-2);
  position: relative;
}
.plan-featured::before {
  content: 'Recomendado';
  position: absolute;
  top: -11px;
  left: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.plan h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.plan-price {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 8px 0 4px;
  line-height: 1;
}
.plan-price small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.plan-quota { color: var(--ink-3); font-family: var(--font-mono); font-size: 0.78rem; margin-bottom: 24px; letter-spacing: 0.04em; }
.plan ul { list-style: none; flex: 1; margin-bottom: 24px; }
.plan ul li { padding: 6px 0; font-size: 0.9rem; color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.plan ul li::before { content: '→'; color: var(--accent); flex-shrink: 0; }

@media (max-width: 1000px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Pricing toggle mensual/anual */
.cycle-toggle {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 3px;
  background: var(--bg-2);
  margin: 0 auto 32px;
}
.cycle-toggle button {
  background: transparent;
  border: none;
  color: var(--ink-3);
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.cycle-toggle button.active {
  background: var(--accent);
  color: var(--accent-ink);
}
.cycle-toggle .save-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--success) 25%, transparent);
  color: var(--success);
}

/* ============================================================
   Dashboard layout
   ============================================================ */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
  border-top: 1px solid var(--line);
}
.dash-sidebar {
  border-right: 1px solid var(--line);
  padding: 24px 12px;
  background: var(--bg-1);
}
.dash-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 6px;
  color: var(--ink-3);
  font-size: 0.9rem;
  font-family: var(--font-body);
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.dash-sidebar a:hover { background: var(--bg-2); color: var(--ink); }
.dash-sidebar a.active {
  background: var(--bg-3);
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.dash-content { padding: 40px var(--gutter); }
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.dash-header h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 4px;
  }
  .dash-sidebar a {
    margin-bottom: 0;
    border-left: none !important;
    padding: 8px 12px !important;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .dash-sidebar a.active { background: var(--accent); color: var(--accent-ink); }
}

/* Stat cards */
.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.stat-trend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-top: 8px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ============================================================
   Code
   ============================================================ */
pre, code { font-family: var(--font-mono); }
pre {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink-2);
}
:not(pre) > code {
  background: var(--bg-3);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ============================================================
   Modal + toast
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.22s ease-out;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 4px;
}
.modal-close:hover { background: var(--bg-3); color: var(--ink); }
@keyframes modalIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.toast-stack {
  position: fixed;
  top: 80px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-width: 360px;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  animation: toastIn 0.25s ease-out;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-danger  { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }
.toast-warn    { border-left: 3px solid var(--warn); }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 56px 0 32px;
  font-size: 0.88rem;
  color: var(--ink-3);
}
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 12px;
  font-weight: 500;
}
.site-footer ul { list-style: none; }
.site-footer ul li { margin: 6px 0; }
.site-footer a { color: var(--ink-3); }
.site-footer a:hover { color: var(--ink); }

.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

@media (max-width: 720px) {
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .site-footer .container { grid-template-columns: 1fr; }
}

/* ============================================================
   Chatbot bubble (frontend)
   ============================================================ */
.chat-bubble {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 90;
  color: var(--accent-ink);
  transition: opacity 0.2s, transform 0.2s;
}
.chat-bubble:hover { opacity: 0.85; transform: scale(1.05); }
.chat-panel {
  position: fixed;
  bottom: 84px; right: 20px;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 110px));
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  z-index: 91;
  overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-head h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.chat-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.chat-msg.bot  { align-self: flex-start; background: var(--bg-1); color: var(--ink); border: 1px solid var(--line); }
.chat-input {
  border-top: 1px solid var(--line);
  display: flex;
  padding: 10px;
  gap: 6px;
}
.chat-input input { flex: 1; }
.chat-input button { padding: 6px 14px; }

/* ============================================================
   Utilities
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .gap-4 { gap: 32px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.hide-sm { /* visible by default */ }
@media (max-width: 600px) { .hide-sm { display: none !important; } }

/* Animaciones suaves al hacer scroll */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-reveal].fade-up { animation: fadeUp 0.5s ease-out both; }

/* Section sin border-bottom (última sección) */
.section.no-border { border-bottom: none; }
