:root {
  --navy: #0b2545;
  --brand: #0f5fa8;
  --brand-dark: #0a4682;
  --ink: #162033;
  --muted: #5b6b82;
  --line: #d5dbe6;
  --bg: #f3f6fb;
  --ok: #146c43;
  --err: #b42318;
  --focus: rgba(15, 95, 168, .22);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* header band */
.topbar { background: var(--navy); color: #fff; padding: 1.1rem 1rem 5.5rem; }
.topbar .inner { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: .9rem; }
.topbar img { width: 48px; height: 48px; padding: 4px; border-radius: 10px; background: #fff; object-fit: contain; }
.company { font-size: 1.15rem; font-weight: 700; letter-spacing: .2px; }
.chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
}

/* card */
.card {
  max-width: 780px; margin: -4rem auto 1.5rem; padding: 2rem 2.25rem; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(11, 37, 69, .12);
}
h1 { margin: 0 0 .35rem; font-size: 1.65rem; color: var(--navy); letter-spacing: -.01em; }
.sub { margin: 0 0 1.75rem; color: var(--muted); font-size: .95rem; }
.req { color: var(--err); font-weight: 700; }

/* sections */
fieldset { margin: 0 0 1.75rem; padding: 0; border: 0; min-width: 0; }
legend {
  display: flex; align-items: center; gap: .65rem; width: 100%; margin: 0 0 1.1rem; padding: 0 0 .65rem;
  border-bottom: 1px solid var(--line); font-size: 1.05rem; font-weight: 700; color: var(--navy);
}
.num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1.1rem; }

/* fields */
label { display: block; margin-bottom: 1.05rem; font-size: .86rem; font-weight: 600; color: var(--ink); }
input, textarea, select {
  display: block; width: 100%; margin-top: .35rem; padding: .7rem .8rem; min-height: 44px;
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #b4bfd1; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder, textarea::placeholder { color: #9aa6b8; }
[aria-invalid="true"] { border-color: var(--err); }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); }
.hint { display: block; margin-top: .3rem; font-size: .76rem; font-weight: 400; color: var(--muted); }
.error { display: block; margin-top: .3rem; font-size: .8rem; font-weight: 500; color: var(--err); }
.error:empty { display: none; }

/* button */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%;
  padding: .95rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-size: 1rem; font-weight: 600;
  transition: background .15s, transform .05s;
}
button:hover { background: var(--brand-dark); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: .65; cursor: wait; }
button.secondary { width: auto; padding: .7rem 1.4rem; background: #fff; color: var(--brand); border: 1px solid var(--brand); }
button.secondary:hover { background: #eef4fb; }

.turnstile { display: flex; justify-content: center; margin: 0 0 1rem; }
#status { min-height: 1.4em; margin: .9rem 0 0; font-size: .9rem; text-align: center; }
#status.ok { color: var(--ok); }
#status.err { color: var(--err); }
.assure { margin: .4rem 0 0; font-size: .78rem; text-align: center; color: var(--muted); }

/* success view */
.done { text-align: center; padding: 1.5rem 0; }
.tick {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1rem; border-radius: 50%;
  background: #e6f4ec; color: var(--ok);
}
.done .sub { margin-bottom: 1rem; }
.ref { margin: 0 0 1.5rem; color: var(--muted); font-size: .9rem; }
.ref strong { color: var(--ink); letter-spacing: .05em; }

.footer { text-align: center; margin: 0 0 2rem; font-size: .8rem; color: var(--muted); }

@media (max-width: 560px) {
  .card { margin-left: .75rem; margin-right: .75rem; padding: 1.4rem 1.1rem; }
  .chip { display: none; }
  h1 { font-size: 1.4rem; }
}
