:root {
  --blue: #3a7bff;
  --purple: #8b3cff;
  --grad: linear-gradient(135deg, #3a7bff 0%, #8b3cff 100%);
  --primary: #4f46e5;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #1e2436;
  --text-soft: #6b7488;
  --line: #e4e8f2;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(59, 72, 130, .10);
  --shadow-lg: 0 12px 32px rgba(59, 72, 130, .20);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); overscroll-behavior-y: none; }
[v-cloak] { display: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, textarea, select { font-family: inherit; }

/* ---------- Botones ---------- */
.btn {
  width: 100%; padding: 15px; font-size: 16px; font-weight: 700; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .05s, opacity .15s; color: #fff;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-grad { background: var(--grad); box-shadow: 0 6px 18px rgba(90, 60, 230, .35); }
.btn-soft { background: var(--surface-2); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1.5px solid var(--line); }
.btn-sm { width: auto; padding: 11px 18px; font-size: 14px; }
.btn-new { margin-bottom: 14px; }

/* ---------- Splash ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--grad); color: #fff; }
.boot-logo { width: 76px; height: 76px; animation: pulse 1.2s ease-in-out infinite; }
.boot-txt { font-size: 14px; opacity: .9; font-weight: 600; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }

/* ---------- Fin / bloqueado ---------- */
.fin { text-align: center; padding: 12vh 20px; color: var(--text-soft); }
.fin-ico { font-size: 60px; margin-bottom: 10px; }
.fin h3 { color: var(--text); font-size: 22px; margin: 6px 0; }
.fin p { font-size: 15px; margin: 0 0 20px; }
.fin .btn { width: auto; margin: 0 auto; }

/* ---------- LOGIN ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  background: var(--grad); padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.auth-hero { text-align: center; color: #fff; margin: 8vh 0 26px; }
.auth-logo { width: 84px; height: 84px; filter: drop-shadow(0 8px 22px rgba(0,0,0,.28)); }
.auth-hero h1 { margin: 14px 0 4px; font-size: 30px; letter-spacing: .5px; }
.auth-hero p { margin: 0; opacity: .9; font-size: 15px; }
.auth-card {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 26px 22px; width: 100%; max-width: 400px;
}
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.field input, .inp {
  width: 100%; padding: 14px 15px; font-size: 16px; border: 2px solid var(--line);
  border-radius: var(--radius); outline: none; background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .inp:focus { border-color: var(--blue); }
.pwd { position: relative; }
.pwd input { padding-right: 66px; }
.pwd-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--surface-2); color: var(--primary); font-size: 13px; font-weight: 600;
  padding: 7px 10px; border-radius: 10px; }
.auth-err { color: var(--bad); font-size: 13px; margin: 12px 0 0; text-align: center; }
.auth-note { color: var(--text-soft); font-size: 12px; margin: 14px 0 0; text-align: center; }
.net-badge { margin-top: 18px; font-size: 12px; font-weight: 600; color: #fff; opacity: .85; }
.net-badge.off { opacity: 1; }

/* ---------- APP shell ---------- */
/* Ancho tipo "container" de Bootstrap: se expande en PC, centrado. */
.app { width: 100%; max-width: 1140px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--grad); color: #fff;
  padding: 14px 14px calc(14px); display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.tb-title { flex: 1; min-width: 0; }
.tb-title strong { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-title small { font-size: 12px; opacity: .85; }
.net-pill { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.2); }
.net-pill.off { background: rgba(0,0,0,.28); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18);
  color: #fff; display: grid; place-items: center; flex: none; }
.icon-btn:active { background: rgba(255,255,255,.3); }

.content { flex: 1; padding: 16px; }

/* ---------- Sync row ---------- */
.sync-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--warn-soft); color: #92500a; border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }

/* ---------- Lista de registros ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.rec {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; display: flex; align-items: center; gap: 12px; transition: transform .05s;
}
.rec:active { transform: scale(.995); }
.rec-avatar { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-size: 22px; font-weight: 700; }
.rec-avatar.sent { background: var(--ok-soft); color: var(--ok); }
.rec-avatar.pend { background: #ede9ff; color: var(--purple); }
.rec-body { flex: 1; min-width: 0; }
.rec-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta { font-size: 12px; color: var(--text-soft); margin-top: 3px; }
.rec-state { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; flex: none; }
.rec-state.sent { background: var(--ok-soft); color: var(--ok); }
.rec-state.pend { background: var(--warn-soft); color: var(--warn); }

/* ---------- Vacío ---------- */
.empty { text-align: center; color: var(--text-soft); padding: 44px 20px; }
.empty-ico { font-size: 46px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin: 6px 0; }
.empty p { margin: 0 0 16px; font-size: 14px; }
.empty .btn { width: auto; margin: 0 auto; }

/* ---------- Formulario ---------- */
.form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.link-back { background: none; color: var(--primary); font-weight: 700; font-size: 15px; padding: 6px 0; }
.prog { flex: 1; display: flex; align-items: center; gap: 8px; }
.prog-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.prog-bar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s; }
.prog small { font-size: 12px; color: var(--text-soft); font-weight: 600; white-space: nowrap; }

.step-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-mid { flex: 1; min-width: 0; text-align: center; }
.step-count { display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary);
  background: #ede9ff; padding: 4px 10px; border-radius: 999px; margin-bottom: 6px; }
.arrow-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--primary); font-size: 26px; line-height: 1; font-weight: 700;
  display: grid; place-items: center; transition: transform .05s, opacity .15s; }
.arrow-btn:active { transform: scale(.94); }
.arrow-btn:disabled { opacity: .35; color: var(--text-soft); cursor: default; }

.grupo { margin-bottom: 18px; }
.grupo-tit { font-size: 18px; font-weight: 800; color: var(--text); margin: 4px 0 0; line-height: 1.25; }

/* Cada pregunta: en PC, texto y control en la MISMA fila; si no caben, saltan.
   En móvil (poco ancho) quedan apilados por el flex-basis. */
.preg { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.preg-tit { flex: 1 1 240px; font-size: 15px; font-weight: 600; margin: 0; line-height: 1.35; }
.preg-nota { display: block; font-size: 12px; color: var(--text-soft); font-style: normal; font-weight: 400; margin-top: 2px; }
.preg-ctl { flex: 2 1 300px; min-width: 0; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { flex: 1 1 auto; min-width: 30%; padding: 12px 10px; font-size: 14px; font-weight: 600;
  border-radius: 12px; background: var(--surface-2); color: var(--text); border: 2px solid transparent;
  transition: all .12s; }
.opt.sel { background: var(--grad); color: #fff; }
.opt.cok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.opt.cwarn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.opt.cbad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

textarea.inp { resize: vertical; min-height: 72px; }

/* Navegación del wizard */
.wizard-nav { margin-top: 18px; display: flex; gap: 10px; }
.wizard-nav .btn { flex: 1; }
.wizard-nav .btn-ghost { flex: 0 1 40%; }
.btn-del { margin: 12px auto 0; width: auto; }

/* ---------- Config ---------- */
.cfg-tit { font-size: 20px; margin: 8px 0 14px; }
.cfg-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; }
.cfg-msg { font-size: 13px; color: var(--primary); margin: 10px 0 0; }
.cfg-hint { font-size: 12px; color: var(--text-soft); margin: 10px 0 0; }
.cfg-hint code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.cfg-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px;
  border-bottom: 1px solid var(--line); }
.cfg-row:last-child { border-bottom: none; }
.cfg-row span { color: var(--text-soft); }
.mono, .cfg-row .mono { font-family: ui-monospace, monospace; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); background: #1e2436; color: #fff; padding: 11px 20px;
  border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-lg); z-index: 60;
  animation: rise .25s; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .content { padding: 24px; }
  .opt { min-width: 0; }
}
