:root {
  --ink: #1d1f24;
  --muted: #5d6270;
  --accent: #2f4a8a;
  --accent-soft: #e9eef8;
  --bg: #f6f5f2;
  --card: #fff;
  --line: #d9d8d3;
  --error: #b3261e;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.who { color: var(--muted); font-size: 0.95rem; }
.langs { display: flex; gap: 4px; }
.langs button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 6px 10px; border-radius: 999px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

h1 { font-size: 1.6rem; margin: 28px 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 16px; color: var(--accent); }
h3 { font-size: 1rem; margin: 20px 0 10px; }
.intro { margin: 0 0 6px; }
.note { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 20px;
}

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; font-weight: 600; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
input, select {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink);
  padding: 10px 12px; border: 1px solid #b9b8b2; border-radius: 8px; background: #fff; width: 100%; min-width: 0;
  min-height: 44px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #9db3e6; outline-offset: 1px; border-color: var(--accent);
}

.choice { border: 0; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.choice legend { font-weight: 600; font-size: 0.92rem; padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.choice label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 16px; border: 1px solid #b9b8b2; border-radius: 999px; min-height: 44px;
}
.choice label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.choice input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }

.address { margin-top: 8px; padding-top: 4px; border-top: 1px dashed var(--line); }

.legal { font-size: 0.85rem; color: #3d4049; margin-top: 22px; }
@media (min-width: 601px) {
  .legal p, .consent .consent-text { text-align: justify; hyphens: auto; }
}
.legal p { margin: 0 0 10px; }
.sign-label { font-weight: 600; margin: 18px 0 8px; }

.consent { padding-left: 1.3em; margin: 0; }
.consent li { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid #eeede9; }
.consent .consent-text { margin: 0; }
.consent .choice { margin-top: 10px; }

.sigpad { position: relative; }
.sigpad canvas {
  display: block; width: 100%; height: 170px; touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M3 25 L5 18 L19 4 L24 9 L10 23 Z' fill='%232f4a8a' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M3 25 L5 18 L10 23 Z' fill='%231d1f24'/%3E%3C/svg%3E") 3 25, crosshair;
  border: 1.5px dashed #9a9993; border-radius: 8px; background: #fcfcfa;
}
.sig-hint {
  position: absolute; left: 0; right: 0; top: 70px; text-align: center; pointer-events: none;
  color: #a3a29c; font-size: 0.95rem;
}
.sigpad.has-sig .sig-hint { display: none; }
.sig-clear { margin-top: 6px; }

.invalid input, .invalid select, .sigpad.invalid canvas { border-color: var(--error); border-style: solid; }
.choice.invalid label { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.85rem; font-weight: 600; margin: 4px 0 0; width: 100%; }
.error-summary {
  color: var(--error); font-weight: 600; background: #fbeceb; border: 1px solid #f0c4c1;
  padding: 10px 14px; border-radius: 8px;
}

button, .button { font: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.primary, .secondary {
  display: inline-block; border-radius: 999px; padding: 12px 24px; font-weight: 600; min-height: 48px;
  border: 1px solid var(--accent);
}
.primary { background: var(--accent); color: #fff; }
.primary:disabled { opacity: 0.6; cursor: progress; }
.secondary { background: #fff; color: var(--accent); }
form > .primary { width: 100%; margin: 0 0 40px; font-size: 1.05rem; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 4px 0; font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

.review-list { margin: 16px 0 0; font-size: 0.95rem; }
.review-list dt { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
.review-list dd { margin: 0; font-weight: 600; }
.email { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
main > section.card { margin-top: 24px; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; float: none !important; }

[hidden] { display: none !important; }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .span-2 { grid-column: 1 / -1; }
  .card { padding: 16px; }
  h1 { font-size: 1.35rem; }
  .actions > * { flex: 1 1 100%; }
  .who { font-size: 0.85rem; }
}
