:root {
  --blue-950: #061f49;
  --blue-900: #082a60;
  --blue-800: #0b3c88;
  --blue-700: #005eb8;
  --blue-600: #0576d8;
  --blue-100: #eaf4ff;
  --blue-050: #f5faff;
  --orange-600: #f58220;
  --orange-700: #ec6e00;
  --orange-100: #fff0df;
  --ink: #10223f;
  --muted: #66738a;
  --line: #dbe6f4;
  --surface: #ffffff;
  --background: #f6f9fd;
  --danger: #c83d31;
  --success: #137b46;
  --shadow: 0 18px 50px rgba(8, 42, 96, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--background) 46%, #eef6ff 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 18px clamp(20px, 5vw, 64px);
  background: linear-gradient(90deg, var(--blue-950), var(--blue-800));
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img,
.footer img {
  display: block;
  width: 186px;
  height: auto;
  filter: brightness(0) invert(1);
}

.security-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.icon-shield,
.highlight-icon,
.success-icon {
  display: inline-block;
  width: 34px;
  height: 34px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.icon-shield {
  width: 24px;
  height: 24px;
  color: #ffffff;
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3l7 3v5c0 4.3-2.8 8.3-7 10-4.2-1.7-7-5.7-7-10V6l7-3z' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M8.8 12l2.1 2.1 4.5-4.7' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(30px, 6vw, 84px);
  align-items: center;
  padding: clamp(44px, 7vw, 76px) 0 34px;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--blue-950);
  font-size: clamp(2.55rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero h1::first-line {
  color: var(--blue-950);
}

.hero p {
  max-width: 620px;
  margin: 22px 0 0;
  color: #52617a;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 44px rgba(8, 42, 96, 0.08);
  backdrop-filter: blur(10px);
}

.hero-highlights div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  color: var(--blue-900);
}

.hero-highlights div + div {
  border-left: 1px solid var(--line);
}

.hero-highlights strong {
  max-width: 150px;
  font-size: 0.95rem;
  line-height: 1.3;
}

.highlight-icon {
  color: var(--blue-600);
}

.document-icon {
  mask-image: url("data:image/svg+xml,%3Csvg width='36' height='36' viewBox='0 0 36 36' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4h11l5 5v23H10V4z' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M21 4v6h6M14 17h10M14 22h10M14 27h7' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.lock-icon {
  mask-image: url("data:image/svg+xml,%3Csvg width='36' height='36' viewBox='0 0 36 36' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 15h18v15H9V15z' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M13 15v-4a5 5 0 0110 0v4M18 21v4' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.clock-icon {
  mask-image: url("data:image/svg+xml,%3Csvg width='36' height='36' viewBox='0 0 36 36' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='18' r='13' stroke='%23000' stroke-width='2.4'/%3E%3Cpath d='M18 10v9l6 3' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.diagnostic-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px 0 18px;
}

.progress-panel,
.form-card,
.success-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.progress-panel {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--blue-950);
}

.progress-kicker,
#step-count {
  display: block;
  margin-bottom: 6px;
  color: var(--blue-600);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#progress-percent {
  color: var(--orange-700);
  font-weight: 900;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin: 20px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-100);
}

#progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-600), var(--orange-600));
  transition: width 220ms ease;
}

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

.step-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.step-button:hover {
  transform: translateY(-1px);
  border-color: #b9d8f8;
  background: var(--blue-050);
}

.step-button.is-active {
  border-color: #aad2ff;
  color: var(--blue-900);
  background: linear-gradient(180deg, #f8fcff, #eef7ff);
}

.step-button.is-complete .step-number,
.step-button.is-active .step-number {
  color: #ffffff;
  background: var(--blue-600);
  border-color: var(--blue-600);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #c8d6e7;
  border-radius: 50%;
  color: var(--blue-800);
  background: #ffffff;
  font-weight: 900;
}

.step-text strong {
  display: block;
  color: currentColor;
  font-size: 0.9rem;
  line-height: 1.25;
}

.step-text span {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.form-card {
  min-height: 680px;
  padding: clamp(22px, 4vw, 46px);
}

.form-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.form-card h2,
.success-panel h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.12;
}

.form-card-header p,
.success-panel p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.question-counter {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--blue-800);
  background: var(--blue-100);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.is-wide {
  grid-column: 1 / -1;
}

.field label {
  color: var(--blue-950);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
}

.field label span {
  color: var(--orange-700);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #cbd9eb;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(8, 42, 96, 0.03);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input,
.field select {
  min-height: 56px;
  padding: 0 16px;
}

.field select {
  appearance: none;
  padding-right: 46px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--blue-700) 50%),
    linear-gradient(135deg, var(--blue-700) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 24px,
    calc(100% - 16px) 24px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  padding: 14px 16px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(5, 118, 216, 0.13);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8795ab;
}

.field-error {
  min-height: 17px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.form-alert {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #f1b5ae;
  border-radius: 8px;
  color: var(--danger);
  background: #fff4f2;
  font-weight: 700;
}

.form-alert.is-success {
  border-color: #afe0c6;
  color: var(--success);
  background: #f0fff6;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange-600), var(--orange-700));
  box-shadow: 0 12px 24px rgba(245, 130, 32, 0.26);
}

.button-primary:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}

.button-secondary {
  color: var(--blue-800);
  border-color: #b9d3ee;
  background: #ffffff;
}

.button-secondary:hover {
  background: var(--blue-050);
}

.success-panel {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 10px 0 34px;
  padding: clamp(26px, 5vw, 46px);
  background: linear-gradient(135deg, #ffffff, #edf7ff);
}

.success-icon {
  width: 94px;
  height: 94px;
  color: var(--blue-600);
  border-radius: 50%;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg width='96' height='96' viewBox='0 0 96 96' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='48' cy='48' r='42' stroke='%23000' stroke-width='5'/%3E%3Cpath d='M29 49l13 13 26-30' stroke='%23000' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.success-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.success-details span {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--blue-800);
  background: #ffffff;
  border: 1px solid #cfe2f8;
  font-size: 0.9rem;
  font-weight: 800;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 84px;
  padding: 20px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--blue-950), var(--blue-800));
  text-align: center;
}

.footer img {
  width: 145px;
}

.footer span {
  font-weight: 700;
  color: #dbeaff;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  main {
    width: min(100% - 28px, 760px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-highlights {
    min-height: 120px;
  }

  .diagnostic-shell {
    grid-template-columns: 1fr;
  }

  .progress-panel {
    position: static;
  }

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

@media (max-width: 700px) {
  .topbar,
  .footer {
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
  }

  .security-note {
    font-size: 0.88rem;
  }

  .brand img {
    width: 158px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 14vw, 3.4rem);
  }

  .hero-highlights {
    grid-template-columns: 1fr;
  }

  .hero-highlights div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .step-list,
  .form-content {
    grid-template-columns: 1fr;
  }

  .form-card {
    min-height: 0;
    padding: 22px;
  }

  .form-card-header,
  .form-actions,
  .success-panel {
    flex-direction: column;
  }

  .form-card-header {
    display: grid;
  }

  .question-counter {
    justify-self: start;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .success-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .success-icon {
    margin: 0 auto;
  }
}
