:root {
  --bg: #fcfcfd;
  --ink: #17181c;
  --muted: #6b6f78;
  --field: #e9e9ec;
  --field-focus: #dfe3ea;
  --line: #d9dbe0;
  --blue: #1b7fb8;
  --sky: #2ba0db;
  --pink: #ef509c;
  --blue-dark: #156693;
  --danger: #c4261d;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: #d9ecf8; color: var(--ink);
  font: 16px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}
.layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 24px; max-width: 1240px; margin: 32px auto; padding: 16px; background: #fff; border-radius: 24px; box-shadow: 0 10px 40px rgba(20,90,140,.15); }
.shell { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 20px 64px; }

/* contact sidebar */
.sidebar {
  position: relative; align-self: stretch; min-height: 560px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: 40px 36px; border-radius: 20px; color: #fff; overflow: hidden;
  background: linear-gradient(165deg, var(--sky) 0%, var(--blue) 60%, #0f5580 100%);
}
.brand { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.sidebar-lead { margin: 2px 0 36px; opacity: .75; font-size: 14px; }
.sidebar h2 { font-size: 20px; line-height: 1.3; margin: 0 0 20px; }
.contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.contact li { display: flex; gap: 14px; align-items: flex-start; }
.contact svg { flex: none; width: 36px; height: 36px; padding: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.contact span { display: grid; font-weight: 500; overflow-wrap: anywhere; }
.contact small { font-size: 12px; opacity: .7; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.contact a { color: #fff; text-decoration: none; }
.contact a:hover { text-decoration: underline; }
.sidebar::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--pink); opacity: .9; pointer-events: none; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-foot { margin: 0; font-size: 13px; opacity: .7; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding: 12px; margin: 12px; border-radius: 20px; }
  .sidebar { position: static; height: auto; min-height: 0; padding: 22px; gap: 16px; }
  .sidebar-lead { margin-bottom: 14px; }
  .sidebar-foot { display: none; }
  .contact { gap: 12px; }
}
h1 { font-size: 28px; line-height: 1.2; margin: 28px 0 20px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 28px 0 4px; }
.muted { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* step navigator */
.topbar { position: sticky; top: 0; z-index: 5; background: #fff; padding: 8px 0 0; }
.stepnav { position: relative; display: inline-block; }
.stepnav-btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  background: var(--field); color: var(--ink); font: inherit; font-weight: 500;
  padding: 12px 16px; border-radius: var(--radius);
}
.stepnav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; margin: 0; padding: 8px; list-style: none;
  width: max-content; min-width: 280px; max-height: 70vh; overflow: auto;
  background: #fafafa; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.stepnav-menu li button {
  display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 500; color: var(--ink); padding: 10px 12px; border-radius: 10px; text-align: left;
}
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% - 4px); margin: 0; padding: 6px; list-style: none;
  max-height: 260px; overflow: auto;
  background: #fafafa; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.ac-list[hidden] { display: none; }
.ac-list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.ac-list li.active { background: #efeff2; }
.stepnav-menu li button:hover:not(:disabled) { background: #efeff2; }
.stepnav-menu li button:disabled { color: #9a9ea6; cursor: default; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd1d6; flex: none; display: grid; place-items: center; }
.dot.current { border-color: #2ba0db; }
.dot.current::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #2ba0db; }
.dot.done { background: var(--blue); border-color: var(--blue); }
.dot.done::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.progress { height: 4px; background: var(--field); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--pink)); transition: width .25s; }

/* sections and fields */
.section { margin-bottom: 8px; }
.section > .section-desc { margin: 0 0 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.grid .full { grid-column: 1 / -1; }
.cols { display: grid; gap: 18px; }
.cols.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .cols.c3 { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}
.field label.lbl, .field .lbl { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.req { color: var(--danger); }
.help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number],
.field input[type=date], .field select, .field textarea {
  width: 100%; border: 2px solid transparent; background: var(--field); color: var(--ink);
  font: inherit; padding: 14px 16px; border-radius: var(--radius); outline: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { background: var(--field-focus); border-color: var(--blue); }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.prefix input { padding-left: 32px !important; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.choices.stack { flex-direction: column; }
.choice {
  display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--field);
  padding: 11px 14px; border-radius: var(--radius); font-weight: 500; border: 2px solid transparent;
}
.choice:has(input:checked) { border-color: var(--blue); background: #e3f2fb; }
.choice input { accent-color: var(--blue); width: 17px; height: 17px; margin: 0; }
.choice.plain { background: none; padding: 4px 0; border: 0; font-weight: 400; align-items: flex-start; }
.choice.plain:has(input:checked) { background: none; }
.field.invalid input[type=text], .field.invalid input[type=email], .field.invalid input[type=tel],
.field.invalid input[type=number], .field.invalid input[type=date], .field.invalid select,
.field.invalid textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; }
.group-title { font-weight: 600; margin-bottom: 8px; }
.note { background: #f1f2f5; border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: #3b3e45; }

/* repeat cards */
.item { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.item-head strong { font-size: 15px; }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 500; cursor: pointer; padding: 4px 0; }
.link.danger { color: var(--danger); }

/* file input */
.filebox { border: 2px dashed #c3c6cd; border-radius: var(--radius); padding: 14px 16px; background: #fafafb; }
.filebox input { display: none; }
.filebox .pick { display: inline-block; cursor: pointer; color: var(--blue); font-weight: 500; }
.filelist { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.filelist li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }

/* signature */
.sig { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.sig-tabs { display: flex; border-bottom: 1px solid var(--line); }
.sig-tabs button { flex: 1; border: 0; background: #f4f5f7; padding: 10px; font: inherit; font-weight: 500; cursor: pointer; }
.sig-tabs button[aria-selected=true] { background: #fff; color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.sig-pane { padding: 12px; }
.sig canvas { display: block; width: 100%; height: 150px; border-bottom: 1px dashed #b5b8c0; touch-action: none; background: #fff; }
.sig-type input { margin-bottom: 10px; }
.sig-fonts { display: grid; gap: 8px; }
.sig-fonts button {
  border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 14px; cursor: pointer;
  font-size: 30px; text-align: left; min-height: 56px; overflow: hidden; white-space: nowrap;
}
.sig-fonts button[aria-pressed=true] { border-color: var(--blue); background: #eef7fc; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* review */
.review-sec { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 12px; margin-bottom: 14px; }
.review-sec-head { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 4px; }
.review-sec-head strong { font-size: 15px; }
.review-row { display: grid; grid-template-columns: 40% 60%; gap: 8px; padding: 6px 0; border-top: 1px solid #eef0f3; font-size: 14px; }
.review-row dt { color: var(--muted); }
.review-row dd { margin: 0; overflow-wrap: anywhere; }
.review-row img { height: 40px; }

/* actions */
.actions { display: flex; gap: 12px; margin-top: 28px; }
.btn { font: inherit; font-weight: 600; font-size: 17px; border: 0; border-radius: 999px; padding: 16px 22px; cursor: pointer; }
.btn-primary { flex: 1; background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-secondary { background: var(--field); color: var(--ink); }
.btn-secondary[hidden] { display: none; }
.form-error { margin-top: 18px; padding: 12px 16px; border-radius: var(--radius); background: #fdecea; color: var(--danger); font-weight: 500; }
[hidden] { display: none !important; }
