/* ===== Hippo brand tokens — "Figma-inspired" =====
   Pale-lime canvas, near-black UI, cyan panels, playful multicolor accents.
   Swap these values to rebrand the whole app. */
:root {
  --purple: #7B61FF;      /* accent — Figma violet (radios, focus, chips) */
  --teal: #1ABCFE;        /* accent — Figma cyan */
  --teal-dark: #0E9FDB;   /* cyan pressed */
  --ink: #0A0A0A;         /* near-black — text + primary buttons */
  --muted: #5C6154;       /* secondary text (warm gray-green) */
  --line: #E2E7D4;        /* borders / dividers (lime-tinted) */
  --bg: #F8FAEE;          /* app canvas — soft, subtle lime */
  --panel: #CFEFF7;       /* pale-cyan accent surface */
  --card: #ffffff;
  --ok: #0ACF83;          /* correcto — Figma green */
  --ok-bg: #E4F9EF;
  --bad: #F24E1E;         /* incorrecto — Figma red-orange */
  --bad-bg: #FDECE4;
  /* logo/confetti accents */
  --pink: #F24DBF;
  --orange: #FF6B35;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(10, 10, 10, .05), 0 8px 24px rgba(10, 10, 10, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
.pane-title, .generator h3, .brand-name, .empty p { font-family: var(--font-display); letter-spacing: -.2px; }

/* ===== Line icons (SVG, inherit currentColor) ===== */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 1.05em; height: 1.05em; display: block; }
.verdict .ic, .btn .ic { margin-right: 6px; }
.dz-icon .ic svg { width: 30px; height: 30px; stroke-width: 1.5; }
.toggle-label .ic { color: var(--ink); margin-right: 2px; }
.doc-list li > .ic, .doc-list li .ic:first-child { color: var(--muted); }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.brand-dots {
  display: grid; grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px);
  gap: 3px;
}
.brand-dots i { border-radius: 2px; display: block; }
.brand-dots i:nth-child(1) { background: var(--bad); }      /* red-orange */
.brand-dots i:nth-child(2) { background: var(--teal); }     /* cyan */
.brand-dots i:nth-child(3) { background: var(--purple); }   /* violet */
.brand-dots i:nth-child(4) { background: var(--ok); }       /* green */
.brand-name { font-weight: 600; letter-spacing: -.5px; color: var(--ink); }
.brand-name b { font-weight: 700; color: var(--ink); }
.usage {
  margin-left: auto; font-size: 13px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.usage b, .usage span { color: var(--ink); font-weight: 600; }
.cta {
  border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 14px;
  color: #fff; background: var(--ink);
  padding: 9px 18px; border-radius: 999px;
}
.cta:hover { background: #2b2b2b; }
.cta-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.cta-ghost:hover { background: var(--bg); color: var(--ink); }
.profile-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 38px;
}
.profile-btn svg { width: 20px; height: 20px; }
.profile-btn:hover { background: var(--bg); border-color: var(--ink); }
.plan-pill {
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap;
}
.plan-pill.pro { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===== Account modal ===== */
.acct-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,10,.4); padding: 20px; }
.acct-modal[hidden] { display: none; }
.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 26px; width: 100%; max-width: 360px; position: relative; }
.acct-card h2 { font-family: var(--font-display); margin: 0 0 16px; font-size: 20px; }
.acct-close { position: absolute; top: 16px; right: 16px; border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer; }
.acct-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.acct-row span { color: var(--muted); }
.acct-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.acct-btns a { text-decoration: none; text-align: center; font-family: inherit; font-weight: 600; font-size: 14px; padding: 12px; border-radius: 12px; }
.acct-btns a.up { background: var(--ink); color: #fff; }
.acct-btns a.renew { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.acct-logout { width: 100%; margin-top: 12px; border: none; background: none; color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; }
.acct-logout:hover { color: var(--bad); }

/* ===== Access gate ===== */
.gate {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; background: var(--bg); padding: 20px;
}
.gate[hidden] { display: none; }
.gate-home { display: flex; align-items: center; gap: 9px; font-size: 20px; text-decoration: none; color: var(--ink); }
.gate-home .brand-dots { display: grid; grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px); gap: 3px; }
.gate-home .brand-dots i { border-radius: 2px; display: block; }
.gate-home .brand-dots i:nth-child(1){background:var(--bad);} .gate-home .brand-dots i:nth-child(2){background:var(--teal);}
.gate-home .brand-dots i:nth-child(3){background:var(--purple);} .gate-home .brand-dots i:nth-child(4){background:var(--ok);}
.gate-home .brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: -.5px; }
.gate-back { font-size: 13px; color: var(--muted); text-decoration: none; }
.gate-back:hover { color: var(--ink); }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 34px 30px; width: 100%; max-width: 380px; text-align: center;
}
.gate-dots { justify-content: center; margin: 0 auto 16px; }
.gate-card h2 { font-family: var(--font-display); margin: 0 0 6px; font-size: 23px; }
.gate-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.gate-card input {
  width: 100%; font-family: inherit; font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
}
.gate-card input:focus { outline: none; border-color: var(--purple); }
.gate-card .btn { margin-top: 0; }
.gate-status { font-size: 13px; margin-top: 12px; min-height: 16px; }
.gate-status.ok { color: var(--ok); font-weight: 600; }
.gate-status.free { color: var(--muted); }
.gate-note { margin: 16px 0 0 !important; font-size: 13px; color: var(--muted); }
.gate-note a { color: var(--purple); font-weight: 600; text-decoration: none; }

/* ===== Split layout ===== */
.split {
  display: grid; grid-template-columns: 388px 1fr; gap: 24px;
  padding: 28px 24px; max-width: 1220px; margin: 0 auto; align-items: start;
}
.pane {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 24px;
}
.pane-left { position: sticky; top: 72px; }
.pane-title { margin: 0 0 6px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.pane-sub { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Numbered step badges (Figma-style rounded squares) */
.step-num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 700; color: #fff; line-height: 1;
}
.step-num.s1 { background: var(--purple); }
.step-num.s2 { background: var(--teal); }
.step-num.s3 { background: var(--ok); }

/* ===== Dropzone ===== */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 28px 16px; text-align: center; cursor: pointer; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--purple); background: var(--bg); }
.dropzone-sm { padding: 16px; font-size: 13px; }
.dz-icon { font-size: 28px; }
.dz-text { font-size: 14px; }
.dz-text small { color: var(--muted); }

.exam-preview { margin-top: 14px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.exam-preview img { display: block; width: 100%; height: auto; }

.exam-preview .file-chip {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  font-size: 14px; color: var(--ink); background: var(--bg);
}
.exam-preview .file-chip::before { content: "📄"; font-size: 20px; }

/* ===== Opt-in toggle (find missing answers) ===== */
/* ===== Study-mode setting ===== */
.setting { margin-top: 14px; }
.setting-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.setting-select {
  width: 100%; font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer;
}
.setting-select:focus { outline: none; border-color: var(--purple); }
.setting-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }

.toggle {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  margin-top: 14px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg);
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  flex: 0 0 40px; width: 40px; height: 22px; border-radius: 999px;
  background: #d3d2e0; position: relative; transition: background .15s; margin-top: 1px;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-track { background: var(--purple); }
.toggle input:checked + .toggle-track .toggle-thumb { left: 20px; }
.toggle-label { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.toggle-label small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }

.pane-div { border: none; border-top: 1px dashed var(--line); margin: 22px 0 18px; }
.opcional {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px;
  vertical-align: middle;
}
.doc-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-list li {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.doc-list li .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list li .doc-x { cursor: pointer; color: var(--muted); font-weight: 700; border: none; background: none; }
.doc-list li .doc-x:hover { color: var(--bad); }
.doc-list li.pending { opacity: .6; }

/* ===== Buttons ===== */
.btn {
  width: 100%; margin-top: 14px; border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 15px; padding: 12px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #2b2b2b; }
.btn-secondary { color: var(--ink); background: #fff; border: 1.5px solid var(--ink); padding: 10.5px; }
.btn-secondary:hover:not(:disabled) { background: var(--bg); }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* ===== Quiz ===== */
.quiz-head { display: flex; align-items: center; justify-content: space-between; }
.score {
  font-size: 13px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px;
}
.score b { color: var(--ok); }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }

/* ===== Progress bar (indeterminate) ===== */
.progress { padding: 28px 6px; text-align: center; }
.progress[hidden] { display: none; }
.progress-msg { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; position: relative; }
.progress-bar span {
  position: absolute; left: 0; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, var(--purple), var(--teal));
  border-radius: 999px; animation: prog 1.1s ease-in-out infinite;
}
@keyframes prog {
  0% { left: -40%; } 100% { left: 100%; }
}

.q-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-top: 14px; background: var(--card);
}
.q-card.locked { background: #fbfcfe; }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: #eef1fb; color: var(--purple);
}
.tag.diff-Easy { background: var(--ok-bg); color: var(--ok); }
.tag.diff-Medium { background: #fff4e5; color: #b45309; }
.tag.diff-Hard { background: var(--bad-bg); color: var(--bad); }
.q-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.q-text { font-weight: 500; margin: 4px 0 12px; }

.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px;
  transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--purple); }
.opt input { accent-color: var(--purple); }
.opt .opt-letter { font-weight: 600; color: var(--muted); min-width: 18px; }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.disabled { pointer-events: none; opacity: .9; }

.text-answer { display: flex; gap: 8px; }
.text-answer input {
  flex: 1; font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
}
.text-answer input:focus { outline: none; border-color: var(--purple); }
.text-answer button {
  border: none; background: var(--purple); color: #fff; font-family: inherit; font-weight: 600;
  padding: 0 16px; border-radius: 10px; cursor: pointer;
}

.verdict { margin-top: 12px; font-weight: 600; font-size: 14px; display: flex; align-items: center; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.explanation {
  margin-top: 8px; font-size: 13px; color: #374151;
  background: var(--bg); border-left: 3px solid var(--purple);
  padding: 10px 12px; border-radius: 8px;
}

/* ===== Conversational ask bar ===== */
.ask { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ask-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ask-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 12px; max-width: 90%; }
.ask-msg.me { align-self: flex-end; background: var(--purple); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input {
  flex: 1; font-family: inherit; font-size: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 999px;
}
.ask-row input:focus { outline: none; border-color: var(--purple); }
.btn-ask {
  border: none; cursor: pointer; color: #fff; font-size: 18px; font-weight: 700;
  width: 44px; border-radius: 50%; flex: 0 0 44px;
  background: var(--ink);
}
.btn-ask:disabled { opacity: .5; cursor: not-allowed; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--ink);
  padding: 6px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--purple); background: var(--bg); }

/* ===== Generator ===== */
.generator { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }
.generator h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 10px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow); z-index: 50;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .pane-left { position: static; }
  .pane { padding: 18px; }
}
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .brand { font-size: 18px; }
  .usage { font-size: 11.5px; padding: 5px 10px; }
  .plan-pill { font-size: 11.5px; padding: 5px 10px; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; }
  .cta, .cta-ghost { padding: 8px 14px; font-size: 13px; }
  .pane-title { font-size: 16px; }
  .pane-sub { font-size: 12.5px; }
  .q-text { font-size: 14.5px; }
  .q-card { padding: 14px; }
  .ask-row input { font-size: 14px; }
  .gate-card { padding: 26px 20px; }
  .toast { left: 12px; right: 12px; transform: none; text-align: center; }
}
