/* menta tech — Relevamiento Técnico
   Colors: Menta Black #232533, Menta Blue #315DF5, White #FFFFFF, Light Gray #F2F2F2
   Font: Inter Light/Bold only. */

:root {
  --menta-black: #232533;
  --menta-blue: #315DF5;
  --white: #FFFFFF;
  --light-gray: #F2F2F2;
  --border: #E5E5EA;
  --muted: #6E6E78;
  --radius: 12px;
}

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

/* Force the hidden attribute to always win over display: flex / etc. */
[hidden] { display: none !important; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 300;
  color: var(--menta-black);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
}
.logo {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 28px;
  width: auto;
  display: block;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-toggle button:hover { color: var(--menta-black); }
.lang-toggle button.active {
  background: var(--menta-blue);
  color: var(--white);
}
.partner-name-readonly {
  background: var(--light-gray);
  color: var(--menta-black);
  font-weight: 700;
  cursor: default;
  pointer-events: none;
}
.save-status {
  font-size: 12px;
  color: var(--muted);
}
.save-status.saving { color: var(--menta-blue); }
.save-status.saved  { color: #22863a; }
.save-status.error  { color: #c0392b; }

/* ---------- cover ---------- */
.cover {
  background: linear-gradient(135deg, var(--menta-blue) 0%, var(--menta-black) 100%);
  color: var(--white);
  padding: 80px 32px 88px;
}
.cover-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: 14px;
  font-weight: 300;
  opacity: 0.85;
  text-transform: lowercase;
  margin: 0 0 12px;
}
.cover h1 {
  font-weight: 300;
  font-size: 56px;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.05;
}
.cover .lede {
  font-weight: 300;
  font-size: 18px;
  max-width: 720px;
  opacity: 0.92;
  margin: 0;
}

/* ---------- layout ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
}
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; padding: 24px 16px; gap: 24px; }
  .nav { position: static !important; max-height: none !important; }
  .cover { padding: 48px 16px; }
  .cover h1 { font-size: 36px; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  font-size: 13px;
  padding-right: 8px;
}
.nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}
.nav li { margin: 0; }
.nav a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--menta-black); }
.nav a.active {
  color: var(--menta-blue);
  border-left-color: var(--menta-blue);
  font-weight: 700;
}
.nav-label { flex: 1; }
.nav-status {
  flex-shrink: 0;
  margin-top: 1px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav-status.complete { color: #22863a; font-size: 13px; }
.nav-status.partial { color: var(--muted); font-size: 10px; }

/* ---------- intro ---------- */
.intro {
  background: var(--light-gray);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 40px;
}
.intro h2 {
  font-weight: 300;
  font-size: 20px;
  margin: 0 0 12px;
}
.intro ul {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 14px;
}
.intro li { margin-bottom: 4px; }
.legend {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* ---------- form ---------- */
.section {
  margin-bottom: 56px;
}
.section-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.section-num {
  display: inline-block;
  font-size: 13px;
  color: var(--menta-blue);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-weight: 300;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-intro {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  max-width: 740px;
}

.q {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.q-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}
.q-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.005em;
}
.chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip-critical  { background: var(--menta-blue); color: var(--white); }
.chip-important { background: var(--menta-black); color: var(--white); }
.chip-info      { background: var(--light-gray); color: var(--menta-black); border: 1px solid var(--border); }
.chip-new       { background: var(--white); color: var(--menta-blue); border: 1px solid var(--menta-blue); margin-left: 4px; }
.chip-prefilled { background: #fff4ce; color: #5b4a00; border: 1px solid #f3d96b; margin-left: 4px; }

.prefill-hint {
  background: #fff4ce;
  border: 1px solid #f3d96b;
  color: #5b4a00;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin: 0 0 12px;
  line-height: 1.4;
  font-weight: 400;
}
.q:has(.chip-prefilled) {
  border-color: #f3d96b;
  background: #fffdf5;
}

.q-question {
  font-size: 14px;
  color: var(--menta-black);
  margin: 8px 0 14px;
}
.q-context {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { border-color: var(--menta-blue); }
.opt input { margin-top: 3px; accent-color: var(--menta-blue); }
.opt input:checked + .opt-text { font-weight: 700; }
.opt-text { flex: 1; font-size: 14px; }
.opt.selected { background: rgba(49,93,245,0.04); border-color: var(--menta-blue); }

.followups { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--border); }

.lbl {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 6px;
}
.text-input, .textarea, .select {
  width: 100%;
  font-family: inherit;
  font-weight: 300;
  font-size: 14px;
  color: var(--menta-black);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus, .textarea:focus, .select:focus {
  border-color: var(--menta-blue);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

.field-row { margin-bottom: 8px; }

.followup-q {
  font-size: 13px;
  color: var(--menta-black);
  margin: 12px 0 6px;
}

/* ---------- tables (section II/III/IV) ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.tbl th, .tbl td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: top;
}
.tbl th {
  background: var(--light-gray);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
}
.tbl input.cell, .tbl select.cell {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 300;
  font-size: 13px;
  background: transparent;
}
.tbl input.cell:focus, .tbl select.cell:focus {
  background: rgba(49,93,245,0.05);
}
.tbl-actions { margin-top: 10px; }

/* ---------- actions ---------- */
.actions {
  margin-top: 48px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  padding: 12px 22px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--menta-blue);
  color: var(--white);
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--menta-black);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--menta-black); }
.btn-small {
  font-size: 12px;
  padding: 8px 14px;
}

/* ---------- footer ---------- */
.footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--menta-black);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 100;
}
.toast.success { background: #22863a; }
.toast.error   { background: #c0392b; }

/* ---------- landing (no token) ---------- */
.landing {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, var(--menta-blue) 0%, var(--menta-black) 100%);
  color: var(--white);
}
.landing-inner {
  max-width: 560px;
  text-align: center;
}
.landing h1 {
  font-weight: 300;
  font-size: 44px;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.landing p {
  font-size: 16px;
  opacity: 0.92;
  line-height: 1.6;
}
.landing a {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- locked banner ---------- */
.locked-banner {
  background: #fff4ce;
  border: 1px solid #f3d96b;
  color: #5b4a00;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 24px;
  font-weight: 700;
}

/* ---------- locked state (admin closed the submission) ---------- */
body.locked .text-input,
body.locked .textarea,
body.locked .opt input,
body.locked .cell {
  pointer-events: none;
  opacity: 0.8;
  background: var(--light-gray);
}
body.locked #submit-btn { display: none; }
