/* ============================================================================
   Test DISC · Vectriz — sistema visual "Compute Minimalism"
   Geist · deep space #0a1540 · acento violeta #6c43fa · glassmorphism
   ========================================================================== */

:root {
  /* Superficies */
  --bg:            #0a1540;
  --bg-deep:       #060d2b;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-2:     rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Marca */
  --violet:        #6c43fa;
  --violet-soft:   #9d84ff;
  --violet-200:    #cabeff;
  --cyan:          #57d7e9;

  /* Texto */
  --ink:           #ECEAF3;
  --ink-2:         #b9b3cc;
  --ink-3:         #837e96;

  /* Estado */
  --ok:            #5BE6B0;
  --danger:        #ff8a93;

  /* Forma */
  --r-sm: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-full: 9999px;

  /* Ritmo */
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --shadow-glow: 0 0 0 1px rgba(108,67,250,.0), 0 24px 60px -20px rgba(108,67,250,.35);

  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-weight: 500;
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Atmósfera: grid de cómputo + orbs ----------------------------------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(108,67,250,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(108,67,250,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.orb {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(90px); opacity: .5; pointer-events: none;
}
.orb--violet { width: 46vw; height: 46vw; left: -12vw; top: -10vw;
  background: radial-gradient(circle, rgba(108,67,250,.55), transparent 70%); }
.orb--cyan { width: 38vw; height: 38vw; right: -10vw; bottom: -14vw;
  background: radial-gradient(circle, rgba(87,215,233,.30), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(0) } to { transform: translateY(-40px) } }

/* --- Layout -------------------------------------------------------------- */
.wrap {
  position: relative; z-index: 1;
  max-width: 560px; margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3rem) var(--gutter) 4rem;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
}
.wrap--wide { max-width: 760px; justify-content: flex-start; }

/* --- Marca --------------------------------------------------------------- */
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem;
  text-decoration: none; color: var(--ink);
}
.brand__dot {
  width: 11px; height: 11px; border-radius: 3px;
  background: linear-gradient(135deg, var(--violet-soft), var(--violet));
  box-shadow: 0 0 16px rgba(108,67,250,.8);
}
.kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem; border-radius: var(--r-full);
  background: rgba(108,67,250,.12); border: 1px solid rgba(108,67,250,.28);
  color: var(--violet-200); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}

/* --- Card glass ---------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: 0 24px 70px -30px rgba(0,0,0,.6);
}

h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.lead { color: var(--ink-2); font-size: 1rem; margin-top: .6rem; }
.muted { color: var(--ink-3); font-size: .85rem; }
a { color: var(--violet-soft); text-decoration-color: rgba(157,132,255,.4); text-underline-offset: 3px; }

/* --- Formulario ---------------------------------------------------------- */
.field { margin-top: 1.1rem; }
.field > label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }
.field .opt { color: var(--ink-3); font-weight: 500; }
.input {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(8,12,40,.6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .8rem .9rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none; border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(108,67,250,.25);
  background: rgba(8,12,40,.85);
}

/* Consentimiento */
.consent {
  display: flex; gap: .7rem; align-items: flex-start;
  margin-top: 1.4rem; padding: .9rem 1rem;
  background: rgba(8,12,40,.5); border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: .82rem; color: var(--ink-2); line-height: 1.45;
  cursor: pointer; transition: border-color .2s;
}
.consent:hover { border-color: var(--border-strong); }
.consent input { appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: rgba(255,255,255,.04);
  cursor: pointer; position: relative; transition: background .2s, border-color .2s; }
.consent input:checked { background: var(--violet); border-color: var(--violet); }
.consent input:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.consent input:focus-visible { box-shadow: 0 0 0 3px rgba(108,67,250,.3); }

/* --- Botones ------------------------------------------------------------- */
.btn {
  appearance: none; font: inherit; font-weight: 600; cursor: pointer;
  border: 0; border-radius: var(--r-full);
  padding: .85rem 1.5rem; transition: transform .12s, box-shadow .25s, opacity .2s, background .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn--primary {
  background: linear-gradient(135deg, var(--violet-soft), var(--violet));
  color: #fff; box-shadow: var(--shadow-glow);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 22px 50px -16px rgba(108,67,250,.6); }
.btn--primary:active:not(:disabled) { transform: scale(.97); }
.btn--ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover:not(:disabled) { border-color: var(--border-strong); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--lg { padding: 1rem 1.6rem; font-size: 1.02rem; }

.form-foot { margin-top: 1.6rem; }
.error {
  display: none; margin-top: 1rem; padding: .7rem .9rem;
  background: rgba(255,138,147,.1); border: 1px solid rgba(255,138,147,.3);
  border-radius: var(--r-md); color: var(--danger); font-size: .85rem;
}
.error.show { display: block; }

/* ============================================================================
   PANTALLA DEL TEST
   ========================================================================== */
.test-head { margin-bottom: 1.4rem; }
.progress {
  display: flex; align-items: center; gap: .9rem; margin-top: 1rem;
}
.progress__track { flex: 1; height: 7px; border-radius: var(--r-full);
  background: rgba(255,255,255,.08); overflow: hidden; }
.progress__bar { height: 100%; width: 0;
  background: linear-gradient(90deg, var(--violet), var(--violet-soft));
  border-radius: var(--r-full); transition: width .45s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 14px rgba(108,67,250,.7); }
.progress__count { font-size: .8rem; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }

.prompt { margin: .2rem 0 1.3rem; }
.prompt h2 { font-size: 1.25rem; }
.prompt p { color: var(--ink-2); font-size: .9rem; margin-top: .35rem; }
.prompt .legend { display: flex; gap: 1.1rem; margin-top: .8rem; font-size: .76rem; color: var(--ink-3); }
.prompt .legend b { color: var(--ink-2); font-weight: 600; }
.tag-mas, .tag-menos { display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: var(--r-sm); font-weight: 700; font-size: .8rem; }
.tag-mas { background: rgba(108,67,250,.2); color: var(--violet-soft); }
.tag-menos { background: rgba(87,215,233,.16); color: var(--cyan); }

/* Filas de adjetivos */
.options { display: flex; flex-direction: column; gap: .6rem; }
.opt-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem;
  padding: .35rem .4rem .35rem 1rem;
  background: rgba(8,12,40,.45); border: 1px solid var(--border);
  border-radius: var(--r-md); transition: border-color .2s, background .2s, transform .12s;
}
.opt-row[data-state="mas"]   { border-color: rgba(108,67,250,.6);  background: rgba(108,67,250,.10); }
.opt-row[data-state="menos"] { border-color: rgba(87,215,233,.5);  background: rgba(87,215,233,.07); }
.opt-row__word { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.mark {
  appearance: none; border: 1px solid var(--border-strong); cursor: pointer;
  width: 2.6rem; height: 2.6rem; border-radius: var(--r-sm);
  background: rgba(255,255,255,.03); color: var(--ink-3);
  font-weight: 700; font-size: 1.1rem; line-height: 1;
  transition: all .16s; display: inline-flex; align-items: center; justify-content: center;
}
.mark:hover { transform: translateY(-1px); border-color: var(--border-strong); color: var(--ink); }
.mark[aria-pressed="true"][data-kind="mas"] {
  background: var(--violet); border-color: var(--violet); color: #fff;
  box-shadow: 0 8px 22px -8px rgba(108,67,250,.8); }
.mark[aria-pressed="true"][data-kind="menos"] {
  background: rgba(87,215,233,.18); border-color: var(--cyan); color: var(--cyan); }

.test-nav { display: flex; gap: .8rem; margin-top: 1.6rem; }
.test-nav .btn { flex: 1; }
.test-nav .spacer { flex: 1; }

/* ============================================================================
   GRACIAS
   ========================================================================== */
.center { text-align: center; }
.seal {
  width: 76px; height: 76px; margin: 0 auto 1.5rem; border-radius: var(--r-full);
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(108,67,250,.35), rgba(8,12,40,.6));
  border: 1px solid rgba(108,67,250,.4);
  box-shadow: 0 0 50px -8px rgba(108,67,250,.55);
}
.seal svg { width: 36px; height: 36px; }

/* ============================================================================
   DOCUMENTO (privacidad)
   ========================================================================== */
.doc { line-height: 1.7; }
.doc h1 { margin-bottom: .4rem; }
.doc h2 { margin: 2rem 0 .6rem; color: var(--violet-200); font-size: 1.05rem; }
.doc p, .doc li { color: var(--ink-2); font-size: .95rem; }
.doc ul { padding-left: 1.2rem; margin: .5rem 0; }
.doc li { margin: .3rem 0; }
.doc .back { display: inline-block; margin-top: 2.2rem; }

/* --- Pie ----------------------------------------------------------------- */
.foot { margin-top: 2rem; text-align: center; }
.foot .muted { font-size: .78rem; }

/* ============================================================================
   ENTRADA (page-load stagger)
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.rise-1 { animation-delay: .05s; } .rise-2 { animation-delay: .13s; }
.rise-3 { animation-delay: .21s; } .rise-4 { animation-delay: .29s; }

/* ============================================================================
   PANEL ADMIN
   ========================================================================== */
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.4rem;
}
.admin-head h1 { font-size: 1.5rem; }
.admin-actions { display: flex; gap: .6rem; align-items: center; }
.toast { font-size: .8rem; color: var(--ok); opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
thead th {
  text-align: left; font-weight: 600; font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
  padding: .8rem 1rem; background: rgba(8,12,40,.5); border-bottom: 1px solid var(--border);
}
tbody td { padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tr.dup { opacity: .5; }
.cell-name { font-weight: 600; color: var(--ink); }
.cell-sub { color: var(--ink-3); font-size: .78rem; }
.perfil-chip {
  display: inline-block; font-weight: 700; letter-spacing: .04em;
  padding: .15rem .5rem; border-radius: var(--r-sm);
  background: rgba(108,67,250,.18); color: var(--violet-soft);
}

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: var(--r-full);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--done { background: rgba(91,230,176,.12); color: var(--ok); }
.badge--prog { background: rgba(245,179,1,.12); color: #F5B301; }
.badge--dup  { background: rgba(255,255,255,.06); color: var(--ink-3); }

.btn--sm { padding: .45rem .85rem; font-size: .8rem; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
