/* ============================================================
   MMR Corporate KYC — Design tokens
   Palette: MMR official teal (#16BE9A) + neutral dark ink
   Type: Sora (display) / Inter (body) / IBM Plex Mono (data)
   ============================================================ */
:root {
  --ink: #282828;        /* matches the logo's wordmark */
  --ink-hover: #3D3D3D;
  --brand: #16BE9A;       /* MMR official color */
  --brand-dark: #109E80;  /* hover/active state for brand-colored elements */
  --brand-soft: #E3F7F1;  /* light tint for selected/checked states */
  --success: #2E7D32;
  --error: #C62828;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #232323;
  --text-muted: #6B6B6B;
  --border: #E2E2E2;

  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 10px;
  --shadow-card: 0 4px 24px rgba(20, 20, 20, 0.07);
}

* { box-sizing: border-box; }

/* Any element toggled via the native `hidden` property/attribute must stay
   hidden, full stop — regardless of what display value its own class sets
   elsewhere (e.g. .btn uses display:inline-flex, .intro-screen uses
   display:flex). Without this, a same-specificity author rule can beat the
   browser's default `[hidden]{display:none}` and the element stays visible
   even though JS correctly set `.hidden = true`. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--card);
  color: var(--ink);
  border-bottom: 3px solid var(--brand);
  flex-wrap: wrap;
  gap: 12px;
}
.topbar__brand { display: flex; align-items: center; gap: 14px; }
.topbar__logo { height: 36px; width: auto; display: block; }
.topbar__divider { width: 1px; height: 20px; background: var(--border); }
.topbar__title { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: 0.2px; color: var(--ink); }
.topbar__right { display: flex; align-items: center; gap: 20px; }
.topbar__secure {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}

/* ── Language switch ────────────────────────────────────── */
.lang-switch { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; }
.lang-switch__sep { color: var(--border); }
.lang-switch__btn {
  background: transparent; border: none; color: var(--text-muted);
  font-family: inherit; font-size: inherit; font-weight: 600; cursor: pointer;
  padding: 4px 6px; border-radius: 4px; letter-spacing: 0.5px;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn.is-active { color: var(--brand-dark); background: var(--brand-soft); }

/* ── Mobile progress (hidden on desktop) ───────────────────── */
.mprogress { display: none; padding: 14px 20px 0; background: var(--bg); }
.mprogress__top {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px;
}
.mprogress__track { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.mprogress__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--ink), var(--brand)); transition: width 0.4s ease; }

/* ── Layout ─────────────────────────────────────────────── */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  max-width: 1180px;
  width: 100%;
  margin: 40px auto;
  padding: 0 32px;
  align-items: start;
}

/* ── Verification ladder ───────────────────────────────── */
.ladder {
  position: sticky;
  top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}
.ladder__intro { margin-bottom: 20px; }
.ladder__eyebrow {
  margin: 0 0 4px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
}
.ladder__percent { margin: 0; font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--ink); }

.ladder__rungs { list-style: none; margin: 0; padding: 0; }
.rung {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  min-height: 40px;
}
.rung__beam {
  position: absolute;
  left: 7px;
  top: -50%;
  width: 2px;
  height: 100%;
  background: var(--border);
}
.rung:first-child .rung__beam { display: none; }
.rung__dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--border);
  flex-shrink: 0; z-index: 1;
  transition: all 0.3s ease;
}
.rung__label {
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  transition: color 0.3s ease;
}
.rung.is-done .rung__dot { background: var(--brand); border-color: var(--brand); }
.rung.is-done .rung__beam { background: var(--brand); }
.rung.is-active .rung__dot { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(22,190,154,0.18); }
.rung.is-active .rung__label, .rung.is-done .rung__label { color: var(--ink); }
.ladder__note { margin: 20px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px 28px;
  box-shadow: var(--shadow-card);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.step__title {
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  margin: 0 0 4px; color: var(--ink);
}
.step__sub { margin: 0 0 28px; color: var(--text-muted); font-size: 14.5px; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field label em { color: var(--text-muted); font-style: normal; font-weight: 400; }

input[type=text], input[type=email], input[type=tel], input[type=date], input[type=url], input[type=number], select {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input.mono, .signature { font-family: var(--font-mono); }
input:focus, select:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(22,190,154,0.18);
}
.field.has-error input, .field.has-error select { border-color: var(--error); }
.field.has-error .field__error { display: block; }
.field__error {
  display: none;
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
}
.field__hint {
  font-size: 11.5px;
  color: var(--text-muted);
}
.field__hint--accent { color: var(--brand-dark); font-weight: 600; }

/* ── File uploader ─────────────────────────────────────── */
.uploader { position: relative; }
.uploader input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.uploader__box {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.uploader:hover .uploader__box { border-color: var(--brand-dark); background: #FAFBFD; }
.uploader__icon { font-size: 15px; color: var(--brand-dark); }
.uploader__filename { font-family: var(--font-mono); font-size: 12px; color: var(--ink); font-weight: 600; }
.field.has-error .uploader__box { border-color: var(--error); }

/* ── Declaration checkboxes ────────────────────────────── */
.declare { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.check {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text); line-height: 1.5; cursor: pointer;
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 8px;
  transition: border-color 0.15s ease;
}
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); flex-shrink: 0; }
.check a { color: var(--brand-dark); }

/* ── Navigation buttons ─────────────────────────────────── */
.nav { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 28px; }
.nav__spacer { flex: 1; }
.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px;
  padding: 13px 26px; border-radius: 8px; border: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--gold { background: var(--brand); color: var(--ink); }
.btn--gold:hover { box-shadow: 0 4px 14px rgba(22,190,154,0.35); }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn--ghost:hover { border-color: var(--brand-dark); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn__spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(40,40,40,0.25); border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.formmsg {
  margin-top: 16px; padding: 13px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.formmsg--error { background: #FDECEC; color: var(--error); }
.formmsg--success { background: #EAF4EA; color: var(--success); }

/* ── Honeypot (visually hidden) ─────────────────────────── */
.hp { display: none; }

/* ── Success panel ──────────────────────────────────────── */
.success { text-align: center; padding: 40px 20px; }
.success__badge {
  width: 64px; height: 64px; border-radius: 50%; background: var(--success);
  color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.success h2 { font-family: var(--font-display); color: var(--ink); margin-bottom: 10px; }
.success p { color: var(--text-muted); max-width: 440px; margin: 0 auto 24px; line-height: 1.6; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 12px; }

/* ── Focus visibility ───────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand-dark); outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; margin: 0 auto; padding: 0; gap: 0; }
  .ladder { display: none; }
  .mprogress { display: block; }
  .card { border-radius: 0; border-left: none; border-right: none; box-shadow: none; padding: 24px 20px; }
  .topbar { padding: 16px 20px; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .field--full { grid-column: 1; }
  .step__title { font-size: 20px; }
  .btn { flex: 1; justify-content: center; }
  .topbar__right { width: 100%; justify-content: space-between; }
}

/* ============================================================
   Extra components for the MMR due-diligence form
   ============================================================ */

/* ── Intro / policy notice (Step 1 only) ───────────────────── */
.intro {
  background: #F7F9FC;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
}
.intro h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.intro p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.intro p:last-child { margin-bottom: 0; }

/* ── Section headings within a step ────────────────────────── */
.section__title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink); margin: 28px 0 14px; padding-top: 18px; border-top: 1px solid var(--border);
}
.grid > .section__title { grid-column: 1 / -1; }
.step > .section__title:first-of-type { border-top: none; padding-top: 0; margin-top: 8px; }
.section__subtitle {
  font-family: var(--font-body); font-weight: 700; font-size: 12.5px;
  letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-muted); margin: 4px 0 12px;
}
.step__hint { font-size: 12.5px; color: var(--text-muted); margin: -18px 0 20px; }

textarea {
  font-family: var(--font-body); font-size: 14.5px; padding: 11px 13px;
  border: 1.5px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  width: 100%; resize: vertical; min-height: 72px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea:focus { outline: none; border-color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(22,190,154,0.18); }
.field.has-error textarea { border-color: var(--error); }

/* ── Checkbox groups (nature of business / trade products) ─── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }

/* Trade Under Consideration only — same checkbox styling as .checkbox-group,
   just arranged in a responsive grid instead of wrapped pills. */
.checkbox-group--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
}
@media (max-width: 900px) {
  .checkbox-group--grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .checkbox-group--grid { grid-template-columns: 1fr; }
}
.checkbox-group--grid .check--inline {
  width: 100%;
  margin: 0;
}
.checkbox-group--grid .field__error {
  grid-column: 1 / -1;
}

.check--inline {
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 13px; margin: 0;
}
.check--inline:has(input:checked) { border-color: var(--ink); background: var(--brand-soft); }
.check--inline input { width: 14px; height: 14px; margin: 0; }
.check--compact { padding: 6px 0; border: none; font-size: 12.5px; color: var(--text-muted); }
.check--compact input { width: 14px; height: 14px; }

/* ── Yes/No compliance questions ───────────────────────────── */
.yesno label:not(.yesno__pill) { font-size: 14px; line-height: 1.55; margin-bottom: 10px; display: block; }
.yesno__options { display: flex; gap: 10px; }
.yesno__pill {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px;
  border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted);
}
.yesno__pill:has(input:checked) { border-color: var(--ink); color: var(--ink); background: var(--brand-soft); }
.yesno__pill input { width: 15px; height: 15px; accent-color: var(--ink); }

/* ── Repeatable groups (shareholders / UBOs / directors) ────── */
.repeatable-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.repeatable-card {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 18px; position: relative;
  background: #FCFDFE;
}
.repeatable-card__header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.repeatable-card__title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.repeatable-card__remove {
  background: none; border: none; color: var(--error); font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 4px 8px;
}
.repeatable-card__remove:hover { text-decoration: underline; }
.btn--small { padding: 9px 16px; font-size: 13px; margin-bottom: 8px; }

/* ── Declaration statement paragraph ───────────────────────── */
.declare__statement {
  background: #F7F9FC; border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 18px; font-size: 13.5px; line-height: 1.7; color: var(--text); margin: 12px 0 20px;
}
.declare__statement strong { color: var(--ink); }

.step {
  animation: stepFadeIn 0.28s ease;
}
.intro-screen {
  animation: stepFadeIn 0.28s ease;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Welcome / intro screen (shown before Step 1) ──────────── */
.intro-screen {
  display: flex;
  flex-direction: column;
  min-height: 440px;
}
.intro-screen .step__title { margin-bottom: 18px; }
.intro-screen .intro { flex: 1; margin-bottom: 0; }
.intro-screen .nav { padding-top: 24px; }
