:root {
  --bg: #f3efe7;
  --bg-accent: #e7dfd2;
  --surface: #fffcf8;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e6dfd4;
  --accent: #b42318;
  --accent-dark: #8f1d14;
  --accent-soft: #fde8e6;
  --focus: #1c1917;
  --error: #b42318;
  --shadow: 0 24px 60px rgba(68, 48, 28, 0.08);
  --radius: 18px;
  --font: "Source Sans 3", "Source Sans Pro", sans-serif;
  --display: "Source Sans 3", "Source Sans Pro", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fff 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-accent), var(--bg) 28%);
}

.blank-page {
  background: #fff;
}

.page {
  width: min(760px, calc(100% - 32px));
  margin: 40px auto 64px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 32px 28px;
}

.card-header h1,
.success h1 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f6f1ea;
  border: 1px solid var(--line);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.flag {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex: none;
  display: block;
}

.lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

.steps {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 22px 0 0;
  padding: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.step-index {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.step.is-current {
  color: var(--ink);
}

.step.is-current .step-index,
.step.is-done .step-index {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.step-panel {
  margin-top: 28px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

legend {
  font-weight: 700;
  margin-bottom: 12px;
}

.type-grid,
.category-grid,
.grid {
  display: grid;
  gap: 12px;
}

.type-grid {
  grid-template-columns: 1fr 1fr;
}

.type-card {
  cursor: pointer;
}

.type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 92px;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.type-card input:focus-visible + .type-card-body,
.lang-btn:focus-visible,
.btn:focus-visible,
.country-option:focus-visible,
input:focus-visible,
select:focus-visible,
.check input:focus-visible + span,
.check-pill input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.type-card input:checked + .type-card-body {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.type-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #a8a29e;
  margin-bottom: 8px;
  position: relative;
}

.type-card input:checked + .type-card-body .type-mark {
  border-color: var(--accent);
}

.type-card input:checked + .type-card-body .type-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.type-name {
  font-weight: 700;
}

.type-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.fields {
  margin-top: 22px;
}

.grid {
  grid-template-columns: 1fr 1fr;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.category-fieldset legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 650;
}

.opt {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}

.req {
  color: var(--accent);
  text-decoration: none;
  margin-left: 3px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 14px;
}

select option:disabled {
  color: #8b919a;
}

input.is-invalid,
select.is-invalid,
.dropzone.is-invalid,
.country-select.is-invalid .country-input {
  border-color: var(--error);
  background: #fff8f7;
}

.country-select {
  position: relative;
}

.country-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  box-shadow: 0 16px 40px rgba(68, 48, 28, 0.12);
}

.country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.country-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.country-option.is-active,
.country-option:hover {
  background: #f6f1ea;
}

.country-option.is-selected {
  font-weight: 700;
  color: var(--accent);
}

.country-empty {
  margin: 8px 4px 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-error,
.form-error {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 0.84rem;
  font-weight: 600;
}

.form-error {
  margin-top: 16px;
  font-size: 0.92rem;
}

.captcha-block {
  margin-top: 20px;
}

.captcha-label {
  margin: 0 0 10px;
  font-weight: 700;
}

#turnstile {
  min-height: 65px;
}

.fields-legal {
  margin-top: 8px;
}

.legal-line {
  margin: 18px 0 0;
}

.legal-line a,
.check a {
  color: var(--accent);
  font-weight: 700;
}

.checks {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.check,
.check-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.check input,
.check-pill input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.privacy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.privacy-row a {
  color: var(--accent);
  font-weight: 700;
}

.category-fieldset {
  margin-bottom: 18px;
}

.category-grid {
  grid-template-columns: repeat(3, 1fr);
}

.check-pill {
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.check-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  min-height: 120px;
  padding: 20px;
  border: 1.5px dashed #cfc6ba;
  border-radius: 16px;
  background: #faf7f2;
  cursor: pointer;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  margin: 0;
  font-weight: 700;
}

.dropzone-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f1ea;
}

.file-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.file-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.file-remove {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.actions-split {
  justify-content: space-between;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.success-lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.summary {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 8px 16px;
  margin: 22px 0 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary dt {
  color: var(--muted);
  font-weight: 650;
}

.summary dd {
  margin: 0;
  font-weight: 650;
}

.legal-page {
  width: min(800px, calc(100% - 32px));
}

.legal-header {
  margin-bottom: 8px;
}

.legal-header h1 {
  margin: 6px 0 18px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
}

.legal-card h2 {
  margin: 28px 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.legal-card p,
.legal-card li {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.legal-card p {
  margin: 0 0 14px;
}

.legal-card ul {
  margin: 0 0 14px;
  padding-left: 1.2rem;
}

.legal-card li + li {
  margin-top: 8px;
}

.legal-card a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 680px) {
  .page {
    width: min(100% - 20px, 760px);
    margin-top: 16px;
  }

  .card {
    padding: 22px 16px 18px;
    border-radius: 22px;
  }

  .type-grid,
  .grid,
  .category-grid,
  .summary {
    grid-template-columns: 1fr;
  }

  .actions,
  .actions-split {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .btn {
    width: 100%;
  }
}
