:root {
  --ink: #111111;
  --muted: #626262;
  --line: #d8d8d4;
  --surface: #ffffff;
  --soft: #f4f4f1;
  --accent: #d8ff3e;
  --danger: #a51d1d;
  --success: #176b36;
}

[hidden] {
  display: none !important;
}

.kyc-page {
  min-height: 100vh;
  background: #f1f1ed;
  color: var(--ink);
}

.kyc-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(22px, 5vw, 72px);
  background: #080808;
  color: #fff;
}

.kyc-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.kyc-brand img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}

.back-link {
  color: #fff;
  font-weight: 700;
  text-underline-offset: 4px;
}

.kyc-page main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.kyc-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  gap: 48px;
  align-items: end;
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kyc-intro h1 {
  max-width: 800px;
  margin: 0 0 16px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: .98;
  letter-spacing: -.055em;
}

.intro-copy {
  max-width: 760px;
  margin: 0;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
  color: #3e3e3e;
}

.process-note {
  display: grid;
  gap: 7px;
  padding: 22px;
  border: 2px solid #111;
  background: var(--accent);
  box-shadow: 8px 8px 0 #111;
  line-height: 1.45;
}

.process-note strong {
  font-size: 18px;
}

.kyc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 22px;
  padding: 24px;
  border-radius: 18px;
  background: #101010;
  color: #fff;
}

.progress-title {
  margin: 0 0 18px;
  color: #bcbcbc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.progress-panel ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-panel li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #9b9b9b;
  font-weight: 700;
}

.progress-panel li span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  border: 1px solid #555;
  border-radius: 50%;
  font-size: 13px;
}

.progress-panel li.active,
.progress-panel li.complete {
  color: #fff;
}

.progress-panel li.active span {
  border-color: var(--accent);
  background: var(--accent);
  color: #111;
}

.progress-panel li.complete span {
  border-color: #fff;
}

.security-note {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid #3b3b3b;
  color: #c8c8c8;
  font-size: 13px;
  line-height: 1.5;
}

.form-card {
  min-width: 0;
  padding: clamp(24px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .08);
}

.kyc-page form {
  display: block;
  max-width: none;
}

.form-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-step > legend {
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: -.035em;
}

.form-step > legend span {
  display: block;
  margin-bottom: 8px;
  color: #747474;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.step-description {
  max-width: 760px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.field-grid {
  display: grid;
  gap: 20px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-two {
  grid-column: 1 / -1;
}

.field {
  min-width: 0;
}

.field label,
.nested-fieldset > legend {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.conditional-panel input,
.conditional-panel textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid #bdbdb8;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font: inherit;
  line-height: 1.35;
}

.field textarea,
.conditional-panel textarea {
  min-height: 104px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.conditional-panel input:focus,
.conditional-panel textarea:focus,
.radio-option input:focus,
.check-option input:focus {
  outline: 3px solid rgba(185, 219, 43, .45);
  outline-offset: 2px;
  border-color: #111;
}

.field .invalid,
.conditional-panel .invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(165, 29, 29, .12);
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.step-actions.end {
  justify-content: flex-end;
}

.step-actions button {
  min-width: 145px;
  padding: 15px 22px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.step-actions button.secondary {
  background: #fff;
  color: #111;
}

.step-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #b8d930;
}

.step-actions button:disabled {
  opacity: .55;
  cursor: wait;
}

.question-card,
.consent-box,
.download-note {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.nested-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-option,
.check-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  line-height: 1.5;
}

.radio-option input,
.check-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  padding: 0;
  accent-color: #111;
}

.conditional-panel,
.question-card .conditional {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #c9c9c4;
}

.consent-box h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.consent-box a,
.form-status a {
  color: inherit;
  font-weight: 800;
  text-underline-offset: 3px;
}

.download-note {
  border-color: #111;
  background: #fff8d8;
  line-height: 1.5;
}

.upload-field {
  padding: 16px;
  border: 1px dashed #777;
  border-radius: 12px;
  background: #fafafa;
}

.upload-field input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #aaa;
  border-radius: 8px;
  background: #fff;
}

.error-summary {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-left: 5px solid var(--danger);
  background: #fdeaea;
  color: #721414;
}

.error-summary ul {
  margin: 8px 0 0 20px;
}

.kyc-page .form-status {
  margin: 20px 0 0;
}

.kyc-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(22px, 5vw, 72px);
  background: #080808;
  color: #fff;
}

.kyc-footer p {
  margin: 0;
}

.kyc-footer a {
  color: #fff;
}

.legal-page main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 60px 0 90px;
}

.legal-document {
  padding: clamp(25px, 5vw, 58px);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .08);
}

.legal-document h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -.05em;
}

.legal-document h2 {
  margin: 36px 0 12px;
  font-size: 24px;
}

.legal-document p,
.legal-document li {
  font-size: 16px;
  line-height: 1.7;
}

.legal-document ul {
  padding-left: 24px;
}

.legal-document code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 920px) {
  .kyc-intro,
  .kyc-layout {
    grid-template-columns: 1fr;
  }

  .progress-panel {
    position: static;
  }

  .progress-panel ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .progress-panel li {
    display: grid;
    justify-items: center;
    gap: 7px;
    text-align: center;
    font-size: 12px;
  }
}

@media (max-width: 680px) {
  .kyc-header {
    align-items: flex-start;
  }

  .kyc-brand span {
    display: none;
  }

  .kyc-page main {
    width: min(100% - 24px, 1280px);
    padding-top: 34px;
  }

  .kyc-intro {
    gap: 24px;
  }

  .progress-panel {
    padding: 18px 14px;
  }

  .security-note,
  .progress-title {
    display: none;
  }

  .form-card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .step-actions {
    flex-direction: column-reverse;
  }

  .step-actions button {
    width: 100%;
  }

  .kyc-footer {
    display: grid;
    text-align: center;
  }
}
