:root {
  --navy: #071b4f;
  --blue: #0b67f3;
  --blue-dark: #0756d4;
  --red: #e30613;
  --ink: #0a1838;
  --muted: #63708d;
  --line: #dce3ed;
  --soft: #f7f9fc;
  --green: #0a8a38;
  --green-soft: #eff8f2;
  --shadow: 0 18px 55px rgba(16, 37, 79, .14), 0 3px 10px rgba(16, 37, 79, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -15%, rgba(11, 103, 243, .09), transparent 38%),
    #f3f6fb;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.apply-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.preview-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 16px 46px;
}

body:has(.language-toast:not([hidden])) .preview-shell {
  padding-bottom: 136px;
}

.preview-flag {
  position: fixed;
  z-index: 10;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: #5f6c85;
  background: rgba(255,255,255,.92);
  border: 1px solid #dbe2ed;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(18,38,75,.08);
  font-size: 11px;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.preview-flag span:first-child {
  color: #fff;
  background: var(--navy);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
}

.language-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255,255,255,.98);
  border: 1px solid #d8e1ee;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(7, 27, 79, .22), 0 3px 10px rgba(7, 27, 79, .08);
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 160ms cubic-bezier(.23,1,.32,1), transform 160ms cubic-bezier(.23,1,.32,1);
}
.language-toast[hidden] { display: none; }
.language-toast.is-closing { pointer-events: none; opacity: 0; transform: translate(-50%, 7px); }
.language-toast-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #eef5ff;
  border-radius: 50%;
}
.language-toast-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.language-toast-copy strong, .language-toast-copy small { display: block; }
.language-toast-copy strong { font-size: 13px; line-height: 1.2; }
.language-toast-copy small { margin-top: 3px; color: #66738c; font-size: 10.5px; }
.language-options { display: flex; gap: 5px; }
.language-options button {
  width: 56px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid #d7e0ed;
  border-radius: 8px;
  color: #3e4b66;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 140ms cubic-bezier(.23,1,.32,1), color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.language-flag {
  width: 22px;
  height: 16px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(7,27,79,.13);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(7,27,79,.08);
}
.language-options button[aria-pressed="true"] .language-flag { border-color: rgba(255,255,255,.55); }
.language-options button[aria-pressed="true"] { color: #fff; background: var(--blue); border-color: var(--blue); }
.language-options button:active { transform: scale(.96); }
.language-options button:focus-visible { outline: 3px solid rgba(11,103,243,.28); outline-offset: 2px; }

.phone {
  width: min(430px, calc(100vw - 24px));
  min-height: 806px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 4px solid var(--navy);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.app-header { padding: 20px 24px 0; }
.brand {
  text-align: center;
  color: var(--red);
  font-size: 23px;
  line-height: 1;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -.055em;
}
.brand span { letter-spacing: -.07em; }

.intro { text-align: center; margin-top: 12px; }
.intro h1 { margin: 0; font-size: 27px; line-height: 1.08; letter-spacing: -.035em; }
.intro p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0 15px;
  padding: 0;
  position: relative;
}
.stepper::before {
  content: "";
  position: absolute;
  height: 3px;
  left: 16.6%;
  right: 16.6%;
  top: 15px;
  background: #d9dee8;
}
.step-marker { position: relative; z-index: 1; text-align: center; }
.step-marker::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 3px;
  background: transparent;
}
.step-marker.is-complete::after { background: var(--blue); }
.step-marker:last-child::after { display: none; }
.step-marker button { appearance: none; border: 0; background: transparent; padding: 0 6px; cursor: pointer; }
.step-marker button > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 2px solid #cfd5df;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  transition: .18s ease;
}
.step-marker small { display: block; margin-top: 7px; color: #485573; font-size: 12px; font-weight: 600; }
.step-marker.is-active button > span, .step-marker.is-complete button > span { border-color: var(--blue); }
.step-marker.is-active button > span { color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(11,103,243,.25); }
.step-marker.is-active small { color: var(--blue); }

.privacy-strip {
  height: 39px;
  margin: 0 16px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.privacy-strip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.screen-stack { flex: 1; display: flex; }
.screen {
  width: 100%;
  min-height: 100%;
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  animation: screen-in .24s ease both;
}
.screen[hidden] { display: none; }
@keyframes screen-in { from { opacity: 0; transform: translateX(9px); } to { opacity: 1; transform: none; } }

.screen h2 { margin: 0 5px 10px; font-size: 20px; line-height: 1.15; letter-spacing: -.025em; }

.field-list, .field-group, .identity-card, .choice-row, .review-row, .consent-row {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 4px rgba(14, 35, 73, .04);
}
.field-list { border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.form-section { margin: 0 0 10px; }
.form-section h3 { margin: 0 5px 6px; font-size: 14px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; }
.field-group { min-width: 0; overflow: hidden; border-radius: 9px; }
.field-group .field-row { border: 0; border-bottom: 1px solid var(--line); }
.field-group .field-row:last-child { border-bottom: 0; }
.field-row {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
}
.field-list .field-row { border: 0; border-bottom: 1px solid var(--line); }
.field-list .field-row:last-child { border-bottom: 0; }
.field-row > svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #74809b; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field-row input { min-width: 0; flex: 1; border: 0; outline: 0; color: #34415f; background: transparent; font-size: 12.5px; }
.field-row input::placeholder { color: rgba(96, 110, 139, .52); opacity: 1; }
.field-row input:-webkit-autofill { -webkit-text-fill-color: #34415f; }
.field-row:focus-within { position: relative; z-index: 1; border-color: #83aff8; box-shadow: 0 0 0 2px rgba(11,103,243,.09); }
.field-row:has(input[aria-invalid="true"]), .field-row.is-invalid { position: relative; z-index: 1; border-color: #c72c41; background: #fff4f6; box-shadow: inset 3px 0 0 #c72c41, 0 0 0 1px rgba(199,44,65,.16); }
.field-row.is-invalid > svg { stroke: #c72c41; }
.identity-panel input[aria-invalid="true"] { border-color: #c72c41; background: #fff4f6; box-shadow: 0 0 0 2px rgba(199,44,65,.16); }
.row-chevron { color: #71809e; font-size: 18px; line-height: 1; }

.field-suffix { flex: 0 0 auto; color: #71809e; font-size: 10.5px; font-weight: 650; }

.identity-card { margin-bottom: 10px; border-radius: 10px; overflow: hidden; }
.identity-toggle { width: 100%; min-height: 59px; display: grid; grid-template-columns: 35px 1fr 21px; align-items: center; gap: 10px; padding: 8px 11px; border: 0; background: #fff; text-align: left; cursor: pointer; }
.identity-toggle strong, .identity-toggle small { display: block; }
.identity-toggle strong { font-size: 13px; }
.identity-toggle small { margin-top: 3px; color: #53617e; font-size: 10.5px; }
.identity-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: #f3f7ff; }
.identity-icon svg, .identity-toggle .disclosure { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.identity-toggle .disclosure { transition: transform .2s ease; }
.identity-toggle[aria-expanded="true"] .disclosure { transform: rotate(90deg); }
.identity-panel { padding: 0 13px 12px 58px; border-top: 1px solid #edf0f5; }
.identity-panel[hidden] { display: none; }
.identity-panel label { display: block; margin-top: 9px; color: #46536e; font-size: 11px; font-weight: 700; }
.identity-panel input { width: 100%; margin-top: 4px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.identity-panel p { margin: 7px 0 0; color: #707c94; font-size: 9.5px; }
.upload-label input { position: absolute; opacity: 0; pointer-events: none; }
.upload-label span { display: block; margin-top: 4px; padding: 8px 9px; border: 1px dashed #b8c4d7; border-radius: 7px; color: var(--blue); background: #f7faff; text-align: center; }
.upload-label:has(input[aria-invalid="true"]) span, .upload-label.is-invalid span { border: 2px solid #c72c41; color: #b4233a; background: #fff4f6; box-shadow: 0 0 0 3px rgba(199,44,65,.12); }
.upload-label.is-invalid:focus { outline: 0; }

.primary-action {
  width: 100%;
  min-height: 50px;
  margin-top: auto;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(11,103,243,.2);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.primary-action:hover { background: var(--blue-dark); }
.primary-action:active { transform: translateY(1px); }
.primary-action:disabled { cursor: wait; opacity: .68; transform: none; }
.primary-action:focus-visible, .step-marker button:focus-visible, .identity-toggle:focus-visible, .choice-row:focus-visible, .review-row button:focus-visible, .confirm-dialog button:focus-visible { outline: 3px solid rgba(11,103,243,.28); outline-offset: 2px; }

.choice-list { display: grid; gap: 12px; }
.choice-row { width: 100%; min-height: 91px; display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 14px; padding: 14px; border-radius: 10px; text-align: left; cursor: pointer; }
.choice-icon, .review-icon { display: grid; place-items: center; color: var(--blue); background: #f1f6ff; border-radius: 50%; }
.choice-icon { width: 50px; height: 50px; }
.choice-icon svg { width: 30px; height: 30px; }
.choice-row svg, .review-row svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.choice-row strong, .choice-row small { display: block; }
.choice-row strong { font-size: 16px; }
.choice-row small { margin-top: 5px; color: #67738c; font-size: 13px; }
.switch { width: 48px; height: 28px; padding: 3px; border-radius: 999px; background: #bfc5cf; transition: background .2s ease; }
.switch i { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .2s ease; }
.choice-row[aria-pressed="true"] .switch { background: var(--blue); }
.choice-row[aria-pressed="true"] .switch i { transform: translateX(20px); }
.cobuyer-panel {
  padding: 12px;
  border: 1px solid #cfdcf0;
  border-radius: 12px;
  background: #fbfdff;
  box-shadow: 0 7px 22px rgba(18, 53, 112, .07);
}
.cobuyer-panel[hidden] { display: none; }
.cobuyer-header {
  display: grid;
  grid-template-columns: 35px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 1px 12px;
}
.cobuyer-header-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #edf4ff;
  border-radius: 50%;
}
.cobuyer-header-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cobuyer-header strong, .cobuyer-header small { display: block; }
.cobuyer-header strong { font-size: 14px; }
.cobuyer-header small { margin-top: 2px; color: #66738c; font-size: 10.5px; }
.cobuyer-contact-fields { margin-bottom: 10px; }
.cobuyer-panel .form-section { margin-bottom: 10px; }
.cobuyer-panel .identity-card { margin-bottom: 0; }
.trade-panel .trade-loan-section { margin-bottom: 0; }
.review-list { display: grid; gap: 7px; margin-bottom: 8px; }
.review-row { min-height: 67px; display: grid; grid-template-columns: 42px 1fr auto 13px; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; }
.review-icon {
  width: 38px;
  height: 38px;
  justify-self: center;
  color: #0d63e6;
  background: #f3f7fd;
  border: 1px solid #e4ecf8;
  line-height: 0;
}
.review-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.review-row div { min-width: 0; }
.review-row strong, .review-row div span { display: block; }
.review-row strong { margin-bottom: 2px; font-size: 12px; }
.review-row div span { overflow: hidden; color: #22304e; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.review-row button { border: 0; padding: 5px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.review-row .chevron { width: 13px; height: 13px; color: var(--blue); }
.review-row.is-incomplete { border-color: #e9a9b3; background: #fff8f9; }
.review-row.is-incomplete #review-identity-status { color: #b4233a; font-weight: 750; }
.review-cobuyer-row[hidden], .review-trade-row[hidden], .cobuyer-consent-row[hidden] { display: none; }
.consent-row { min-height: 57px; display: grid; grid-template-columns: 19px 1fr; align-items: start; gap: 10px; margin-bottom: 7px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.consent-row:has(input[aria-invalid="true"]), .consent-row.is-invalid { border: 1px solid #c72c41; background: #fff4f6; box-shadow: 0 0 0 2px rgba(199,44,65,.12); }
.consent-row strong, .consent-row small { display: block; }
.consent-row strong { font-size: 10.5px; }
.consent-row small { margin-top: 3px; color: #52607b; font-size: 9.5px; line-height: 1.4; }
.consent-row em { color: #68758e; font-style: normal; font-weight: 500; }
.form-message { min-height: 16px; margin: 0 2px 4px; color: #c72c41; font-size: 10.5px; font-weight: 700; text-align: center; }
.step-error { min-height: 16px; margin: 0 2px 5px; color: #c72c41; font-size: 10.5px; font-weight: 700; text-align: center; }
.submit-note { margin: 7px 0 0; color: #68758e; font-size: 10px; text-align: center; }

.success-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px 26px; text-align: center; }
.success-panel[hidden] { display: none; }
.success-icon { width: 76px; height: 76px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; box-shadow: 0 12px 26px rgba(10,138,56,.22); }
.success-icon svg { width: 39px; height: 39px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success-panel h2 { margin: 22px 0 8px; font-size: 26px; }
.success-panel p { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.success-panel .primary-action { margin-top: 0; }
.success-reference { font-variant-numeric: tabular-nums; }
.success-link { display: grid; place-items: center; text-decoration: none; }
.submit-error { min-height: 0; margin-bottom: 8px; padding: 9px 10px; border: 1px solid #f0b9c2; border-radius: 8px; background: #fff5f6; }
.offline-panel { width: min(430px, calc(100vw - 24px)); margin: 12vh auto; padding: 28px; border: 1px solid #dce3ed; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: var(--shadow); text-align: center; }
.offline-panel h2 { margin: 0 0 10px; font-size: 22px; }
.offline-panel p { margin: 0; color: var(--muted); line-height: 1.55; }
.offline-panel a { color: var(--blue); font-weight: 800; }

.confirm-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 27, 79, .28);
  text-align: center;
}
.confirm-dialog::backdrop { background: rgba(7, 20, 48, .48); backdrop-filter: blur(2px); }
.confirm-dialog-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: #b42336;
  background: #fff1f3;
  border-radius: 50%;
}
.confirm-dialog-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-dialog h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.confirm-dialog p { margin: 8px 0 18px; color: #5f6c85; font-size: 12px; line-height: 1.5; }
.confirm-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-dialog-actions button {
  min-height: 43px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms cubic-bezier(.23,1,.32,1), background 140ms ease;
}
.confirm-dialog-actions button:active { transform: scale(.97); }
.secondary-action { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.danger-action { border: 1px solid #b42336; color: #fff; background: #b42336; }

@media (max-width: 520px) {
  .preview-shell { display: block; padding: 0; }
  .preview-flag { position: static; transform: none; justify-content: center; width: 100%; border-width: 0 0 1px; border-radius: 0; box-shadow: none; }
  .phone { width: 100%; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .app-header { padding-top: 15px; }
  .language-toast { grid-template-columns: 40px minmax(0, 1fr); }
  .language-options { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .language-options button { width: 100%; }
}

@media (max-width: 360px) {
  .app-header { padding-inline: 17px; }
  .screen { padding-inline: 10px; }
  .choice-row { grid-template-columns: 42px 1fr auto; gap: 9px; padding: 11px; }
  .choice-icon { width: 42px; height: 42px; }
}

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