:root {
  --bg: #07060d;
  --bg-2: #0d0b16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-solid: #13101f;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f3f0ff;
  --muted: #a39db8;
  --dim: #6d6784;
  --p1: #4c3a72;
  --p2: #6d4fb0;
  --p3: #b9a8dc;
  --pink: #9d7fd1;
  --grad: #6d4fb0;
  --grad-soft: rgba(109, 79, 176, 0.16);
  --grad-text: linear-gradient(120deg, #cabce8 0%, #b9a8dc 100%);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.12);
  --warn: #fbbf24;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 10px rgba(109, 79, 176, 0.4);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
::selection { background: rgba(109, 79, 176, 0.45); }
:focus-visible { outline: 2px solid var(--p3); outline-offset: 2px; }

.ic { width: 17px; height: 17px; flex-shrink: 0; }
.muted { color: var(--muted); }
.hint { color: var(--dim); font-size: 13px; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--p3); margin-bottom: 10px; }

/* Fondo con brillos */
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-glow span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: flotar 18s ease-in-out infinite alternate; }
.bg-glow span:nth-child(1) { width: 520px; height: 520px; background: #5b21b6; top: -200px; left: -120px; }
.bg-glow span:nth-child(2) { width: 420px; height: 420px; background: #86198f; top: 30%; right: -180px; opacity: 0.35; animation-delay: -6s; }
.bg-glow span:nth-child(3) { width: 380px; height: 380px; background: #4c1d95; bottom: -200px; left: 30%; opacity: 0.4; animation-delay: -12s; }
@keyframes flotar { to { transform: translate(40px, 30px) scale(1.08); } }
#app { position: relative; z-index: 1; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; position: relative; overflow: hidden;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.btn-primary:hover { box-shadow: 0 14px 34px -10px rgba(109, 79, 176, 0.85); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover { border-color: rgba(109, 79, 176, 0.5); background: rgba(109, 79, 176, 0.1); }
.btn-danger { background: linear-gradient(135deg, #e11d48, #be185d); color: #fff; box-shadow: 0 10px 26px -12px rgba(225, 29, 72, 0.8); }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: girar 0.7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease), border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--p3); font-weight: 600; padding: 8px 4px; transition: color 0.2s, gap 0.2s var(--ease); }
.link-btn:hover { color: #e9d5ff; gap: 9px; }
.link-btn .ic { width: 16px; height: 16px; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.chip .ic { width: 14px; height: 14px; }
.chip-accent { background: var(--grad-soft); border-color: rgba(109, 79, 176, 0.4); color: #e9d5ff; }
.chip-ok { background: var(--ok-bg); border-color: rgba(52, 211, 153, 0.35); color: var(--ok); }
.chip-bad { background: var(--bad-bg); border-color: rgba(251, 113, 133, 0.35); color: var(--bad); }
.chip-demo { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); color: var(--warn); }
.chip-role { background: var(--grad-soft); border-color: rgba(109, 79, 176, 0.35); color: #e9d5ff; margin-top: 8px; align-self: flex-start; }
.chip-glass { background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.15); color: #fff; backdrop-filter: blur(8px); }
.chip-closed { color: #fecdd3; }
.chip.big { padding: 7px 14px; font-size: 14px; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; color: var(--dim); }
.field input, .field textarea, .answer-input {
  width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border); outline: none; resize: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder, .field textarea::placeholder, .answer-input::placeholder { color: var(--dim); }
.field input:focus, .field textarea:focus, .answer-input:focus {
  border-color: rgba(109, 79, 176, 0.7); box-shadow: 0 0 0 4px rgba(109, 79, 176, 0.15); background: rgba(0, 0, 0, 0.5);
}
.field.compact { margin: 14px 0 0; }
.form-msg { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; animation: aparecer 0.3s var(--ease); }
.form-msg.err { background: var(--bad-bg); color: #fecdd3; border: 1px solid rgba(251, 113, 133, 0.3); }
.form-msg.info { background: rgba(109, 79, 176, 0.12); color: #e9d5ff; border: 1px solid rgba(109, 79, 176, 0.3); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw { width: 42px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); position: relative; transition: background 0.25s; flex-shrink: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.switch input:checked + .sw { background: var(--grad); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--p3); outline-offset: 2px; }
.switch input:disabled + .sw { opacity: 0.4; }
.switch.sm .sw { width: 34px; height: 20px; }
.switch.sm .sw::after { width: 14px; height: 14px; }
.switch.sm input:checked + .sw::after { transform: translateX(14px); }
.sw-label { font-size: 13px; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.switch-row:first-of-type { border-top: 0; }
.switch-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch-row.disabled { opacity: 0.5; cursor: default; }
.switch-row.inline { border: 0; padding: 0; justify-content: flex-start; gap: 12px; }

/* Marca */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); box-shadow: var(--glow); color: #fff; }
.brand-mark .ic { width: 18px; height: 18px; stroke-width: 3; }
.brand-name { font-size: 16px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { position: relative; padding: 48px 56px; display: flex; flex-direction: column; gap: 40px; overflow: hidden; }
.auth-brand::before {
  content: ''; position: absolute; inset: 20px; border-radius: 28px; z-index: -1;
  background: radial-gradient(120% 90% at 0% 0%, rgba(109, 79, 176, 0.35), transparent 60%), radial-gradient(90% 80% at 100% 100%, rgba(109, 79, 176, 0.25), transparent 60%), rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}
.auth-copy { max-width: 520px; margin-top: auto; }
.auth-copy h1 { font-size: clamp(28px, 3.1vw, 40px); font-weight: 800; margin-bottom: 16px; letter-spacing: -0.03em; }
.auth-copy > .muted { font-size: 16px; max-width: 440px; }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.features li { display: flex; align-items: center; gap: 12px; color: #ddd6fe; font-weight: 500; }
.features li span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(109, 79, 176, 0.3); color: var(--p3); }
.auth-preview { position: relative; height: 170px; margin-bottom: auto; max-width: 420px; }
.ap-card { position: absolute; left: 0; top: 0; width: 280px; padding: 18px; border-radius: 16px; background: rgba(19, 16, 31, 0.8); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: grid; gap: 12px; transform: rotate(-3deg); animation: flotar2 7s ease-in-out infinite alternate; }
.ap-line { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
.ap-line.w60 { width: 60%; height: 11px; background: rgba(255, 255, 255, 0.25); }
.ap-line.w50 { width: 50%; } .ap-line.w40 { width: 40%; } .ap-line.w30 { width: 30%; }
.ap-opt { display: flex; align-items: center; gap: 10px; }
.ap-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); }
.ap-dot.on { border-color: var(--p2); background: radial-gradient(circle, var(--p2) 40%, transparent 45%); }
.ap-score { position: absolute; left: 230px; top: 70px; padding: 14px 18px; border-radius: 16px; background: var(--grad); box-shadow: var(--glow); display: flex; flex-direction: column; transform: rotate(4deg); animation: flotar2 6s ease-in-out infinite alternate-reverse; }
.ap-score strong { font-size: 26px; line-height: 1; }
.ap-score span { font-size: 12px; opacity: 0.85; }
@keyframes flotar2 { to { translate: 0 -8px; } }

.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; border-radius: 24px; background: rgba(16, 13, 26, 0.75); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(20px); animation: subir 0.5s var(--ease); }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border); margin-bottom: 26px; }
.seg-btn { position: relative; z-index: 1; background: none; border: 0; padding: 9px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color 0.25s; }
.seg-btn.active { color: #fff; }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--grad); box-shadow: var(--glow); transition: transform 0.35s var(--ease); }
.seg.der .seg-ind { transform: translateX(100%); }
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 21px; margin-bottom: 4px; }
.demo-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--border-2); }
.demo-note .ic { width: 16px; height: 16px; color: var(--p3); margin-top: 2px; }

/* ---------- Estructura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; background: rgba(7, 6, 13, 0.72); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.brand-link { transition: opacity 0.2s; }
.brand-link:hover { opacity: 0.85; }
.container { max-width: 1120px; margin: 0 auto; padding: 30px 28px 72px; }
.container.narrow { max-width: 820px; }

.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(109, 79, 176, 0.5); transition: transform 0.2s var(--ease); }
button.avatar:hover { transform: scale(1.05); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; box-shadow: none; }
.user-menu, .fc-menu { position: relative; }
.dropdown, .menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: 14px; z-index: 30;
  background: rgba(22, 18, 36, 0.96); border: 1px solid var(--border-2); box-shadow: var(--shadow); backdrop-filter: blur(20px);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right; pointer-events: none; transition: opacity 0.18s, transform 0.2s var(--ease);
}
.dropdown.open, .menu.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head span { color: var(--muted); font-size: 13px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; background: none; border: 0; text-align: left; font-size: 14px; color: var(--text); transition: background 0.15s; }
.dropdown-item .ic { width: 16px; height: 16px; color: var(--muted); }
.dropdown-item:hover { background: rgba(109, 79, 176, 0.14); }
.dropdown-item.danger { color: var(--bad); }
.dropdown-item.danger .ic { color: var(--bad); }
.dropdown-item.danger:hover { background: var(--bad-bg); }

/* ---------- Panel ---------- */
.hero-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 210px;
  margin-bottom: 34px; padding: 34px 48px 34px 40px; border-radius: 26px; overflow: hidden; animation: subir 0.5s var(--ease);
  background:
    radial-gradient(560px 280px at 82% 65%, rgba(109, 79, 176, 0.35), transparent 65%),
    linear-gradient(120deg, #14101f 0%, #221a38 55%, #2c2044 100%);
  border: 1px solid rgba(109, 79, 176, 0.3);
}
.hb-text { position: relative; z-index: 1; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.hb-text h1 { font-size: clamp(22px, 2.6vw, 29px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.hb-acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.soon-chip { color: var(--muted); }
.hb-mascota {
  position: relative; z-index: 1; flex-shrink: 0; width: 190px; height: 190px; border-radius: 50%; display: flex;
  align-items: flex-end; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #efeafb 0%, #d9cdef 45%, #b9a8dc 72%, transparent 74%);
  box-shadow: 0 0 24px rgba(109, 79, 176, 0.3);
}
.hb-mascota img { width: 78%; margin-bottom: 6%; animation: flotarFoca 4.5s ease-in-out infinite; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; margin-right: auto; }
.tabs-filtro { display: flex; gap: 6px; }
.chip-filtro {
  padding: 8px 14px; border-radius: 99px; border: 1px solid transparent; background: var(--surface-2); color: var(--muted);
  font-size: 12.5px; font-weight: 700; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-filtro:hover { color: var(--text); }
.chip-filtro.sel { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); width: min(300px, 100%); transition: border-color 0.2s, box-shadow 0.2s; }
.search:focus-within { border-color: rgba(109, 79, 176, 0.6); box-shadow: 0 0 0 4px rgba(109, 79, 176, 0.12); }
.search .ic { color: var(--dim); width: 16px; height: 16px; }
.search input { flex: 1; background: none; border: 0; outline: none; padding: 10px 0; min-width: 0; }

.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.form-card {
  position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.3s; animation: subir 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.form-card:hover { transform: translateY(-3px); border-color: rgba(109, 79, 176, 0.45); box-shadow: 0 20px 40px -24px rgba(109, 79, 176, 0.9); }
.fc-cover { position: relative; display: flex; align-items: flex-start; gap: 6px; height: 110px; padding: 12px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.fc-cover.examen { background: linear-gradient(135deg, #4c1d95 0%, #7e22ce 55%, #a21caf 100%); }
.fc-cover.encuesta { background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 60%, #4c3a72 100%); }
.fc-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 120%, rgba(255, 255, 255, 0.25), transparent 50%); }
.fc-art { position: absolute; right: 14px; bottom: -10px; color: rgba(255, 255, 255, 0.2); transition: transform 0.4s var(--ease); }
.fc-art .ic { width: 84px; height: 84px; stroke-width: 1.5; }
.form-card:hover .fc-art { transform: translateY(-4px) rotate(-6deg); }
.fc-body { padding: 16px 18px 18px; }
.fc-title { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; padding-right: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.fc-meta span, .fc-date { display: inline-flex; align-items: center; gap: 5px; }
.fc-meta .ic, .fc-date .ic { width: 14px; height: 14px; }
.fc-date { color: var(--dim); font-size: 12px; margin-top: 8px; }
.fc-menu { position: absolute; right: 8px; top: 122px; }
.form-card.skeleton { height: 214px; background: linear-gradient(100deg, var(--surface) 40%, rgba(255, 255, 255, 0.07) 50%, var(--surface) 60%) 0 0 / 200% 100%; animation: brillo 1.4s linear infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px; border-radius: var(--radius); border: 1px dashed var(--border-2); background: rgba(255, 255, 255, 0.015); }
.empty > .ic { width: 32px; height: 32px; color: var(--dim); }
.empty.small { padding: 28px; }
.empty-art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(109, 79, 176, 0.35); color: var(--p3); margin-bottom: 6px; }
.empty-art .ic { width: 28px; height: 28px; }
.empty .btn { margin-top: 8px; }

/* ---------- Editor ---------- */
.editor-bar { display: grid; grid-template-columns: 1fr auto 1fr; padding: 10px 20px; }
.eb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eb-title { display: flex; flex-direction: column; min-width: 0; }
.eb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dim); transition: color 0.3s; }
.save-state .ic { width: 13px; height: 13px; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--bad); }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.save-state.saving .dot { animation: pulso 0.9s ease-in-out infinite; color: var(--p3); }
.save-state.pend { color: var(--warn); }
@keyframes pulso { 50% { opacity: 0.3; transform: scale(0.7); } }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); transition: color 0.2s, background 0.25s; }
.tab .ic { width: 16px; height: 16px; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.active { color: #fff; background: var(--grad); box-shadow: var(--glow); }
.eb-actions { display: flex; justify-content: flex-end; gap: 8px; }

.editor { padding-top: 28px; }
.q-card {
  position: relative; padding: 22px 24px; border-radius: var(--radius); background: rgba(16, 13, 26, 0.7); border: 1px solid var(--border);
  margin-bottom: 16px; transition: border-color 0.25s, box-shadow 0.3s; animation: subir 0.4s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 30ms);
}
.q-card:focus-within { border-color: rgba(109, 79, 176, 0.55); box-shadow: 0 0 0 1px rgba(109, 79, 176, 0.25), 0 20px 40px -24px rgba(109, 79, 176, 0.8); }
.q-card::before { content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--grad); opacity: 0; transition: opacity 0.25s; }
.q-card:focus-within::before { opacity: 1; }
.q-card.nuevo { animation: resaltar 1.2s var(--ease); }
@keyframes resaltar { 0% { box-shadow: 0 0 0 3px rgba(109, 79, 176, 0.6); } 100% { box-shadow: 0 0 0 0 rgba(109, 79, 176, 0); } }
.header-card { padding-top: 30px; overflow: hidden; }
.header-card::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--grad); }
.header-card::before { display: none; }
.title-input { width: 100%; background: none; border: 0; outline: none; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; padding: 4px 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.title-input:focus { border-bottom-color: rgba(109, 79, 176, 0.6); }
.desc-input { width: 100%; background: none; border: 0; outline: none; resize: none; color: var(--muted); margin-top: 6px; padding: 4px 0; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.desc-input:focus { border-bottom-color: rgba(109, 79, 176, 0.4); }
.header-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.q-top-mini { margin-bottom: 10px; }
.q-num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--grad-soft); border: 1px solid rgba(109, 79, 176, 0.35); color: #e9d5ff; flex-shrink: 0; }
.select { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); transition: border-color 0.2s; }
.select:hover, .select:focus-within { border-color: rgba(109, 79, 176, 0.5); }
.select .ic { width: 16px; height: 16px; color: var(--p3); }
.select .chev { color: var(--dim); pointer-events: none; }
.select select { appearance: none; background: none; border: 0; outline: none; padding: 8px 4px 8px 0; font-weight: 600; font-size: 14px; cursor: pointer; }
.select option { background: var(--surface-solid); }
.pts { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); font-size: 13px; color: var(--muted); transition: border-color 0.2s; }
.pts:focus-within { border-color: rgba(109, 79, 176, 0.6); }
.pts input { width: 42px; background: none; border: 0; outline: none; padding: 7px 0; text-align: right; font-weight: 700; color: var(--text); -moz-appearance: textfield; }
.pts input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pts.wide input { width: 52px; }
.q-text { width: 100%; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; border-radius: 12px; outline: none; resize: none; font-size: 15px; font-weight: 600; padding: 11px 14px; transition: border-color 0.2s, background 0.2s; }
.q-text:focus { border-color: rgba(109, 79, 176, 0.5); background: rgba(0, 0, 0, 0.3); }
.q-text::placeholder { color: var(--dim); font-weight: 500; }
.q-body { margin-top: 14px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s; animation: aparecer 0.3s var(--ease); }
.opt:hover { background: rgba(255, 255, 255, 0.03); }
.opt.is-correct { background: var(--ok-bg); border-color: rgba(52, 211, 153, 0.3); }
.mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: none; display: grid; place-items: center; color: transparent; flex-shrink: 0; transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s var(--ease); }
.mark.sq { border-radius: 8px; }
.mark .ic { width: 14px; height: 14px; stroke-width: 3; }
.mark:not(.off):hover { border-color: var(--ok); color: rgba(52, 211, 153, 0.6); }
.mark:not(.off):active { transform: scale(0.88); }
.mark.off { cursor: default; }
.is-correct .mark { background: var(--ok); border-color: var(--ok); color: #052e1f; }
.opt-input { flex: 1; min-width: 0; background: none; border: 0; border-bottom: 1px solid transparent; outline: none; padding: 6px 2px; transition: border-color 0.2s; }
.opt-input:focus { border-bottom-color: rgba(109, 79, 176, 0.6); }
.opt-input[readonly] { cursor: default; }
.fake-input { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border-2); color: var(--dim); font-size: 14px; }
.fake-input.tall { height: 76px; }
.q-aviso-row:not(:empty) { margin-top: 14px; }
.q-aviso { font-size: 13px; }
.q-warn, .q-ok { display: inline-flex; align-items: center; gap: 6px; }
.q-warn { color: var(--warn); } .q-ok { color: var(--ok); }
.q-warn .ic, .q-ok .ic { width: 15px; height: 15px; }

/* Barra flotante de herramientas (tipo, puntos, obligatoria, imagen, mover, duplicar, eliminar) */
.q-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding: 7px;
  border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); align-self: flex-start;
}
.q-toolbar .pts { margin-left: 0; }
.q-toolbar .switch.sm { margin: 0 2px; }
.q-toolbar .apoyo-btn { padding: 7px 12px; }
.tb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

/* Fila resumen de una pregunta colapsada (se expande al hacer clic) */
.q-row {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 16px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); cursor: pointer; text-align: left;
  font: inherit; color: inherit; transition: border-color 0.2s, background 0.2s; animation: subir 0.4s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 8) * 30ms);
}
.q-row:hover, .q-row:focus-visible { border-color: rgba(109, 79, 176, 0.4); background: rgba(109, 79, 176, 0.06); }
.q-row .q-num { background: rgba(255, 255, 255, 0.05); border-color: var(--border); color: var(--muted); }
.q-row-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500; }
.q-row-text em { color: var(--dim); font-style: normal; }
.q-row-meta { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.q-row-estado { flex-shrink: 0; display: grid; place-items: center; }
.q-row-estado .ic { width: 15px; height: 15px; }
.q-row-estado.ok { color: var(--ok); }
.q-row-estado.warn { color: var(--warn); }
.q-row-estado.manual { color: var(--p3); }

.add-q { position: relative; display: flex; justify-content: center; margin-top: 8px; }
.btn-add { padding: 13px 22px; border-radius: 14px; border: 1px dashed rgba(109, 79, 176, 0.5); background: rgba(109, 79, 176, 0.06); color: #e9d5ff; width: 100%; }
.btn-add:hover { background: rgba(109, 79, 176, 0.12); border-style: solid; box-shadow: 0 12px 30px -16px rgba(109, 79, 176, 0.8); }
.type-menu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; width: min(520px, 100%); display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 8px; border-radius: 16px;
  background: rgba(22, 18, 36, 0.97); border: 1px solid var(--border-2); box-shadow: var(--shadow); backdrop-filter: blur(20px); z-index: 10;
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px) scale(0.98); transition: opacity 0.2s, transform 0.25s var(--ease);
}
.type-menu.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.type-opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; background: none; text-align: left; font-weight: 600; font-size: 14px; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); }
.type-opt .ic { color: var(--p3); }
.type-opt:hover { background: rgba(109, 79, 176, 0.14); border-color: rgba(109, 79, 176, 0.3); }
.type-opt:active { transform: scale(0.97); }

.panel { padding: 20px 24px; border-radius: var(--radius); background: rgba(16, 13, 26, 0.7); border: 1px solid var(--border); margin-bottom: 16px; animation: subir 0.4s var(--ease) both; }
.panel h3 { display: flex; align-items: center; gap: 10px; font-size: 14.5px; margin-bottom: 6px; }
.panel h3 .ic { color: var(--p3); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 28px 0 12px; }
.section-title .ic { color: var(--p3); }

/* Respuestas */
.resp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; display: flex; flex-direction: column; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; animation: subir 0.4s var(--ease) both; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(109, 79, 176, 0.25), transparent 70%); }
.stat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--p3); margin-bottom: 12px; }
.stat.ok .stat-ic { background: var(--ok-bg); color: var(--ok); }
.stat strong { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat > span:last-child { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; margin: 10px -8px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover { background: rgba(109, 79, 176, 0.07); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.person { display: flex; align-items: center; gap: 10px; }
.person > span:last-child { display: flex; flex-direction: column; }
.person small { color: var(--muted); font-size: 12px; }
.q-summary .qs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.q-summary .qs-head strong { flex: 1; }
.q-summary > .hint { margin-bottom: 12px; }
.bar-row { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.bar-label span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.bar-label span:last-child { color: var(--muted); font-size: 13px; }
.bar-label .ic { width: 15px; height: 15px; color: var(--ok); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--grad); animation: crecer 0.9s var(--ease) both; }
.bar-row.ok .bar span { background: linear-gradient(90deg, #059669, #34d399); }
@keyframes crecer { from { width: 0; } }
.text-answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.text-answers li { padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); font-size: 14px; }

.resp-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-right: 36px; }
.resp-detail-head > div:nth-child(2) { flex: 1; min-width: 0; }
.score-pill { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; border-radius: 14px; }
.score-pill strong { font-size: 22px; line-height: 1.1; }
.score-pill span { font-size: 12px; opacity: 0.8; }
.score-pill.ok { background: var(--ok-bg); color: var(--ok); }
.score-pill.bad { background: var(--bad-bg); color: var(--bad); }
.resp-detail { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.rd-item { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.rd-item.ok { border-color: rgba(52, 211, 153, 0.3); }
.rd-item.bad { border-color: rgba(251, 113, 133, 0.3); }
.rd-q { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rd-q strong { flex: 1; }
.rd-pts { font-size: 13px; font-weight: 700; color: var(--muted); }
.rd-a { display: flex; align-items: flex-start; gap: 8px; padding-left: 38px; }
.rd-a .ic { width: 16px; height: 16px; margin-top: 3px; }
.rd-item.ok .rd-a .ic { color: var(--ok); }
.rd-item.bad .rd-a .ic { color: var(--bad); }
.rd-correct { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0 38px; font-size: 13px; color: var(--ok); }
.rd-correct .ic { width: 14px; height: 14px; }
.rd-correct strong { color: var(--text); }

/* Modales y toasts */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(4, 3, 8, 0.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.modal-backdrop.show { opacity: 1; }
.modal-card { position: relative; width: 100%; max-width: 460px; padding: 28px; border-radius: 22px; background: linear-gradient(180deg, rgba(30, 24, 50, 0.98), rgba(16, 13, 26, 0.98)); border: 1px solid var(--border-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(109, 79, 176, 0.1); transform: translateY(12px) scale(0.97); transition: transform 0.3s var(--ease); }
.modal-card.wide { max-width: 640px; }
.modal-backdrop.show .modal-card { transform: none; }
.modal-card h3 { font-size: 20px; margin-bottom: 6px; }
.modal-x { position: absolute; top: 16px; right: 16px; }
.modal-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow); margin-bottom: 16px; }
.modal-icon.danger { background: linear-gradient(135deg, #e11d48, #be185d); box-shadow: 0 10px 26px -12px rgba(225, 29, 72, 0.8); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 6px 6px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border); }
.copy-row .copy-ic { color: var(--p3); display: grid; }
.copy-row input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 13px; color: var(--muted); }
.modal-card .switch-row { margin-top: 12px; border-top: 1px solid var(--border); padding-bottom: 0; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: rgba(28, 22, 44, 0.96); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; opacity: 0; transform: translateY(12px); transition: opacity 0.25s, transform 0.3s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast-ok .ic { color: var(--ok); }
.toast-err .ic { color: var(--bad); }

.loader { display: grid; place-items: center; padding: 80px 0; }
.loader span { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(109, 79, 176, 0.2); border-top-color: var(--p2); animation: girar 0.8s linear infinite; }

/* ---------- Página pública ---------- */
.public-bar { display: flex; justify-content: center; padding: 18px; }
.preview-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; font-size: 13px; font-weight: 600; color: var(--warn); background: rgba(251, 191, 36, 0.08); border-block: 1px solid rgba(251, 191, 36, 0.2); }
.preview-banner .ic { width: 16px; height: 16px; }
.public .container { padding-top: 12px; }
.pf-hero { position: relative; padding: 34px 30px 28px; border-radius: 22px; margin-bottom: 18px; overflow: hidden; background: linear-gradient(135deg, #3b0764 0%, #6b21a8 50%, #86198f 100%); box-shadow: 0 30px 60px -30px rgba(109, 79, 176, 0.8); animation: subir 0.5s var(--ease); }
.pf-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%); }
.pf-hero h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin-bottom: 8px; position: relative; }
.pf-hero p { color: rgba(255, 255, 255, 0.82); position: relative; }
.pf-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; }
.req-note { margin-top: 14px; font-size: 13px; }
.req { color: #f0abfc; margin-left: 4px; }
.public-q .field:last-of-type { margin-bottom: 0; }
.pq-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pq-head h3 { flex: 1; font-size: 17px; font-weight: 600; padding-top: 3px; }
.public-q > .hint { margin: -6px 0 12px 40px; }
.choices { display: grid; gap: 8px; }
.choices.row { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease); }
.choice:hover { border-color: rgba(109, 79, 176, 0.45); background: rgba(109, 79, 176, 0.06); }
.choice:active { transform: scale(0.99); }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.ind { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); display: grid; place-items: center; color: transparent; flex-shrink: 0; transition: all 0.2s var(--ease); }
.ind.checkbox { border-radius: 7px; }
.ind .ic { width: 13px; height: 13px; stroke-width: 3.5; transform: scale(0.4); transition: transform 0.25s var(--ease); }
.choice:has(input:checked) { border-color: rgba(109, 79, 176, 0.7); background: rgba(109, 79, 176, 0.12); box-shadow: 0 0 0 1px rgba(109, 79, 176, 0.3); }
.choice input:checked + .ind { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.choice input:checked + .ind .ic { transform: scale(1); }
.choice input:focus-visible + .ind { outline: 2px solid var(--p3); outline-offset: 2px; }
.answer-input { font-size: 15px; }
.q-error { display: none; align-items: center; gap: 6px; margin-top: 12px; color: var(--bad); font-size: 13px; }
.q-error .ic { width: 15px; height: 15px; }
.public-q.invalid { border-color: rgba(251, 113, 133, 0.55); animation: sacudir 0.35s; }
.public-q.invalid .q-error { display: flex; }
@keyframes sacudir { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pf-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.pf-actions.center { justify-content: center; margin-top: 20px; }

.result-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 28px; border-radius: 24px; background: rgba(16, 13, 26, 0.75); border: 1px solid var(--border); box-shadow: var(--shadow); animation: subir 0.5s var(--ease); }
.result-card h2 { font-size: 24px; }
.result-card > .ic.big { width: 44px; height: 44px; }
.result-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow); animation: pop 0.5s var(--ease); }
.result-icon .ic { width: 34px; height: 34px; stroke-width: 2.5; }
.result-icon.muted-icon { background: var(--surface-2); color: var(--muted); box-shadow: none; }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: none; opacity: 1; } }
.ring { position: relative; width: 170px; height: 170px; margin-bottom: 6px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#rg); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; box-shadow: 0 0 40px -6px rgba(109, 79, 176, 0.55); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text strong { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ring-text span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.public .rd-item.panel { margin-bottom: 10px; animation-delay: calc(min(var(--i, 0), 10) * 40ms); }

@keyframes subir { from { opacity: 0; transform: translateY(10px); } }
@keyframes aparecer { from { opacity: 0; } }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px 8px; gap: 24px; }
  .auth-brand::before, .auth-preview, .features { display: none; }
  .auth-copy { margin-top: 0; }
  .auth-copy h1 { font-size: 28px; }
  .hero-banner { flex-direction: column-reverse; text-align: center; padding: 24px; min-height: 0; }
  .hb-text { max-width: none; align-items: center; }
  .hb-mascota { width: 130px; height: 130px; }
  .editor-bar { grid-template-columns: 1fr auto; row-gap: 10px; }
  .editor-bar .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { padding: 10px 16px; }
  .container { padding: 24px 16px 64px; }
  .brand-name { display: none; }
  .auth-card { padding: 24px 20px; }
  .q-card, .panel { padding: 18px 16px; }
  .title-input { font-size: 22px; }
  .eb-actions .btn span, .tab span { display: none; }
  .eb-actions .btn { padding: 10px 12px; }
  .tab { padding: 8px 18px; }
  .q-toolbar .sw-label { display: none; }
  .q-row-meta { display: none; }
  .choices.row { grid-template-columns: 1fr; }
  .pf-hero { padding: 26px 20px 22px; }
  .resp-detail-head { flex-wrap: wrap; }
  .rd-a, .rd-correct { padding-left: 0; margin-left: 0; }
  .fc-menu { top: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.public-bar .brand-name { display: inline; }

/* =====================================================================
   Barras de desplazamiento con estilo propio
   ===================================================================== */
:root { --scroll-grad: linear-gradient(180deg, #6d4fb0, #4c3a72); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.025); border-radius: 99px; margin: 4px; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-grad); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
::-webkit-scrollbar-thumb:hover { border-width: 2px; filter: brightness(1.15); }
::-webkit-scrollbar-thumb:active { border-width: 1px; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: #6d4fb0 rgba(255, 255, 255, 0.04); }
}
#scrollProgress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; pointer-events: none;
  background: var(--scroll-grad); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(109, 79, 176, 0.7); transition: transform 0.1s linear;
}

/* =====================================================================
   Editor: tipos interactivos
   ===================================================================== */
.ic.flip { transform: scaleX(-1); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .ic { width: 16px; height: 16px; }
.link-btn.danger { color: var(--bad); }
.link-btn.danger:hover { color: #fecdd3; }
.type-menu { max-height: min(420px, 60vh); overflow-y: auto; }
.type-group { grid-column: 1 / -1; margin: 6px 6px 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.select optgroup { background: var(--surface-solid); color: var(--dim); font-style: normal; }

.sub-list { display: grid; gap: 8px; margin-bottom: 4px; }
.sub-row { display: flex; align-items: center; gap: 10px; animation: aparecer 0.3s var(--ease); }
.sub-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.sub-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); flex-shrink: 0; }
.opt-input.boxed { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.3); transition: border-color 0.2s, box-shadow 0.2s; }
.opt-input.boxed:focus { border-color: rgba(109, 79, 176, 0.6); box-shadow: 0 0 0 3px rgba(109, 79, 176, 0.14); }
.opt-input.boxed.ok { border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.06); }
.opt-input.boxed.ok:focus { border-color: rgba(52, 211, 153, 0.7); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14); }
.img-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.img-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #000; user-select: none; -webkit-user-select: none; touch-action: manipulation; margin-bottom: 12px; }
.img-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.img-stage.editable, .img-stage.responder { cursor: crosshair; }
.img-stage.mini { max-width: 460px; }
.zona {
  position: absolute; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  border: 2px dashed #34d399; background: rgba(52, 211, 153, 0.22); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
  cursor: pointer; transition: background 0.2s, width 0.15s; animation: pop 0.35s var(--ease);
}
.zona:hover { background: rgba(251, 113, 133, 0.3); border-color: var(--bad); }
.zona.fija { cursor: default; pointer-events: none; }
.pin {
  position: absolute; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: translate(-50%, -100%) rotate(-45deg);
  background: var(--grad); border: 2px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.pin::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.pin.pop { animation: soltarPin 0.35s var(--ease); }
.pin.ok { background: linear-gradient(135deg, #059669, #34d399); }
.pin.bad { background: linear-gradient(135deg, #e11d48, #fb7185); }
.pin.small { width: 14px; height: 14px; border-width: 1.5px; }
.pin.small::after { inset: 3px; }
@keyframes soltarPin { from { transform: translate(-50%, -160%) rotate(-45deg); opacity: 0; } }
.pin-num {
  position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--grad);
  border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); animation: pop 0.35s var(--ease);
}
.pin-num.static { position: static; transform: none; flex-shrink: 0; animation: none; }
.range-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
input[type="range"] { flex: 1; max-width: 260px; accent-color: var(--p2); }

.pair-head { display: grid; grid-template-columns: 1fr 28px 1fr 28px; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.pair-row { display: grid; grid-template-columns: 1fr 28px 1fr 28px; gap: 8px; align-items: center; animation: aparecer 0.3s var(--ease); }
.pair-link { display: grid; place-items: center; color: var(--p3); }
.pair-link .ic { width: 16px; height: 16px; }
.huecos-preview { margin-top: 12px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--border-2); line-height: 2.1; color: var(--muted); }
.hueco-chip { display: inline-block; margin: 0 4px; padding: 0 10px; border-radius: 8px; line-height: 1.8; font-weight: 600; font-size: 13px; color: var(--ok); background: var(--ok-bg); border-bottom: 2px solid var(--ok); }
.hueco-chip.vacio { color: var(--warn); background: rgba(251, 191, 36, 0.1); border-color: var(--warn); }

/* =====================================================================
   Página pública: tema personalizable
   ===================================================================== */
.public {
  --card-bg: rgba(16, 13, 26, 0.72); --input-bg: rgba(0, 0, 0, 0.35);
  --hero: linear-gradient(135deg, #3b0764 0%, #6b21a8 50%, #86198f 100%);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif; --fs: 15.5px;
  position: relative; color: var(--text); font-family: var(--font);
  background:
    radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--p2) 22%, transparent), transparent 65%),
    radial-gradient(700px 520px at 100% 100%, color-mix(in srgb, var(--p2) 14%, transparent), transparent 65%),
    var(--bg);
}
.public:not(.tema-preview) { min-height: 100vh; }
.public main { font-size: var(--fs); }
.public .q-card, .public .panel, .public .result-card { background: var(--card-bg); border-color: var(--border); }
.public .field input, .public .field textarea, .public .answer-input { background: var(--input-bg); border-color: var(--border); font-size: 1em; }
.public .pf-hero { background: var(--hero); color: #fff; box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--p2) 80%, transparent); }
.public .pf-hero h1 { font-size: min(var(--tt, 1.9em), 9vw); }
.public .pf-hero > p { font-size: var(--td, 1em); }
.public .pq-head h3 { font-size: 1.1em; }
.public .choice, .public .field > span { font-size: 1em; }
.public .hint { font-size: 0.86em; }
.public .brand-name { color: var(--text); }
.public .q-num { color: var(--p3); border-color: color-mix(in srgb, var(--p2) 40%, transparent); }
.public .choice:hover { border-color: color-mix(in srgb, var(--p2) 50%, transparent); background: color-mix(in srgb, var(--p2) 7%, transparent); }
.public .choice:has(input:checked) { border-color: var(--p2); background: color-mix(in srgb, var(--p2) 13%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--p2) 35%, transparent); }
.public .field input:focus, .public .field textarea:focus, .public .answer-input:focus { border-color: var(--p2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--p2) 18%, transparent); }
.public[data-modo="claro"] { color-scheme: light; }
.public[data-modo="claro"] .q-card, .public[data-modo="claro"] .panel, .public[data-modo="claro"] .result-card { box-shadow: 0 12px 30px -18px rgba(28, 21, 48, 0.25); backdrop-filter: none; }
.public[data-modo="claro"] .ind { border-color: rgba(28, 21, 48, 0.28); }
.public[data-modo="claro"] .chip:not(.chip-glass):not(.chip-ok):not(.chip-bad) { color: var(--muted); background: rgba(28, 21, 48, 0.05); }
.public[data-modo="claro"] .ring-bg { stroke: rgba(28, 21, 48, 0.08); }
.public[data-modo="claro"] .btn-ghost { background: #fff; border-color: var(--border); }
.public[data-modo="claro"] .img-stage { border-color: var(--border); }
.public[data-modo="claro"] .q-error { color: #e11d48; }
.public[data-modo="claro"] .rd-correct, .public[data-modo="claro"] .dg-ok { color: #047857; }

/* Responder: tipos interactivos */
.sub-answers .field:last-child { margin-bottom: 0; }
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.label-row { display: flex; align-items: center; gap: 10px; }
.select.full { flex: 1; display: flex; padding: 0 12px; border-radius: 12px; background: var(--input-bg, rgba(0, 0, 0, 0.35)); }
.select.full select { flex: 1; min-width: 0; padding: 11px 4px 11px 0; font-weight: 500; }
.select.full .chev { width: 16px; height: 16px; }
.public .select.full { border-color: var(--border); }

.sort-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: orden; }
.sort-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--input-bg, rgba(255, 255, 255, 0.02)); counter-increment: orden;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.sort-item:hover { border-color: color-mix(in srgb, var(--p2) 50%, transparent); }
.sort-item.dragging { z-index: 2; cursor: grabbing; border-color: var(--p2); box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--p2) 70%, transparent); background: var(--card-bg, #13101f); transition: none; }
.sort-item.moved { animation: resaltar 0.4s var(--ease); }
.grip { color: var(--dim); display: grid; }
.sort-n::before { content: counter(orden); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; font-weight: 800; color: #fff; background: var(--grad); }
.sort-t { flex: 1; }
.sort-btns { display: flex; gap: 2px; }

.match { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 72px; }
.match-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.match-lines path { fill: none; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.4)); animation: trazar 0.45s var(--ease); stroke-dasharray: 600; }
@keyframes trazar { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
.match-col { display: grid; gap: 10px; align-content: start; }
.match-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; min-height: 48px;
  border: 1px solid var(--border); background: var(--input-bg, rgba(255, 255, 255, 0.02)); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease), box-shadow 0.2s;
}
.match-item:hover { border-color: color-mix(in srgb, var(--p2) 50%, transparent); }
.match-item:active { transform: scale(0.98); }
.match-t { flex: 1; }
.match-col.izq .dot { margin-right: -22px; }
.match-col.der .dot { margin-left: -22px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--dim); background: var(--bg, #07060d); flex-shrink: 0; position: relative; z-index: 2; transition: all 0.2s; }
.match-item.conectado { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.match-item.conectado .dot { border-color: var(--c); background: var(--c); box-shadow: 0 0 10px var(--c); }
.match-item.activo { border-color: var(--p2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p2) 30%, transparent); }
.match-item.activo .dot { border-color: var(--p2); animation: pulso 0.9s ease-in-out infinite; }
.match-select, .solo-movil { display: none; }

.cloze { line-height: 2.5; font-size: 1.05em; }
.cloze-input {
  width: 7ch; min-width: 7ch; max-width: 100%; margin: 0 4px; padding: 3px 8px; line-height: 1.5; font-size: 1em; vertical-align: baseline; border: 0; border-bottom: 2px solid var(--p2); border-radius: 8px 8px 0 0;
  background: color-mix(in srgb, var(--p2) 10%, transparent); color: var(--text); outline: none; font-weight: 600; text-align: center;
  transition: background 0.2s, box-shadow 0.2s, width 0.15s;
}
.cloze-input:focus { background: color-mix(in srgb, var(--p2) 20%, transparent); box-shadow: 0 2px 0 var(--p3); }

/* Revisión de tipos compuestos */
.rd-rich { padding-left: 38px; }
.rd-item.parcial { border-color: rgba(251, 191, 36, 0.35); }
.dg { display: grid; gap: 6px; }
.dg-row { display: grid; grid-template-columns: minmax(90px, 0.8fr) 1.2fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border); font-size: 0.95em; }
.dg-row.ok { border-color: rgba(52, 211, 153, 0.3); }
.dg-row.bad { border-color: rgba(251, 113, 133, 0.3); }
.dg-lbl { color: var(--muted); font-weight: 600; font-size: 0.92em; }
.dg-resp { display: flex; align-items: center; gap: 6px; }
.dg-resp .ic { width: 15px; height: 15px; }
.dg-row.ok .dg-resp .ic { color: var(--ok); }
.dg-row.bad .dg-resp .ic { color: var(--bad); }
.dg-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 0.88em; font-weight: 600; }
.dg-ok .ic { width: 13px; height: 13px; }
.dg-sum { margin-bottom: 12px; }
.dg-sum strong { display: block; margin-bottom: 6px; font-size: 14px; }

/* =====================================================================
   Pestaña Diseño
   ===================================================================== */
.container.narrow.wide { max-width: 1180px; }
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.design-preview { position: sticky; top: 132px; display: grid; gap: 12px; }
.design-preview .eyebrow { margin: 0; }
.tema-preview { border-radius: 20px; padding: 16px; border: 1px solid var(--border-2); overflow: hidden; box-shadow: var(--shadow); transition: background 0.4s; }
.tema-preview main, .tema-preview { font-size: var(--fs); }
.tema-preview .pf-hero { padding: 24px 20px 20px; }
.tema-preview .pf-hero h1 { font-size: 1.5em; }
.tema-preview .q-card { padding: 16px; margin-bottom: 12px; }
.tema-preview .pf-actions { margin: 0; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin-top: 12px; }
.tpl {
  position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 14px; text-align: left;
  background: var(--tbg); border: 2px solid var(--border); transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
.tpl:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.9); border-color: rgba(109, 79, 176, 0.45); }
.tpl.sel { border-color: var(--p2); box-shadow: 0 0 0 3px rgba(109, 79, 176, 0.3); }
.tpl-hero { height: 42px; background: var(--thero); }
.tpl-body { display: grid; gap: 6px; margin: 8px; padding: 8px; border-radius: 8px; background: var(--tcard); }
.tpl-line { height: 6px; border-radius: 9px; background: var(--tline); }
.tpl-line.short { width: 60%; }
.tpl-btn { justify-self: end; width: 38px; height: 10px; border-radius: 9px; background: var(--ta); }
.tpl-name { padding: 2px 10px 10px; font-size: 13px; font-weight: 700; color: var(--tname, #fff); }
.tpl-name small { font-weight: 500; opacity: 0.8; }
.tpl-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; transform: scale(0); transition: transform 0.25s var(--ease); }
.tpl-check .ic { width: 13px; height: 13px; stroke-width: 3; }
.tpl.sel .tpl-check { transform: scale(1); }

.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.font-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease); }
.font-opt:hover { transform: translateY(-2px); border-color: rgba(109, 79, 176, 0.45); }
.font-opt.sel { border-color: var(--p2); background: var(--grad-soft); box-shadow: 0 0 0 1px rgba(109, 79, 176, 0.4); }
.font-opt strong { font-size: 28px; line-height: 1.1; font-weight: 600; }
.font-opt span { font-size: 13px; font-weight: 600; }
.font-opt small { font-size: 11px; color: var(--dim); }

.size-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 5px; margin-top: 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); }
.size-seg button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; transition: background 0.25s, color 0.2s; }
.size-seg button span { font-weight: 700; line-height: 1.2; }
.size-seg button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.size-seg button.sel { color: #fff; background: var(--grad); box-shadow: var(--glow); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); transition: transform 0.2s var(--ease), box-shadow 0.2s; display: grid; place-items: center; }
.swatch:hover { transform: scale(1.1); }
.swatch.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff; }
.swatch.auto { width: auto; padding: 0 14px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--text); background: var(--grad); }
.swatch.custom { cursor: pointer; background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #9d7fd1, #f43f5e); color: #fff; }
.swatch.custom.sel { background: var(--sw); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch.custom .ic { width: 16px; height: 16px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }

/* =====================================================================
   Confirmación de correo
   ===================================================================== */
.confirm-card { margin-top: 6vh; padding: 48px 32px 40px; }
.confirm-card .eyebrow { margin: 10px 0 0; }
.confirm-card .btn { margin-top: 12px; }
.confirm-card > .muted { max-width: 440px; }
.confirm-art { position: relative; width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 20px 50px -14px color-mix(in srgb, var(--p2) 90%, transparent); animation: pop 0.55s var(--ease); }
.confirm-art > .ic { width: 44px; height: 44px; stroke-width: 1.8; }
.confirm-check { position: absolute; right: -10px; bottom: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #10b981; border: 4px solid var(--card-bg, #13101f); color: #fff; animation: pop 0.5s 0.35s var(--ease) both; }
.confirm-check .ic { width: 18px; height: 18px; stroke-width: 3.5; }

@media (max-width: 1000px) {
  .design-layout { grid-template-columns: 1fr; }
  .design-preview { position: static; order: -1; }
}
@media (max-width: 640px) {
  .sub-fields { grid-template-columns: 1fr; }
  .pair-head { display: none; }
  .pair-row { grid-template-columns: 1fr 28px; }
  .pair-row .pair-link { display: none; }
  .pair-row input:nth-of-type(2) { grid-column: 1; }
  .match { grid-template-columns: 1fr; }
  .match-col.der, .match-lines, .match-col.izq .dot { display: none; }
  .match-item { flex-direction: column; align-items: stretch; cursor: default; }
  .match-select { display: flex; }
  .solo-movil { display: inline; }
  .solo-escritorio { display: none; }
  .rd-rich { padding-left: 0; }
  .dg-row { grid-template-columns: 1fr; gap: 4px; }
  .size-seg { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   Composiciones de la página pública
   ===================================================================== */
/* Portada: encabezado grande a todo lo ancho */
.public[data-comp="portada"] .pf-hero {
  min-height: 42vh; display: flex; flex-direction: column; justify-content: flex-end;
  margin: -12px calc(50% - 50vw) 32px; padding: 72px max(24px, calc(50vw - 390px)) 44px; border-radius: 0;
}
.public[data-comp="portada"] .pf-hero h1 { font-size: min(calc(var(--tt, 1.9em) * 1.45), 11vw); letter-spacing: -0.03em; }
.public[data-comp="portada"] .pf-hero > p { font-size: calc(var(--td, 1em) * 1.1); max-width: 620px; }
.public[data-comp="portada"] .public-bar { position: relative; z-index: 2; }
.public[data-comp="portada"] main { overflow: visible; }

/* Lateral: título fijo a la izquierda */
@media (min-width: 900px) {
  .public[data-comp="lateral"] main.container { max-width: 1120px; }
  .public[data-comp="lateral"]:not(.tema-preview) .pf-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .public[data-comp="lateral"]:not(.tema-preview) .pf-hero { position: sticky; top: 24px; min-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; justify-content: flex-end; margin: 0; }

}

/* Paso a paso: una pregunta a la vez */
.public[data-comp="pasos"] .public-q { min-height: 180px; }
.public[data-comp="pasos"] .public-q.entra { animation: entrar 0.35s var(--ease); }
@keyframes entrar { from { opacity: 0; transform: translateX(18px); } }
.pasos-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 0.85em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.paso-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.paso-track span { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: var(--glow); transition: width 0.45s var(--ease); }
.pf-actions { gap: 10px; flex-wrap: wrap; }
.pf-spacer { flex: 1; }

/* Minimalista: sin tarjetas */
.public[data-comp="minimal"] .pf-hero { background: none; box-shadow: none; color: var(--text); padding: 18px 0 26px; border-radius: 0; margin-bottom: 8px; }
.public[data-comp="minimal"] .pf-hero::after { content: ''; position: static; display: block; width: 72px; height: 5px; margin-top: 18px; border-radius: 9px; background: var(--grad); }
.public[data-comp="minimal"] .pf-hero > p { color: var(--muted); }
.public[data-comp="minimal"] .pf-hero .chip-glass { background: var(--surface-2); border-color: var(--border); color: var(--muted); backdrop-filter: none; }
.public[data-comp="minimal"] .q-card { background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 28px 2px; margin: 0; box-shadow: none; backdrop-filter: none; }
.public[data-comp="minimal"] .q-card::before { top: 28px; bottom: 28px; left: -14px; }
.public[data-comp="minimal"] .pf-actions { border-top: 1px solid var(--border); padding-top: 24px; }

/* =====================================================================
   Selector de composición (pestaña Diseño)
   ===================================================================== */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; margin-top: 12px; }
.comp-opt { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); text-align: left; transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s; }
.comp-opt:hover { transform: translateY(-3px); border-color: rgba(109, 79, 176, 0.45); }
.comp-opt.sel { border-color: var(--p2); box-shadow: 0 0 0 3px rgba(109, 79, 176, 0.25); background: var(--grad-soft); }
.comp-opt strong { font-size: 14px; margin-top: 6px; }
.comp-opt small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.cmini { display: flex; flex-direction: column; gap: 4px; height: 92px; padding: 7px; border-radius: 9px; background: #0b0914; border: 1px solid var(--border); overflow: hidden; }
.cmini i { display: block; border-radius: 4px; }
.cmini .c-hero { height: 20px; background: var(--grad); flex-shrink: 0; }
.cmini .c-hero.big { height: 40px; margin: -7px -7px 0; border-radius: 0; }
.cmini .c-hero.side { width: 38%; height: auto; }
.cmini .c-row { display: flex; gap: 5px; flex: 1; min-height: 0; }
.cmini .c-col { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.cmini .c-card { flex: 1; min-height: 8px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.08); }
.cmini .c-card.solo { flex: 1; margin: 2px 10px; }
.cmini .c-bar { height: 5px; flex-shrink: 0; background: linear-gradient(90deg, #6d4fb0 40%, rgba(255, 255, 255, 0.12) 40%); border-radius: 9px; }
.cmini .c-dots { display: flex; justify-content: center; gap: 4px; }
.cmini .c-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.cmini .c-dots i:first-child { background: #b9a8dc; }
.cmini .c-title { height: 9px; width: 60%; background: rgba(255, 255, 255, 0.35); margin-top: 6px; }
.cmini .c-line { height: 1px; background: rgba(255, 255, 255, 0.18); margin-top: 14px; border-radius: 0; }
.cmini-minimal .c-title::after { content: ''; display: block; width: 30%; height: 3px; margin-top: 12px; border-radius: 9px; background: var(--grad); }
.comp-opt:hover .cmini, .comp-opt.sel .cmini { border-color: rgba(109, 79, 176, 0.4); }

/* Composición en la vista previa pequeña */
.tema-preview[data-comp="lateral"] .pf-hero { border-left: 4px solid var(--p3); }
.tema-preview[data-comp="portada"] .pf-hero { margin: -16px -16px 14px; border-radius: 0; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 18px 18px; }
.tema-preview .pasos-top { margin-bottom: 12px; }

/* =====================================================================
   Aviso de base de datos desactualizada
   ===================================================================== */
.db-host { padding-bottom: 0; }
.db-alert { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 24px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.04)); border: 1px solid rgba(251, 191, 36, 0.4); animation: subir 0.4s var(--ease); flex-wrap: wrap; }
.db-alert-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(251, 191, 36, 0.18); color: var(--warn); flex-shrink: 0; }
.db-alert-txt { flex: 1; min-width: 240px; }
.db-alert-txt strong { color: #fde68a; }
.db-alert-txt p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.db-alert-txt ol { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.db-alert-txt code { padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); color: #fde68a; }
.db-alert-btns { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) { .db-alert-btns { flex-direction: row; flex-wrap: wrap; } }

/* =====================================================================
   Imagen de apoyo en cualquier pregunta
   ===================================================================== */
.apoyo-btn { margin-left: auto; }
.apoyo-btn + .pts { margin-left: 0; }
.q-enunciado { display: grid; gap: 12px; }
.q-enunciado.lado { grid-template-columns: minmax(160px, 38%) 1fr; align-items: start; }
.apoyo-edit { position: relative; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #000; animation: aparecer 0.3s var(--ease); }
.apoyo-edit img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.apoyo-edit figcaption { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.apoyo-edit .zm-modo { background: rgba(10, 8, 18, 0.85); backdrop-filter: blur(8px); }
.apoyo-edit .icon-btn { background: rgba(10, 8, 18, 0.85); }

.q-apoyo { position: relative; margin: 0 0 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #000; cursor: zoom-in; }
.q-apoyo img { display: block; width: 100%; max-height: 420px; object-fit: contain; transition: transform 0.4s var(--ease); }
.q-apoyo:hover img { transform: scale(1.02); }
.q-apoyo-zoom { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.q-apoyo:hover .q-apoyo-zoom, .q-apoyo:focus-within .q-apoyo-zoom { opacity: 1; }
.pq-lado { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; gap: 18px; align-items: start; margin-bottom: 14px; }
.pq-lado .q-apoyo { margin: 0; }
.pq-lado .pq-head { margin-bottom: 0; }
.modal-card.zoom { max-width: min(1100px, 94vw); padding: 12px; background: #0a0812; }
.zoom-img { display: block; width: 100%; max-height: 84vh; object-fit: contain; border-radius: 12px; }
.modal-card.zoom .modal-x { z-index: 2; background: rgba(0, 0, 0, 0.55); color: #fff; }

/* =====================================================================
   Zonas en imagen (opción múltiple o respuesta corta por punto)
   ===================================================================== */
.zm-list { display: grid; gap: 10px; }
.zm-item { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); animation: aparecer 0.3s var(--ease); }
.zm-item .opts { margin-top: 8px; }
.zm-item > .opt-input.boxed, .zm-item > .fake-input { margin-top: 10px; width: 100%; display: block; }
.zm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zm-modo { display: inline-flex; gap: 3px; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); }
.zm-modo button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: background 0.2s, color 0.2s; }
.zm-modo button .ic { width: 14px; height: 14px; }
.zm-modo button:hover { color: var(--text); }
.zm-modo button.sel { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.zm-radio { margin-left: auto; font-size: 12px; }
.zm-radio input { width: 110px; flex: none; }
.zm-zona { border-style: solid; border-color: var(--p3); background: color-mix(in srgb, var(--p2) 22%, transparent); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); }
.img-stage .pin-num, .img-stage .zm-zona { transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.img-stage .pin-num.activo { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 4px color-mix(in srgb, var(--p2) 45%, transparent), 0 4px 12px rgba(0, 0, 0, 0.5); z-index: 2; }
.img-stage .zm-zona.activo { background: color-mix(in srgb, var(--p2) 38%, transparent); }
.zm-answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.zm-answer .answer-input { flex: 1; min-width: 0; padding: 10px 12px; }

@media (max-width: 640px) {
  .q-enunciado.lado, .pq-lado { grid-template-columns: 1fr; }
  .apoyo-btn span { display: none; }
  .zm-radio { margin-left: 0; width: 100%; }
  .zm-radio input { flex: 1; width: auto; }
}

/* =====================================================================
   Marca Formalia
   ===================================================================== */
.brand-logo {
  display: block; height: 26px; aspect-ratio: 633 / 105; background: currentColor;
  -webkit-mask: url("../img/logo.png") left center / contain no-repeat; mask: url("../img/logo.png") left center / contain no-repeat;
}
.brand { color: #fff; }
.brand.grande .brand-logo { height: 38px; }
.public .brand { color: var(--text); }
.public .brand-logo { height: 24px; }
.topbar .brand-logo { height: 24px; }

/* Login */
.auth-lead { font-size: 15.5px; color: #c9c3dc; max-width: 520px; line-height: 1.6; }
.feature-hero { display: flex; gap: 14px; align-items: flex-start; margin-top: 26px; padding: 16px 18px; max-width: 500px; border-radius: 16px; background: var(--grad-soft); border: 1px solid rgba(109, 79, 176, 0.35); }
.feature-hero strong { display: block; font-size: 15px; margin-bottom: 2px; }
.feature-hero p { color: var(--muted); font-size: 13.5px; }
.fh-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); color: #fff; flex-shrink: 0; box-shadow: var(--glow); }
.features { margin-top: 18px; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.mascota { position: relative; width: 190px; height: 170px; margin-bottom: -26px; z-index: 2; animation: flotarFoca 4.5s ease-in-out infinite; }
.mascota-halo { position: absolute; left: 50%; bottom: 8px; width: 170px; height: 170px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #efeafb 0%, #d9cdef 45%, #b9a8dc 70%, rgba(109, 79, 176, 0) 72%);
  box-shadow: 0 0 24px rgba(109, 79, 176, 0.3); }
.foca { position: absolute; left: 50%; bottom: 14px; width: 150px; transform: translateX(-50%) scale(0.9); opacity: 0; transition: opacity 0.35s var(--ease), transform 0.45s var(--ease); pointer-events: none; user-select: none; }
.foca.on { opacity: 1; transform: translateX(-50%) scale(1); }
.mascota.salta { animation: saltoFoca 0.6s var(--ease), flotarFoca 4.5s 0.6s ease-in-out infinite; }
.mascota.tiembla { animation: sacudir 0.4s, flotarFoca 4.5s 0.4s ease-in-out infinite; }
@keyframes flotarFoca { 50% { transform: translateY(-7px); } }
@keyframes saltoFoca { 30% { transform: translateY(-22px) scale(1.04, 0.97); } 60% { transform: translateY(0) scale(0.97, 1.03); } }
.mascota-globo {
  position: absolute; left: calc(100% - 18px); top: 18px; width: max-content; max-width: 190px; padding: 9px 13px; border-radius: 14px 14px 14px 4px;
  background: #fff; color: #1c1530; font-size: 13px; font-weight: 700; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translateY(6px) scale(0.9); transform-origin: 0 100%; transition: opacity 0.25s, transform 0.3s var(--ease); pointer-events: none;
}
.mascota-globo.show { opacity: 1; transform: none; }
.auth-card { position: relative; z-index: 1; }

.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 44px; }
.pass-ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.pass-ver.on { color: var(--p3); }
.pass-req { list-style: none; margin: -6px 0 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); }
.pass-req li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--dim); transition: color 0.2s; }
.pass-req li .ic { width: 14px; height: 14px; padding: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: transparent; transition: all 0.25s var(--ease); stroke-width: 3.5; }
.pass-req li.ok { color: var(--ok); }
.pass-req li.ok .ic { background: var(--ok); color: #052e1f; transform: scale(1.1); }
.pass-match { font-size: 12.5px; min-height: 16px; }
.pass-match.ok { color: var(--ok); }
.pass-match.bad { color: var(--bad); }

/* Portada en "Mis formularios" */
.fc-cover { background: var(--cover, var(--grad)); }
.fc-cover.con-foto::after { display: none; }

/* =====================================================================
   Encabezado del editor con el diseño del formulario
   ===================================================================== */
.header-card.con-tema { background: var(--hero); border: 0; color: #fff; padding-top: 22px; box-shadow: 0 24px 50px -30px rgba(109, 79, 176, 0.8); }
.header-card.con-tema::after { display: none; }
.header-card.con-tema .title-input { color: #fff; font-family: var(--font); font-size: calc(14px * var(--tt-num, 1)); font-size: calc(var(--tt, 1.9em) * 0.9); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.header-card.con-tema .title-input::placeholder { color: rgba(255, 255, 255, 0.6); }
.header-card.con-tema .title-input:focus { border-bottom-color: rgba(255, 255, 255, 0.6); }
.header-card.con-tema .desc-input { color: rgba(255, 255, 255, 0.88); font-size: var(--td, 1em); font-family: var(--font); }
.header-card.con-tema .desc-input:focus { border-bottom-color: rgba(255, 255, 255, 0.5); }
.header-card.con-tema .chip { background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.2); color: #fff; backdrop-filter: blur(6px); }
.header-card.con-tema:focus-within { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 24px 50px -30px rgba(109, 79, 176, 0.8); }
.hc-tamanos { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.hc-tam { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.15); }
.hc-tam small { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.75); margin-right: 4px; }
.hc-tam button { border: 0; background: none; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 7px; border-radius: 7px; transition: background 0.2s, transform 0.15s var(--ease); }
.hc-tam button:hover { background: rgba(255, 255, 255, 0.15); }
.hc-tam button:active { transform: scale(0.9); }

/* Campos con formato */
.rt { outline: none; white-space: pre-wrap; word-break: break-word; cursor: text; }
.rt:empty::before { content: attr(data-placeholder); color: var(--dim); font-weight: 500; pointer-events: none; }
.header-card.con-tema .rt:empty::before { color: rgba(255, 255, 255, 0.55); }
.q-text.rt { min-height: 44px; }
.desc-input.rt { min-height: 24px; }
.rt b, .public b { font-weight: 800; }
.rt-bar {
  position: fixed; z-index: 70; display: flex; gap: 2px; padding: 4px; border-radius: 12px;
  background: rgba(22, 18, 36, 0.97); border: 1px solid var(--border-2); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(109, 79, 176, 0.15);
  opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none; transition: opacity 0.15s, transform 0.2s var(--ease);
}
.rt-bar.show { opacity: 1; transform: none; pointer-events: auto; }
.rt-bar button { width: 36px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 15px; font-family: Georgia, serif; transition: background 0.15s; }
.rt-bar button:hover { background: rgba(109, 79, 176, 0.2); }
.rt-bar button.on { background: var(--grad); color: #fff; }

/* =====================================================================
   Selector de tipo de pregunta (menú propio)
   ===================================================================== */
.tipo-picker { position: relative; }
.tipo-btn { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 11px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.35); font-weight: 600; font-size: 13.5px; transition: border-color 0.2s, background 0.2s; }
.tipo-btn:hover, .tipo-btn:focus-visible { border-color: rgba(109, 79, 176, 0.55); background: rgba(109, 79, 176, 0.08); }
.tipo-btn .chev { width: 15px; height: 15px; color: var(--dim); transition: transform 0.25s var(--ease); }
.tipo-picker:has(.tipo-pop.open) .tipo-btn .chev { transform: rotate(180deg); }
.tipo-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad-soft); color: var(--p3); flex-shrink: 0; transition: background 0.2s, color 0.2s; }
.tipo-ic .ic { width: 15px; height: 15px; }
.tipo-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 25; width: min(560px, 86vw); max-height: min(440px, 62vh); overflow-y: auto; padding: 10px;
  border-radius: 18px; background: linear-gradient(180deg, rgba(30, 24, 50, 0.98), rgba(18, 14, 30, 0.98)); border: 1px solid var(--border-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(109, 79, 176, 0.12); backdrop-filter: blur(20px);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top left; pointer-events: none; transition: opacity 0.18s, transform 0.22s var(--ease);
}
.tipo-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.tipo-pop .type-group { margin: 6px 6px 8px; }
.tipo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.tipo-opt, .type-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: left; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease); }
.tipo-opt:hover, .type-opt:hover { background: rgba(109, 79, 176, 0.12); border-color: rgba(109, 79, 176, 0.3); }
.tipo-opt:hover .tipo-ic, .type-opt:hover .tipo-ic, .tipo-opt.sel .tipo-ic { background: var(--grad); color: #fff; }
.tipo-opt:active, .type-opt:active { transform: scale(0.98); }
.tipo-opt.sel { background: rgba(109, 79, 176, 0.16); border-color: rgba(109, 79, 176, 0.5); }
.tipo-txt { display: flex; flex-direction: column; min-width: 0; }
.tipo-txt strong { font-size: 13px; font-weight: 700; }
.tipo-txt small { font-size: 11.5px; color: var(--muted); }
.type-menu { width: min(600px, 100%); grid-template-columns: 1fr 1fr; }

/* =====================================================================
   Composición: tira compacta
   ===================================================================== */
.comp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; padding: 6px; border-radius: 16px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); }
.comp-opt { position: relative; align-items: center; text-align: center; gap: 6px; padding: 8px 6px 9px; border: 1px solid transparent; border-radius: 12px; background: none; }
.comp-opt:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
.comp-opt.sel { border-color: rgba(109, 79, 176, 0.6); box-shadow: none; background: var(--grad-soft); }
.comp-opt strong { font-size: 12px; margin-top: 0; }
.comp-opt small { display: none; }
.comp-opt .cmini { width: 100%; height: 58px; padding: 5px; gap: 3px; }
.comp-opt .cmini .c-hero { height: 12px; }
.comp-opt .cmini .c-hero.big { height: 24px; margin: -5px -5px 0; }
.comp-opt .cmini .c-line { margin-top: 8px; }
.comp-opt .cmini .c-title { margin-top: 3px; height: 6px; }
.comp-opt .cmini-minimal .c-title::after { margin-top: 7px; }
.comp-desc { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.comp-desc .ic { width: 14px; height: 14px; color: var(--p3); }

@media (max-width: 960px) {
  .mascota { margin-top: 10px; }
}
@media (max-width: 640px) {
  .comp-grid { grid-template-columns: repeat(3, 1fr); }
  .tipo-grid, .type-menu { grid-template-columns: 1fr; }
  .pass-req { grid-template-columns: 1fr; }
  .mascota-globo { left: auto; right: calc(100% - 30px); border-radius: 14px 14px 4px 14px; transform-origin: 100% 100%; }
}
/* El enunciado se escribe en peso medio para que "Negrita" sí marque la diferencia. */
.q-text.rt { font-weight: 500; }
.public .pq-head h3 { font-weight: 500; }
.public .pq-head h3 b { font-weight: 800; }
.q-card:has(.tipo-pop.open) { z-index: 30; }
@media (max-width: 640px) {
  .mascota-globo { left: auto; right: -34px; top: -26px; max-width: 150px; border-radius: 14px 14px 4px 14px; transform-origin: 50% 100%; }
}

/* =====================================================================
   Párrafo con sub-respuestas: campo con modo (abierta/única/múltiple/menú)
   ===================================================================== */
.sub-item { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); animation: aparecer 0.3s var(--ease); }
.sub-item .opts { margin-top: 8px; }
.sub-item > .opt-input.boxed, .sub-item > .fake-input { margin-top: 10px; width: 100%; display: block; }
.sub-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-item-head .opt-input.boxed { flex: 1; min-width: 140px; }
.switch-row.inline.sm { gap: 8px; margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }

/* =====================================================================
   Completar espacios: editor de texto con marcas (sin corchetes)
   ===================================================================== */
.huecos-edit { min-height: 70px; line-height: 1.9; padding: 12px 14px; }
.hueco-mark {
  display: inline-block; margin: 0 3px; padding: 2px 10px; border-radius: 8px; font-weight: 700; font-size: 0.95em;
  color: var(--ok); background: var(--ok-bg); border-bottom: 2px solid var(--ok); cursor: pointer; user-select: none;
}
.hueco-mark:hover { background: var(--bad-bg); color: var(--bad); border-bottom-color: var(--bad); }
.hueco-mark:hover::after { content: ' ×'; }
.huecos-lista { margin-top: 12px; }
.rt-bar [data-hueco-btn] { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; white-space: nowrap; }
.rt-bar [data-hueco-btn] .ic { width: 15px; height: 15px; color: var(--ok); }

/* =====================================================================
   Escala / Likert, respuesta numérica y línea numérica: editor
   ===================================================================== */
.escala-num-cfg { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.escala-num-cfg .opt-input.boxed { flex: 1; min-width: 160px; }
.q-manual { display: inline-flex; align-items: center; gap: 6px; color: var(--p3); }
.q-manual .ic { width: 15px; height: 15px; }

/* =====================================================================
   Responder: escala, numérica y línea numérica
   ===================================================================== */
.escala-likert { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.escala-opt { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); cursor: pointer; text-align: center; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease); }
.escala-opt:hover { border-color: rgba(109, 79, 176, 0.45); transform: translateY(-2px); }
.escala-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.escala-punto { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); transition: all 0.2s var(--ease); }
.escala-opt input:checked + .escala-punto { background: var(--grad); border-color: transparent; box-shadow: var(--glow); transform: scale(1.1); }
.escala-txt { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.escala-opt input:checked ~ .escala-txt { color: var(--text); font-weight: 600; }
.escala-numerica { display: flex; flex-direction: column; gap: 10px; }
.escala-extremos { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.escala-fila { display: flex; gap: 8px; flex-wrap: wrap; }
.escala-num { cursor: pointer; }
.escala-num input { position: absolute; opacity: 0; width: 0; height: 0; }
.escala-circulo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); font-weight: 700; font-size: 14px; transition: all 0.2s var(--ease); }
.escala-num input:checked + .escala-circulo { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); transform: scale(1.08); }
.numero-input-wrap { display: flex; align-items: center; gap: 10px; }
.numero-input { max-width: 220px; }
.numero-unidad { color: var(--muted); font-weight: 600; font-size: 14px; }
.linea-num { display: flex; flex-direction: column; gap: 10px; padding: 6px 4px; }
.linea-extremos { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.linea-valor { font-size: 22px; color: var(--text); }
.linea-range { width: 100%; accent-color: var(--p2); height: 6px; }

@media (max-width: 640px) {
  .escala-likert { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .escala-opt { padding: 10px 4px; }
  .escala-txt { font-size: 10.5px; }
  .escala-circulo { width: 38px; height: 38px; font-size: 13px; }
}
