/* =========================================================================
   HackAtlas — Design System
   Plataforma educativa de ciberseguridad con temática mitológica
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------------- */
:root {
  /* Core palette */
  --c-void:        #050810;
  --c-void-soft:    #0a0f1c;
  --c-panel:        #0d1424;
  --c-panel-raised: #101a2e;
  --c-border:       rgba(0, 200, 255, 0.16);
  --c-border-strong: rgba(0, 200, 255, 0.35);

  --c-atlas-cyan:   #00c8ff;
  --c-atlas-cyan-dim: rgba(0, 200, 255, 0.12);
  --c-green:        #00ff88;
  --c-green-dim:    rgba(0, 255, 136, 0.12);

  /* Agent colors */
  --c-horus:        #c4821e;
  --c-horus-dim:    rgba(196, 130, 30, 0.14);
  --c-set:          #e24b4a;
  --c-set-dim:      rgba(226, 75, 74, 0.14);
  --c-aegis:        #1db887;
  --c-aegis-dim:    rgba(29, 184, 135, 0.14);

  /* Text */
  --c-text:         #e8edf7;
  --c-text-dim:     #9aa8c3;
  --c-text-faint:   #5c6a8a;

  /* Type */
  --f-heading: 'Syne', sans-serif;
  --f-mono: 'IBM Plex Mono', monospace;
  --f-body: 'Inter', sans-serif;

  /* Layout */
  --wrap: 1240px;
  --radius: 2px;
  --nav-h: 76px;

  /* Shadows / glow */
  --glow-cyan: 0 0 24px rgba(0, 200, 255, 0.25);
  --glow-green: 0 0 24px rgba(0, 255, 136, 0.25);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------------------
   2. Reset
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  background: var(--c-void);
  color: var(--c-text);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--c-atlas-cyan); color: var(--c-void); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-void); }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-atlas-cyan); }

/* -------------------------------------------------------------------------
   3. Background grid + atmosphere
   ------------------------------------------------------------------------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 200, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 255, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 90%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(0, 200, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(0, 255, 136, 0.06), transparent 60%),
    var(--c-void);
}

/* -------------------------------------------------------------------------
   4. Typography
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--f-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: #fff;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: 1.05rem; }

p { color: var(--c-text-dim); font-weight: 300; }
strong { font-weight: 500; color: var(--c-text); }

.mono {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-atlas-cyan);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--c-atlas-cyan);
}

.text-gradient {
  background: linear-gradient(120deg, var(--c-atlas-cyan), var(--c-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------------------------------------------------------------------------
   5. Layout helpers
   ------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

section { position: relative; padding: 100px 0; }
.section-tight { padding: 64px 0; }

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

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

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-border), transparent);
  border: 0;
}

/* -------------------------------------------------------------------------
   6. Angular / clip-path shells
   ------------------------------------------------------------------------- */
.panel {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.panel-tag {
  position: absolute;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border-top: 1px solid var(--c-atlas-cyan);
  border-left: 1px solid var(--c-atlas-cyan);
  opacity: 0.7;
}

.corner-cut {
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

/* -------------------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: all 0.25s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-atlas-cyan);
  color: var(--c-void);
}
.btn-primary:hover {
  background: var(--c-green);
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
.btn-ghost:hover {
  border-color: var(--c-atlas-cyan);
  color: var(--c-atlas-cyan);
  box-shadow: var(--glow-cyan);
}

.btn-block { width: 100%; }

.btn-danger {
  background: transparent;
  border-color: rgba(255, 90, 90, 0.4);
  color: #ff6b6b;
}
.btn-danger:hover {
  background: rgba(255, 90, 90, 0.12);
  border-color: #ff6b6b;
  color: #ff8080;
}
.btn-danger.btn-solid {
  background: #ff5a5a;
  border-color: #ff5a5a;
  color: #0b0f1a;
}
.btn-danger.btn-solid:hover { background: #ff7373; border-color: #ff7373; }
.btn-sm { padding: 10px 18px; font-size: 0.75rem; }

/* -------------------------------------------------------------------------
   8. Navigation
   ------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}

.nav .wrap { display: flex; align-items: center; justify-content: space-between; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
}
.nav-brand-mark {
  width: 30px; height: 30px;
  border: 1.5px solid var(--c-atlas-cyan);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  color: var(--c-atlas-cyan);
  font-family: var(--f-mono);
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--c-text-dim);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--c-atlas-cyan); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--c-atlas-cyan);
}

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 26px;
}
.nav-toggle span {
  height: 2px;
  background: var(--c-atlas-cyan);
  transition: all 0.25s var(--ease);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--c-void-soft);
    border-bottom: 1px solid var(--c-border);
    padding: 24px 28px;
    gap: 20px;
  }
  .nav-links.open .nav-actions,
  .nav-links.open a.btn { display: flex; }
}

/* -------------------------------------------------------------------------
   9. Hero
   ------------------------------------------------------------------------- */
.hero {
  padding: 120px 0 90px;
  text-align: center;
}
.hero h1 { max-width: 900px; margin: 0 auto 22px; }
.hero p.lead {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  color: var(--c-text-dim);
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  font-family: var(--f-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--c-atlas-cyan);
  display: block;
}
.hero-stat .label {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-faint);
}

/* -------------------------------------------------------------------------
   10. Cards
   ------------------------------------------------------------------------- */
.card {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  padding: 32px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--c-border-strong);
}

/* Agent cards */
.agent-card {
  position: relative;
  padding: 36px 32px 32px;
  overflow: hidden;
}
.agent-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--agent-color, var(--c-atlas-cyan));
}
.agent-card .agent-glyph {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--agent-color, var(--c-atlas-cyan));
  margin-bottom: 14px;
  display: block;
}
.agent-card h3 { margin-bottom: 6px; }
.agent-card .agent-role {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--agent-color, var(--c-atlas-cyan));
  margin-bottom: 16px;
  display: block;
}
.agent-card p { margin-bottom: 22px; font-size: 0.94rem; }
.agent-card .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.agent-card .tag {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  padding: 4px 10px;
  border: 1px solid var(--c-border);
  color: var(--c-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agent-card:hover {
  box-shadow: 0 0 0 1px var(--agent-color, var(--c-atlas-cyan)) inset, 0 20px 40px -20px rgba(0,0,0,0.6);
}

.agent-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  color: var(--agent-color, var(--c-atlas-cyan));
}
.agent-link .arrow { transition: transform 0.25s var(--ease); }
.agent-card:hover .agent-link .arrow { transform: translateX(4px); }

/* -------------------------------------------------------------------------
   11. News / doc cards
   ------------------------------------------------------------------------- */
.news-card { padding: 26px; }
.news-card .meta {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.news-card .cat {
  color: var(--c-atlas-cyan);
}
.news-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.news-card p { font-size: 0.92rem; margin-bottom: 16px; }

.badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--c-border);
  color: var(--c-atlas-cyan);
}

/* -------------------------------------------------------------------------
   12. Pricing
   ------------------------------------------------------------------------- */
.price-card {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border-color: var(--c-atlas-cyan);
  box-shadow: var(--glow-cyan);
  position: relative;
}
.price-card .plan-name {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-atlas-cyan);
  margin-bottom: 8px;
}
.price-card .plan-price {
  font-family: var(--f-heading);
  font-weight: 800;
  font-size: 2.6rem;
  color: #fff;
  margin-bottom: 4px;
}
.price-card .plan-price span {
  font-size: 0.95rem;
  font-family: var(--f-mono);
  color: var(--c-text-faint);
  font-weight: 400;
}
.price-card .plan-desc { margin-bottom: 26px; font-size: 0.9rem; }
.price-card ul { margin-bottom: 30px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.price-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--c-text-dim);
}
.price-card li::before {
  content: '✓';
  color: var(--c-green);
  font-family: var(--f-mono);
  flex-shrink: 0;
}
.price-card li.disabled {
  color: var(--c-text-faint);
}
.price-card li.disabled::before {
  content: '—';
  color: var(--c-text-faint);
}
.soon-tag {
  position: absolute;
  top: -12px; right: 24px;
  background: var(--c-void);
  border: 1px solid var(--c-border-strong);
  color: var(--c-atlas-cyan);
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
}

/* -------------------------------------------------------------------------
   13. Forms
   ------------------------------------------------------------------------- */
.field { margin-bottom: 20px; text-align: left; }
.field label {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--c-void-soft);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 13px 16px;
  font-family: var(--f-body);
  font-size: 0.94rem;
  transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-atlas-cyan);
}

/* -------------------------------------------------------------------------
   14. Footer
   ------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--c-border);
  padding: 60px 0 30px;
  background: var(--c-void-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-brand p { font-size: 0.88rem; margin: 16px 0 20px; max-width: 320px; }
.footer h4 {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: 18px;
}
.footer ul { display: flex; flex-direction: column; gap: 11px; }
.footer a { font-size: 0.88rem; color: var(--c-text-dim); transition: color 0.2s var(--ease); }
.footer a:hover { color: var(--c-atlas-cyan); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid var(--c-border);
  font-family: var(--f-mono);
  font-size: 0.76rem;
  color: var(--c-text-faint);
}
.footer-social { display: flex; gap: 16px; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   15. Page header (subpages)
   ------------------------------------------------------------------------- */
.page-header {
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}
.page-header p.lead { max-width: 600px; margin: 18px auto 0; }

.breadcrumb {
  font-family: var(--f-mono);
  font-size: 0.76rem;
  color: var(--c-text-faint);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--c-text-dim); }
.breadcrumb a:hover { color: var(--c-atlas-cyan); }

/* -------------------------------------------------------------------------
   16. Agent hero (individual agent pages)
   ------------------------------------------------------------------------- */
.agent-hero {
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--c-border);
  position: relative;
}
.agent-hero-inner { display: grid; grid-template-columns: 1fr 340px; gap: 60px; align-items: center; }
.agent-hero .eyebrow { color: var(--agent-color); }
.agent-hero .eyebrow::before { background: var(--agent-color); }
.agent-hero h1 { margin-bottom: 20px; }
.agent-hero h1 .hl { color: var(--agent-color); }
.agent-hero p.lead { font-size: 1.05rem; margin-bottom: 30px; max-width: 560px; }

.agent-portrait {
  aspect-ratio: 1;
  border: 1px solid var(--agent-color);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--agent-color) 22%, transparent), transparent 70%),
    var(--c-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
  position: relative;
}
.agent-portrait .sigil {
  font-family: var(--f-mono);
  font-size: 4.2rem;
  color: var(--agent-color);
  opacity: 0.85;
}
.agent-portrait .scan-line {
  position: absolute;
  left: 0; right: 0; height: 2px;
  background: var(--agent-color);
  opacity: 0.6;
  animation: scan 3.2s linear infinite;
}
@keyframes scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

@media (max-width: 900px) {
  .agent-hero-inner { grid-template-columns: 1fr; }
  .agent-portrait { max-width: 280px; margin: 0 auto; }
}

.agent-section-title { color: var(--agent-color); }

.capability {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--c-border);
}
.capability .idx {
  font-family: var(--f-mono);
  color: var(--agent-color);
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 32px;
}
.capability h4 { margin-bottom: 6px; }
.capability p { font-size: 0.9rem; }

.disclaimer-box {
  border: 1px solid var(--c-set);
  background: var(--c-set-dim);
  padding: 22px 26px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 40px 0;
}
.disclaimer-box .icon {
  font-family: var(--f-mono);
  color: var(--c-set);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.disclaimer-box strong { color: var(--c-set); display: block; margin-bottom: 6px; }
.disclaimer-box p { font-size: 0.88rem; color: var(--c-text-dim); }

/* -------------------------------------------------------------------------
   17. Chat widget
   ------------------------------------------------------------------------- */
.agent-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 60px;
  height: 60px;
  background: var(--agent-color, var(--c-atlas-cyan));
  color: var(--c-void);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: 0 8px 30px -6px rgba(0,0,0,0.6);
  font-family: var(--f-mono);
  font-size: 1.4rem;
  transition: transform 0.25s var(--ease);
}
.agent-chat-launcher:hover { transform: scale(1.08); }
.agent-chat-launcher .dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 12px; height: 12px;
  background: var(--c-green);
  border: 2px solid var(--c-void);
  border-radius: 50%;
}

.agent-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--c-panel);
  border: 1px solid var(--agent-color, var(--c-border-strong));
  display: none;
  flex-direction: column;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  box-shadow: 0 20px 60px -12px rgba(0,0,0,0.7);
}
.agent-chat-panel.open { display: flex; }

.agent-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-void-soft);
}
.agent-chat-head .who { display: flex; align-items: center; gap: 10px; }
.agent-chat-head .avatar {
  width: 32px; height: 32px;
  background: var(--agent-color);
  color: var(--c-void);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-weight: 700;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.agent-chat-head .name { font-family: var(--f-heading); font-weight: 800; font-size: 0.95rem; color: #fff; }
.agent-chat-head .status { font-family: var(--f-mono); font-size: 0.68rem; color: var(--c-green); }
.agent-chat-close { color: var(--c-text-faint); font-size: 1.1rem; padding: 4px; }
.agent-chat-close:hover { color: var(--c-text); }

.agent-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg {
  max-width: 85%;
  padding: 11px 14px;
  font-size: 0.87rem;
  line-height: 1.5;
  border: 1px solid var(--c-border);
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--c-void-soft);
  border-color: var(--c-border);
  color: var(--c-text-dim);
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--agent-color);
  color: var(--c-void);
  border-color: var(--agent-color);
  font-weight: 400;
}
.chat-msg.typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.chat-msg.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--agent-color);
  animation: blink 1.2s infinite ease-in-out;
}
.chat-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-msg.error { border-color: var(--c-set); color: var(--c-set); background: var(--c-set-dim); }

.agent-chat-foot {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--c-border);
}
.agent-chat-foot input {
  flex: 1;
  background: var(--c-void-soft);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 11px 14px;
  font-family: var(--f-body);
  font-size: 0.88rem;
}
.agent-chat-foot input:focus { outline: none; border-color: var(--agent-color); }
.agent-chat-foot button {
  width: 42px;
  background: var(--agent-color);
  color: var(--c-void);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  flex-shrink: 0;
}
.agent-chat-foot button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .agent-chat-panel { right: 14px; bottom: 88px; width: calc(100vw - 28px); }
  .agent-chat-launcher { right: 16px; bottom: 16px; }
}

/* -------------------------------------------------------------------------
   18. Cookie banner
   ------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  width: 100%;
  background: #0b0f1a;
  border-top: 1px solid rgba(0, 200, 255, 0.2);
  padding: 18px 24px;
  display: none;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  box-shadow: 0 -20px 60px -12px rgba(0,0,0,0.7);
}
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: 0.82rem; line-height: 1.5; margin: 0; max-width: 720px; }
.cookie-banner a { color: var(--c-atlas-cyan); }
.cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   19. Docs layout
   ------------------------------------------------------------------------- */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 50px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--nav-h) + 24px); }
.docs-nav h4 {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-faint);
  margin: 22px 0 10px;
}
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav ul { display: flex; flex-direction: column; gap: 8px; }
.docs-nav a {
  font-size: 0.88rem;
  color: var(--c-text-dim);
  padding: 4px 0;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.docs-nav a:hover, .docs-nav a.active { color: var(--c-atlas-cyan); border-left-color: var(--c-atlas-cyan); }
.docs-nav-soon {
  font-size: 0.88rem;
  color: var(--c-text-faint);
  padding: 4px 0 4px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-left: 2px solid transparent;
}
.docs-nav-soon .mono {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: center;
}

.doc-card { padding: 26px; margin-bottom: 20px; }
.doc-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.doc-card .meta { font-family: var(--f-mono); font-size: 0.72rem; color: var(--c-text-faint); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em;}
.doc-card p { font-size: 0.9rem; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 20px; }
}

/* -------------------------------------------------------------------------
   20. Legal content
   ------------------------------------------------------------------------- */
.legal-content { max-width: 780px; margin: 0 auto; }
.legal-content h2 { margin: 46px 0 16px; font-size: 1.5rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: 1.1rem; margin: 26px 0 12px; }
.legal-content p { margin-bottom: 14px; font-size: 0.94rem; }
.legal-content ul { margin: 12px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.legal-content li { font-size: 0.94rem; color: var(--c-text-dim); padding-left: 20px; position: relative; }
.legal-content li::before { content: '—'; position: absolute; left: 0; color: var(--c-atlas-cyan); }
.legal-content .updated { font-family: var(--f-mono); font-size: 0.78rem; color: var(--c-text-faint); margin-bottom: 40px; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.85rem; }
.legal-content th, .legal-content td { border: 1px solid var(--c-border); padding: 10px 14px; text-align: left; color: var(--c-text-dim); }
.legal-content th { color: var(--c-text); font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* -------------------------------------------------------------------------
   21. Reveal on scroll
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* -------------------------------------------------------------------------
   22. Utility
   ------------------------------------------------------------------------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head p { margin-top: 14px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--c-green);
  border: 1px solid rgba(0,255,136,0.3);
  background: var(--c-green-dim);
  padding: 8px 16px;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 8px var(--c-green); }

@media (max-width: 640px) {
  section { padding: 64px 0; }
  .hero { padding: 90px 0 60px; }
}

/* -------------------------------------------------------------------------
   15. Auth (login / registro / recuperar / dashboard)
   ------------------------------------------------------------------------- */
.auth-section {
  min-height: 72vh;
  display: flex;
  align-items: center;
  padding: 64px 0;
}
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 44px 40px;
}
.auth-card .eyebrow { justify-content: center; display: flex; }
.auth-card h1 { font-size: 1.9rem; text-align: center; margin-bottom: 10px; }
.auth-card .lead {
  text-align: center;
  font-size: 0.94rem;
  margin: 0 auto 32px;
  max-width: 360px;
}
.auth-card .field input:invalid:not(:placeholder-shown) { border-color: var(--c-set); }
.auth-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--c-text-dim);
}
.auth-foot a { color: var(--c-atlas-cyan); }
.auth-foot a:hover { text-decoration: underline; }

.auth-msg {
  display: none;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid;
  line-height: 1.5;
}
.auth-msg.show { display: flex; }
.auth-msg.error { color: var(--c-set); border-color: rgba(226,75,74,0.35); background: rgba(226,75,74,0.1); }
.auth-msg.success { color: var(--c-green); border-color: rgba(0,255,136,0.3); background: var(--c-green-dim); }
.auth-msg.info { color: var(--c-atlas-cyan); border-color: var(--c-border-strong); background: var(--c-atlas-cyan-dim); }

.field-hint { font-size: 0.78rem; color: var(--c-text-faint); margin-top: 6px; }

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  text-align: left;
}
.field-check input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--c-atlas-cyan);
  flex-shrink: 0;
  cursor: pointer;
}
.field-check label { font-size: 0.8rem; color: var(--c-text-faint); line-height: 1.5; cursor: pointer; }
.field-check label a { color: var(--c-atlas-cyan); }

/* Error inline bajo un campo (p. ej. email ya registrado) — rojo sutil */
.field-error {
  margin-top: 8px;
  padding: 9px 12px;
  font-family: var(--f-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: #FF3E5E;
  border-left: 2px solid #FF3E5E;
  background: rgba(255, 62, 94, 0.07);
}
.field-error[hidden] { display: none; }
.field-error a { color: #FF3E5E; text-decoration: underline; font-weight: 500; }
.field-error a:hover { color: #ff6d87; }

/* -------------------------------------------------------------------------
   Pantalla de confirmación post-registro ("revisa tu email")
   ------------------------------------------------------------------------- */
.auth-confirm {
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 32px 36px;
  text-align: center;
}
.auth-confirm > * {
  opacity: 0;
  animation: confirmFadeUp 0.5s var(--ease) forwards;
}
.auth-confirm > h1 { animation-delay: 0.14s; }
.auth-confirm > .auth-confirm-sub { animation-delay: 0.22s; }
.auth-confirm > .auth-confirm-envelope { animation-delay: 0.30s; }
.auth-confirm > .auth-confirm-text { animation-delay: 0.38s; }
.auth-confirm > .auth-msg { animation-delay: 0.44s; }
.auth-confirm > [data-resend-btn] { animation-delay: 0.48s; }
.auth-confirm > .auth-confirm-hint { animation-delay: 0.54s; }
.auth-confirm > .auth-foot { animation-delay: 0.60s; }

.auth-confirm-glyph {
  width: 84px; height: 84px;
  margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-heading); font-weight: 800; font-size: 2.2rem;
  color: var(--c-atlas-cyan);
  border: 1.5px solid var(--c-atlas-cyan);
  animation: confirmGlyphIn 0.6s var(--ease) both, confirmGlyphPulse 2.4s ease-in-out 0.6s infinite;
}
.auth-confirm h1 { font-size: 1.9rem; margin-bottom: 10px; }
.auth-confirm-sub {
  font-family: var(--f-mono); font-size: 0.82rem; letter-spacing: 0.05em;
  color: var(--c-atlas-cyan);
  margin-bottom: 26px;
}
.auth-confirm-text {
  font-family: var(--f-body); font-weight: 300;
  font-size: 0.95rem; line-height: 1.7; color: var(--c-text-dim);
  margin: 0 auto 24px; max-width: 380px;
}
.auth-confirm-text strong { color: var(--c-text); font-weight: 500; }
.auth-confirm-hint { font-size: 0.78rem; color: var(--c-text-faint); margin: 14px 0 0; }
.auth-confirm .auth-foot { margin-top: 18px; }
.auth-confirm [data-resend-btn] { min-width: 180px; }

.auth-confirm-envelope {
  position: relative;
  width: 96px; height: 96px;
  margin: 6px auto 26px;
  display: flex; align-items: center; justify-content: center;
}
.auth-confirm-envelope svg {
  width: 64px; height: 64px;
  animation: envelopePulse 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.35));
}
.auth-confirm-envelope .pcl {
  position: absolute; top: 50%; left: 50%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--c-atlas-cyan);
  opacity: 0;
  animation: confirmParticle 3.4s ease-in-out infinite;
}
.auth-confirm-envelope .pcl:nth-child(2) { animation-delay: 0s;    --px: -34px; --py: -20px; }
.auth-confirm-envelope .pcl:nth-child(3) { animation-delay: 0.5s;  --px:  32px; --py: -24px; }
.auth-confirm-envelope .pcl:nth-child(4) { animation-delay: 1.0s;  --px:  38px; --py:  18px; }
.auth-confirm-envelope .pcl:nth-child(5) { animation-delay: 1.5s;  --px: -36px; --py:  22px; }
.auth-confirm-envelope .pcl:nth-child(6) { animation-delay: 2.0s;  --px:  -6px; --py: -36px; }
.auth-confirm-envelope .pcl:nth-child(7) { animation-delay: 2.6s;  --px:  10px; --py:  36px; }

@keyframes confirmFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes confirmGlyphIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes confirmGlyphPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 255, 0.0); }
  50%      { box-shadow: 0 0 22px 2px rgba(0, 200, 255, 0.35); }
}
@keyframes envelopePulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.25)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(0, 200, 255, 0.5)); }
}
@keyframes confirmParticle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  25%  { opacity: 0.8; }
  70%  { opacity: 0; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--px, 0px)), calc(-50% + var(--py, 0px))) scale(1); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-confirm > *, .auth-confirm-glyph, .auth-confirm-envelope svg, .auth-confirm-envelope .pcl {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Navbar auth state */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions[hidden], .user-menu[hidden] { display: none !important; }
.user-menu { position: relative; display: flex; align-items: center; gap: 10px; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 7px 14px 7px 8px;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 0.8rem;
  transition: border-color 0.2s var(--ease);
}
.user-menu-trigger:hover { border-color: var(--c-atlas-cyan); }
.user-menu-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-atlas-cyan-dim);
  color: var(--c-atlas-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
}
.user-menu-drop {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.7);
  z-index: 50;
}
.user-menu.open .user-menu-drop { display: block; }
.user-menu-drop a, .user-menu-drop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--c-text-dim);
  background: none;
  border: none;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  font-family: var(--f-body);
}
.user-menu-drop a:last-child, .user-menu-drop button:last-child { border-bottom: 0; }
.user-menu-drop a:hover, .user-menu-drop button:hover { color: var(--c-atlas-cyan); background: var(--c-void-soft); }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.dash-panel { padding: 30px; }
.dash-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.dash-stat {
  border: 1px solid var(--c-border);
  padding: 18px;
  text-align: center;
}
.dash-stat .num { display: block; font-family: var(--f-mono); font-size: 1.7rem; color: var(--c-atlas-cyan); }
.dash-stat .label { font-size: 0.75rem; color: var(--c-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.usage-bar { height: 8px; background: var(--c-void-soft); border: 1px solid var(--c-border); margin-top: 10px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: linear-gradient(90deg, var(--c-atlas-cyan), var(--c-green)); transition: width 0.4s var(--ease); }
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border: 1px solid var(--c-border-strong);
  color: var(--c-atlas-cyan);
}
.agent-usage-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.agent-usage-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.88rem; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.agent-usage-row:last-child { border-bottom: 0; }

@media (max-width: 780px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-stat-row { grid-template-columns: 1fr; }
}

/* Auth modal (used by agentes.js access control) */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 12, 0.78);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal-overlay.open { display: flex; }
.auth-modal {
  max-width: 420px;
  width: 100%;
  padding: 36px 32px;
  text-align: center;
  position: relative;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--c-text-faint);
  cursor: pointer;
  font-size: 1.1rem;
}
.auth-modal-close:hover { color: var(--c-atlas-cyan); }
.auth-modal h3 { font-size: 1.35rem; margin-bottom: 10px; }
.auth-modal p { font-size: 0.9rem; margin-bottom: 26px; }
.auth-modal .hero-actions { margin-bottom: 0; }

/* Instagram en footers (2026-09-19): muted -> cyan al hover. Especificidad
   (0,2,0) para ganar a `.footer a` / `.sidebar-footer-links a`. */
.footer-social .social-ig,
.sidebar-footer-links .social-ig,
.mobile-footer .social-ig {
  display: inline-flex; align-items: center; gap: 6px;
  color: #515a6b;
  transition: color 0.2s var(--ease);
}
.footer-social .social-ig:hover,
.sidebar-footer-links .social-ig:hover,
.mobile-footer .social-ig:hover,
.footer-social .social-ig:focus-visible,
.sidebar-footer-links .social-ig:focus-visible,
.mobile-footer .social-ig:focus-visible { color: #00C8FF; }
.sidebar-footer-links .social-ig svg { width: 14px; height: 14px; }
