:root {
  color-scheme: light;
  --ink: #17252a;
  --muted: #5c6b70;
  --line: #d8e0e2;
  --soft: #f4f7f7;
  --surface: #ffffff;
  --brand: #0d6258;
  --brand-dark: #084a43;
  --accent: #d9a441;
  --error: #a4262c;
  --success: #17633a;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(13, 98, 88, 0.1), transparent 28rem),
    #f7f9f9;
}

button, input { font: inherit; }

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(180px, 1fr);
  align-items: start;
  gap: 40px;
  margin-bottom: 38px;
}

.page-header__copy { min-width: 0; }
.brand-logo {
  width: min(100%, 240px);
  height: auto;
  margin-top: 8px;
  justify-self: end;
  mix-blend-mode: multiply;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.03; letter-spacing: -0.045em; }
.intro { margin: 20px 0 0; color: var(--muted); font-size: 1.1rem; line-height: 1.65; }

form { display: grid; gap: 22px; }
.form-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(23, 37, 42, 0.09);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(23, 37, 42, 0.06);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.section-heading > div:first-child { display: flex; align-items: center; gap: 14px; }
.section-heading h2 { margin: 0; font-size: 1.42rem; letter-spacing: -0.02em; }
.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 0.86rem;
  font-weight: 800;
}

.party-type {
  display: flex;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--soft);
}

.party-type legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.party-type label { cursor: pointer; }
.party-type input { position: absolute; opacity: 0; pointer-events: none; }
.party-type span {
  display: block;
  padding: 10px 17px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.party-type input:checked + span { color: var(--ink); background: #fff; box-shadow: 0 2px 9px rgba(23, 37, 42, 0.12); }
.party-type input:focus-visible + span { outline: 3px solid rgba(13, 98, 88, 0.24); outline-offset: 2px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px 20px; }
.contents { display: contents; }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field--postal { grid-column: span 1; }
.field--locality { grid-column: span 2; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 750;
}

.field label span, .submit-row p span { color: var(--error); }
.field label .field-optional {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #bfcacc;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:hover { border-color: #8fa0a4; }
.field input:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 4px rgba(13, 98, 88, 0.12); }
.field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(164, 38, 44, 0.09); }
.field-error { min-height: 1.15em; margin: 6px 0 0; color: var(--error); font-size: 0.82rem; }

.document-card { border-color: rgba(13, 98, 88, 0.2); }
.section-heading--simple { margin-bottom: 22px; }
.file-field { position: relative; }
.file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-field > label {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100px;
  padding: 18px;
  border: 1.5px dashed #9aacaf;
  border-radius: 12px;
  background: var(--soft);
  cursor: pointer;
}

.file-field > label:hover, .file-field input:focus-visible + label { border-color: var(--brand); background: #eef6f4; }
.file-field input:focus-visible + label { outline: 3px solid rgba(13, 98, 88, 0.2); outline-offset: 2px; }
.file-icon {
  display: grid;
  width: 50px;
  height: 58px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.file-field strong, .file-field small { display: block; }
.file-field small { margin-top: 4px; color: var(--muted); }
.file-action { margin-left: auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 750; }
.file-name { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }
.file-pages {
  display: inline-flex;
  align-items: center;
  margin: 10px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #e8f3f1;
  font-size: 0.86rem;
  font-weight: 750;
}

.form-status { padding: 17px 20px; border-radius: 12px; font-weight: 650; line-height: 1.5; }
.form-status[data-kind="success"] { border: 1px solid #acd2bb; color: var(--success); background: #eef9f2; }
.form-status[data-kind="error"] { border: 1px solid #e3b3b6; color: var(--error); background: #fff2f2; }

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 5px; }
.submit-row p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.submit-row button {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(13, 98, 88, 0.2);
}

.submit-row button:hover { background: var(--brand-dark); }
.submit-row button:focus-visible { outline: 3px solid rgba(13, 98, 88, 0.26); outline-offset: 3px; }
.submit-row button:disabled { cursor: wait; opacity: 0.68; }
.button-arrow { font-size: 1.35rem; }

.confirmation-modal {
  width: min(100% - 32px, 520px);
  max-height: min(88vh, 780px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(23, 37, 42, 0.24);
}

.confirmation-modal::backdrop { background: rgba(23, 37, 42, 0.56); }
.confirmation-modal form { display: block; max-height: min(88vh, 780px); overflow-y: auto; padding: clamp(24px, 5vw, 36px); }
.confirmation-modal__eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.confirmation-modal h2 { margin: 0; font-size: 1.55rem; letter-spacing: -0.025em; }
.confirmation-modal p:not(.confirmation-modal__eyebrow) { color: var(--muted); line-height: 1.55; }
.confirmation-modal__document {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--brand-dark) !important;
  background: #e8f3f1;
  font-size: 0.9rem;
  font-weight: 750;
}
.confirmation-summary { display: grid; gap: 16px; margin-top: 22px; }
.confirmation-summary section { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.confirmation-summary h3 { margin: 0 0 11px; color: var(--brand-dark); font-size: 0.98rem; }
.confirmation-summary dl { display: grid; grid-template-columns: minmax(116px, 0.7fr) minmax(0, 1.3fr); gap: 7px 12px; margin: 0; font-size: 0.88rem; line-height: 1.35; }
.confirmation-summary dt { color: var(--muted); font-weight: 700; }
.confirmation-summary dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.confirmation-modal__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.confirmation-modal button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
}
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.button-secondary:hover { background: var(--soft); }
.button-primary { border: 1px solid var(--brand); color: #fff; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.confirmation-modal button:focus-visible { outline: 3px solid rgba(13, 98, 88, 0.26); outline-offset: 3px; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 22px, 1080px); padding: 36px 0 52px; }
  .page-header { grid-template-columns: 1fr; gap: 24px; }
  .page-header__copy { grid-row: 2; }
  .brand-logo { grid-row: 1; width: min(52vw, 190px); margin-top: 0; justify-self: start; }
  .section-heading { flex-direction: column; }
  .party-type { width: 100%; }
  .party-type label { flex: 1; text-align: center; }
  .field-grid { grid-template-columns: 1fr; }
  .field--postal, .field--locality { grid-column: 1; }
  .file-field > label { align-items: flex-start; flex-wrap: wrap; }
  .file-action { width: 100%; margin-left: 66px; text-align: center; }
  .submit-row { align-items: stretch; flex-direction: column-reverse; }
  .submit-row button { justify-content: space-between; }
  .confirmation-modal__actions { flex-direction: column-reverse; }
  .confirmation-modal button { width: 100%; }
  .confirmation-summary dl { grid-template-columns: 1fr; gap: 2px; }
  .confirmation-summary dt { margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.pdf-viewer { margin-top: 20px; }
.pdf-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; }
.pdf-page { max-height: 75vh; overflow: auto; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.pdf-page canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.pdf-page--zoomed canvas { max-width: none; }
.pdf-zoom { margin-bottom: 12px; }
.pdf-page details { padding: 12px; overflow-wrap: anywhere; }
.pdf-review-check { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
.pdf-review-check input { flex: 0 0 auto; margin-top: 5px; width: 18px; height: 18px; }
.secondary-button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); cursor: pointer; }
.secondary-button:disabled { opacity: 0.55; cursor: default; }
.form-status[data-kind="warning"] { border: 1px solid #dab55b; background: #fff8e7; color: #644a10; }
#billing-cif { text-transform: uppercase; }
