/* =========================================================
   DeepAlign — sistema de diseño (familia DeepSoul)
   ========================================================= */

@import url("fuentes.css");

:root {
  --bg: #050507;
  --bg-2: #0a0a10;
  --bg-3: #101018;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-3: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.22);

  --text: #f4f4f7;
  --text-2: #a1a1b5;
  --text-3: #73738a;

  --cyan: #22d3ee;
  --blue: #3b82f6;
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --purple: #a855f7;
  --magenta: #d946ef;
  --link: #a5b4fc;

  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.12);
  --info: #a5b4fc;
  --info-bg: rgba(129, 140, 248, 0.14);

  --grad: linear-gradient(100deg, #67e8f9 0%, #818cf8 45%, #c084fc 75%, #f0abfc 100%);
  --grad-strong: linear-gradient(100deg, #22d3ee 0%, #6366f1 50%, #c026d3 100%);
  --grad-line: linear-gradient(90deg, transparent, #22d3ee 20%, #8b5cf6 60%, #d946ef 80%, transparent);

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 20px 50px -24px rgba(0,0,0,.8);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

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

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre, kbd { font-family: var(--font-mono); }

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.contenedor { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.suave { color: var(--text-2); }
.tenue { color: var(--text-3); }

.texto-degradado {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brillo 8s ease-in-out infinite alternate;
}
@keyframes brillo { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.grano {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.saltar {
  position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px;
  background: #fff; color: #000; border-radius: 999px; font-weight: 500; transition: top .2s;
}
.saltar:focus { top: 16px; }

/* ---------- Marca ---------- */

.marca { display: inline-flex; align-items: center; gap: 10px; }
.marca img { width: 32px; height: 32px; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .5)); }
.marca__texto { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.marca__texto span { font-weight: 300; color: var(--text-2); }
.marca__de { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line-2); font-size: 11px; }

/* ---------- Botones ---------- */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s, border-color .25s, color .25s, opacity .2s;
}
.boton svg { width: 16px; height: 16px; flex: none; }
.boton:disabled, .boton[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.boton--primario { background: #fff; color: #050507; }
.boton--primario:hover { transform: translateY(-1px); box-shadow: 0 10px 36px -8px rgba(139, 92, 246, .6); }
.boton--secundario {
  border-color: var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  color: var(--text);
}
.boton--secundario:hover { border-color: var(--line-3); background: rgba(255,255,255,.09); }
.boton--fantasma { color: var(--text-2); padding: 0 14px; }
.boton--fantasma:hover { color: var(--text); background: rgba(255,255,255,.06); }
.boton--peligro { background: var(--danger-bg); color: var(--danger); border-color: rgba(251,113,133,.3); }
.boton--peligro:hover { background: rgba(251,113,133,.2); }
.boton--ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(52,211,153,.3); }
.boton--ok:hover { background: rgba(52,211,153,.2); }
.boton--grande { min-height: 52px; padding: 0 28px; font-size: 15.5px; }
.boton--pequeno { min-height: 34px; padding: 0 14px; font-size: 13px; }
.boton--ancho { width: 100%; }
.boton--icono { width: 40px; padding: 0; min-height: 40px; }

/* ---------- Píldoras y etiquetas ---------- */

.pildora {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.pildora__punto {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(34, 211, 238, .6);
  animation: latido 2.6s ease-in-out infinite;
}
@keyframes latido { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.75); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip--aviso { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip--peligro { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.chip--info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.chip--plan { background: linear-gradient(100deg, rgba(103,232,249,.16), rgba(192,132,252,.18)); color: #e0e7ff; border-color: transparent; }

/* ---------- Tarjetas ---------- */

.tarjeta {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  box-shadow: var(--shadow);
}
.tarjeta--interior { padding: clamp(18px, 2.4vw, 26px); }
.tarjeta--resaltada { border-color: rgba(139, 92, 246, .45); box-shadow: 0 0 0 1px rgba(139,92,246,.18), var(--shadow); }
.tarjeta--aviso { border-color: rgba(251, 191, 36, .4); }

/* ---------- Formularios ---------- */

.campo { display: grid; gap: 7px; }
.campo > span:first-child, .campo__etiqueta { font-size: 14px; font-weight: 500; color: var(--text); }
.campo__ayuda { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.entrada, .campo input, .campo textarea, .campo select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: rgba(255,255,255,.035); color: var(--text);
  font-size: 15px; line-height: 1.45;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.campo textarea, textarea.entrada { resize: vertical; min-height: 96px; }
.entrada::placeholder, .campo input::placeholder, .campo textarea::placeholder { color: var(--text-3); }
.entrada:focus, .campo input:focus, .campo textarea:focus, .campo select:focus {
  outline: none; border-color: rgba(129, 140, 248, .7); background: rgba(255,255,255,.055);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .16);
}
.campo select option { background: var(--bg-3); }
.casilla { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.casilla input { width: 17px; height: 17px; accent-color: var(--violet); }
.error-texto { font-size: 13.5px; color: var(--danger); }
.ok-texto { font-size: 13.5px; color: var(--ok); }

/* ---------- Avisos emergentes ---------- */

.avisos {
  position: fixed; z-index: 300; right: 20px; bottom: 20px; display: grid; gap: 10px;
  width: min(380px, calc(100vw - 40px));
}
.aviso {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: var(--radius-md); border: 1px solid var(--line-2);
  background: rgba(16, 16, 24, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.9);
  font-size: 14px; color: var(--text);
  animation: aparece .4s var(--ease);
}
.aviso--error { border-color: rgba(251,113,133,.45); }
.aviso--ok { border-color: rgba(52,211,153,.4); }
@keyframes aparece { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Páginas sencillas del servidor ---------- */

.pantalla-centro {
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 32px 16px;
  background:
    radial-gradient(55% 45% at 50% 0%, rgba(99, 102, 241, .18), transparent 70%),
    radial-gradient(40% 40% at 85% 90%, rgba(168, 85, 247, .12), transparent 70%),
    var(--bg);
}
.tarjeta-centro {
  width: min(440px, 100%); display: grid; gap: 18px; padding: clamp(26px, 5vw, 38px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: var(--shadow);
}
.titulo-centro { font-family: var(--font-display); font-weight: 400; font-size: 26px; letter-spacing: -0.03em; line-height: 1.2; }
.texto-centro { color: var(--text-2); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
  }
}
