:root {
  --ap-page: #ffffff;
  --ap-canvas: #f4f6f9;
  --ap-navy: #14233d;
  --ap-navy-deep: #101d34;
  --ap-gold: #caa557;
  --ap-gold-soft: #dcc17e;
  --ap-cyan: #45afc1;
  --ap-cyan-soft: #79c9d5;
  --ap-muted: #7889a3;
  --ap-soft: #f7f8fb;
  --ap-hairline: #e7ebf1;
  --ap-danger: #b94343;
  --ap-success: #19745f;
  --ap-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ap-navy);
  background: var(--ap-canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--ap-canvas);
}

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

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.progress-rail {
  position: fixed;
  z-index: 80;
  inset: 0 0 auto;
  height: 4px;
  background: rgba(20, 35, 61, 0.07);
}

.progress-rail span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ap-gold);
  transition: width 420ms var(--ap-ease);
}

.site-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(40px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  background: var(--ap-page);
}

.brand-hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.brand-logo {
  width: 118px;
  height: 118px;
  border-radius: 29px;
  object-fit: cover;
  box-shadow: 0 20px 44px rgba(15, 31, 56, 0.16);
}

.brand-kicker {
  margin: 21px 0 8px;
  color: var(--ap-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.brand-hero h1 {
  margin: 0;
  color: var(--ap-gold);
  font-size: clamp(36px, 8vw, 43px);
  line-height: 1.08;
  letter-spacing: 0.09em;
}

.brand-hero h1 span {
  color: #dde3ec;
}

.hero-title {
  margin: 17px 0 0;
  color: var(--ap-navy);
  font-size: clamp(20px, 5.5vw, 27px);
  font-weight: 780;
  letter-spacing: 0.03em;
}

.hero-subtitle {
  max-width: 520px;
  margin: 10px auto 0;
  color: var(--ap-muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: #61728c;
  font-size: 12px;
  font-weight: 750;
}

.hero-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ap-gold);
}

.hero-divider {
  height: 1px;
  margin: 34px 0 30px;
  background: linear-gradient(90deg, transparent, var(--ap-hairline) 18%, var(--ap-hairline) 82%, transparent);
}

.state-panel,
.success-panel {
  padding: 42px 24px;
  border: 1px solid var(--ap-hairline);
  border-radius: 25px;
  text-align: center;
  background: #fff;
}

.state-panel p {
  margin: 14px 0 0;
  color: var(--ap-muted);
}

.state-panel h2 {
  margin: 0;
  font-size: 21px;
}

.state-panel--error {
  color: var(--ap-danger);
  background: #fffafa;
}

.spinner,
.button-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(202, 165, 87, 0.22);
  border-top-color: var(--ap-gold);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.questionnaire {
  animation: rise-in 560ms var(--ap-ease) both;
}

.step-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 28px;
}

.step-item {
  position: relative;
  min-width: 0;
  padding-top: 14px;
  border: 0;
  color: #a0adbf;
  background: transparent;
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.step-item::before {
  position: absolute;
  inset: 0 3px auto;
  height: 4px;
  border-radius: 999px;
  background: var(--ap-hairline);
  content: "";
  transition: background 260ms ease;
}

.step-item.is-active {
  color: var(--ap-navy);
}

.step-item.is-active::before,
.step-item.is-complete::before {
  background: var(--ap-gold);
}

.form-step {
  animation: step-in 430ms var(--ap-ease) both;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 9px;
}

.section-heading span {
  display: block;
  margin-bottom: 6px;
  color: var(--ap-gold);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.section-heading h2 {
  margin: 0;
  color: var(--ap-navy);
  font-size: 25px;
  letter-spacing: 0.02em;
}

.section-heading b {
  flex: 0 0 auto;
  color: #a7b1c1;
  font-size: 13px;
}

.section-heading--cyan span {
  color: var(--ap-cyan);
}

.section-copy {
  margin: 0 0 21px;
  color: var(--ap-muted);
  font-size: 14px;
  line-height: 1.65;
}

.question-card {
  margin-top: 14px;
  padding: 22px;
  border: 1px solid var(--ap-hairline);
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 31, 56, 0.035);
}

.question-card.has-error {
  border-color: rgba(185, 67, 67, 0.58);
  box-shadow: 0 0 0 3px rgba(185, 67, 67, 0.07);
}

.question-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.question-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(202, 165, 87, 0.48);
  border-radius: 12px;
  color: var(--ap-gold);
  background: #fffcf4;
  font-size: 12px;
  font-weight: 850;
}

.question-card[data-accent="cyan"] .question-number {
  border-color: rgba(69, 175, 193, 0.42);
  color: var(--ap-cyan);
  background: #f5fcfd;
}

.question-title {
  margin: 1px 0 0;
  color: var(--ap-navy);
  font-size: 17px;
  line-height: 1.5;
}

.question-hint {
  margin: 5px 0 0;
  color: var(--ap-muted);
  font-size: 12px;
  line-height: 1.6;
}

.question-required {
  margin-left: 4px;
  color: var(--ap-gold);
  font-style: normal;
}

.option-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 17px;
}

.option-choice {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--ap-hairline);
  border-radius: 16px;
  color: #43536b;
  background: #fafbfd;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.option-choice:hover {
  border-color: rgba(202, 165, 87, 0.48);
}

.option-choice:active {
  transform: scale(0.988);
}

.option-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.option-box {
  position: relative;
  width: 23px;
  height: 23px;
  border: 1.5px solid #b6c0ce;
  border-radius: 7px;
  background: #fff;
  transition: all 180ms ease;
}

.option-choice[data-kind="radio"] .option-box {
  border-radius: 50%;
}

.option-choice:has(input:checked) {
  border-color: rgba(202, 165, 87, 0.65);
  color: var(--ap-navy);
  background: #fffcf5;
}

.question-card[data-accent="cyan"] .option-choice:has(input:checked) {
  border-color: rgba(69, 175, 193, 0.55);
  background: #f5fcfd;
}

.option-choice input:checked + .option-box {
  border-color: var(--ap-gold);
  background: var(--ap-gold);
}

.question-card[data-accent="cyan"] .option-choice input:checked + .option-box {
  border-color: var(--ap-cyan);
  background: var(--ap-cyan);
}

.option-choice input:checked + .option-box::after {
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.option-choice[data-kind="radio"] input:checked + .option-box::after {
  left: 5px;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}

.other-field {
  margin-top: 10px;
}

.field {
  display: block;
}

.field > span,
.text-label {
  display: block;
  margin-bottom: 8px;
  color: #3c4b62;
  font-size: 13px;
  font-weight: 760;
}

.field em {
  color: var(--ap-gold);
  font-style: normal;
}

.field input,
.field textarea,
.question-textarea,
.question-input,
.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  outline: none;
  color: var(--ap-navy);
  background: #fbfcfe;
  font-size: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input,
.question-input,
.admin-input,
.admin-select {
  min-height: 50px;
  padding: 0 14px;
}

.field textarea,
.question-textarea,
.admin-textarea {
  min-height: 118px;
  padding: 13px 14px;
  line-height: 1.7;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.question-textarea:focus,
.question-input:focus,
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: var(--ap-gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(202, 165, 87, 0.11);
}

.question-textarea {
  margin-top: 17px;
}

.triplet-list {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}

.triplet-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.triplet-item span {
  color: var(--ap-gold);
  font-size: 13px;
  font-weight: 850;
}

.contact-grid {
  display: grid;
  gap: 17px;
}

.privacy-note {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px solid rgba(69, 175, 193, 0.2);
  border-radius: 17px;
  background: #f6fbfc;
}

.privacy-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ap-cyan);
  font-weight: 900;
}

.privacy-note p {
  margin: 1px 0 0;
  color: #607188;
  font-size: 12px;
  line-height: 1.65;
}

.privacy-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ap-navy);
  font-size: 13px;
}

.upload-zone {
  display: block;
  margin-top: 17px;
  padding: 25px 16px;
  border: 1.5px dashed #cbd3df;
  border-radius: 18px;
  text-align: center;
  background: #fafbfd;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--ap-gold);
  background: #fffcf5;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  place-items: center;
  border: 1px solid rgba(202, 165, 87, 0.38);
  border-radius: 13px;
  color: var(--ap-gold);
  background: #fff;
  font-size: 22px;
}

.upload-zone strong {
  display: block;
  font-size: 14px;
}

.upload-zone small {
  display: block;
  margin-top: 5px;
  color: var(--ap-muted);
  font-size: 11px;
  line-height: 1.5;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #f5f7fa;
}

.file-item-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--ap-navy);
  font-size: 10px;
  font-weight: 850;
}

.file-item p {
  min-width: 0;
  margin: 0;
}

.file-item strong,
.file-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item strong {
  font-size: 12px;
}

.file-item span {
  margin-top: 2px;
  color: var(--ap-muted);
  font-size: 10px;
}

.file-remove {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--ap-muted);
  background: #fff;
  font-size: 17px;
}

.case-link-field {
  margin-top: 14px;
}

.consent-box {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--ap-hairline);
  border-radius: 16px;
  color: #617188;
  background: #fafbfd;
  font-size: 12px;
  line-height: 1.65;
  cursor: pointer;
}

.consent-box input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--ap-gold);
}

.form-error {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(185, 67, 67, 0.25);
  border-radius: 14px;
  color: var(--ap-danger);
  background: #fff5f5;
  font-size: 13px;
  line-height: 1.55;
}

.form-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.button {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 21px;
  font-size: 14px;
  font-weight: 830;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:active {
  transform: scale(0.982);
}

.button:focus-visible,
.step-item:focus-visible,
.option-choice:has(input:focus-visible) {
  outline: 3px solid rgba(69, 175, 193, 0.38);
  outline-offset: 3px;
}

.button--primary {
  border: 1px solid rgba(202, 165, 87, 0.46);
  color: #fff;
  background: var(--ap-navy);
  box-shadow: 0 11px 22px rgba(20, 35, 61, 0.14);
}

.button--primary:hover {
  box-shadow: 0 14px 26px rgba(20, 35, 61, 0.19);
  transform: translateY(-2px);
}

.button--secondary {
  border: 1px solid var(--ap-hairline);
  color: var(--ap-navy);
  background: #fff;
}

#nextButton,
#submitButton {
  width: 100%;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 7px;
  vertical-align: middle;
}

#submitButton.is-loading .button-spinner {
  display: inline-block;
}

#submitButton.is-loading .submit-label {
  opacity: 0.7;
}

.autosave-note {
  margin: 11px 0 0;
  color: #a0adbf;
  font-size: 11px;
  text-align: center;
}

.success-panel {
  padding: 38px 24px;
  animation: rise-in 560ms var(--ap-ease) both;
}

.success-mark {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ap-success);
  box-shadow: 0 16px 32px rgba(25, 116, 95, 0.18);
  font-size: 32px;
  font-weight: 850;
}

.success-panel h2 {
  margin: 4px 0 12px;
  font-size: 25px;
}

.success-panel > p:not(.brand-kicker, .success-tip) {
  max-width: 470px;
  margin: 0 auto;
  color: var(--ap-muted);
  font-size: 14px;
  line-height: 1.75;
}

.success-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 390px;
  margin: 24px auto 0;
  padding: 13px 15px;
  border: 1px solid var(--ap-hairline);
  border-radius: 14px;
  background: #fafbfd;
}

.success-id span {
  color: var(--ap-muted);
  font-size: 12px;
}

.success-id strong {
  color: var(--ap-navy);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.success-tip {
  margin: 15px 0 0;
  color: var(--ap-success);
  font-size: 12px;
}

.site-footer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--ap-hairline);
}

.site-footer img {
  border-radius: 8px;
}

.site-footer p {
  margin: 0;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  font-size: 11px;
}

.site-footer span {
  margin-top: 2px;
  color: var(--ap-muted);
  font-size: 9px;
}

@media (min-width: 620px) {
  .site-shell {
    padding-inline: 50px;
  }

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

  .question-card {
    padding: 25px;
  }

  .form-actions {
    grid-template-columns: 150px minmax(0, 1fr);
  }
}

@media (max-width: 380px) {
  .site-shell {
    padding-inline: 18px;
  }

  .brand-logo {
    width: 104px;
    height: 104px;
    border-radius: 26px;
  }

  .hero-meta {
    gap: 7px;
  }

  .question-card {
    padding: 18px;
  }

  .question-head {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .question-number {
    width: 34px;
    height: 34px;
  }

  .step-item {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}
