:root {
  --primary: #123b7a;
  --primary-dark: #0b2a5b;
  --accent: #d4a72c;
  --bg: #f2f5fa;
  --card: #ffffff;
  --border: #d9e0ec;
  --text: #1c2430;
  --muted: #66738a;
  --error: #c62828;
  --error-bg: #fdecea;
  --success: #1e7d3f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #1d55a8 100%);
  color: #fff;
  padding: 48px 24px 56px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 36px); }
.hero p { margin: 0 auto; max-width: 560px; opacity: 0.85; }

/* ---------- layout ---------- */
.container {
  max-width: 1200px;
  margin: -28px auto 40px;
  padding: 0 24px;
}
@media (max-width: 680px) {
  .container { padding: 0 16px; }
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 35, 75, 0.06);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  margin: 0 0 18px;
  color: var(--primary-dark);
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
@media (max-width: 680px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
}

/* ---------- fields ---------- */
.field { margin-bottom: 14px; }
.grid-2 .field, .grid-3 .field { margin-bottom: 0; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
label em { color: var(--error); font-style: normal; }
.hint { color: var(--muted); font-weight: 400; font-size: 13px; }
.note { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }

input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 59, 122, 0.12);
}
textarea { resize: vertical; min-height: 110px; }

.counter {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.counter.over { color: var(--error); font-weight: 700; }

.phone-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}

.other-wrap { margin-top: 10px; }

/* ---------- pill choices ---------- */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}
.pill span:hover { border-color: var(--primary); }
.pill input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(18, 59, 122, 0.25); }

/* ---------- declarations ---------- */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--bg);
  cursor: pointer;
  font-size: 14px;
}
.check:last-of-type { border-bottom: none; }
.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

/* ---------- flag dropdown ---------- */
.fdd { position: relative; }
.fdd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fdd-btn:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 59, 122, 0.12);
}
.fdd-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fdd-value.placeholder { color: var(--muted); }
.fdd-caret {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  flex-shrink: 0;
}
.fdd-panel {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 35, 75, 0.18);
  overflow: hidden;
}
.fdd.open .fdd-panel { display: block; }
.fdd-search {
  width: 100%;
  padding: 10px 12px;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.fdd-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
}
.fdd-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.fdd-list li:hover { background: var(--bg); }
.fdd-list li.selected { background: rgba(18, 59, 122, 0.08); font-weight: 600; }
.fdd-main { overflow: hidden; text-overflow: ellipsis; }
.fdd-sub { margin-left: auto; color: var(--muted); font-size: 13px; padding-left: 12px; }
.fdd-empty { color: var(--muted); cursor: default !important; }
.fdd-empty:hover { background: none !important; }
.fi { border-radius: 2px; box-shadow: 0 0 1px rgba(0, 0, 0, 0.4); flex-shrink: 0; }

/* ---------- errors / banners ---------- */
.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
}
.banner.error {
  background: var(--error-bg);
  border: 1px solid #f2b8b5;
  color: #8c1d18;
}
.banner.error ul { margin: 8px 0 0; padding-left: 20px; }
.field-error,
.fdd.field-error .fdd-btn {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12) !important;
}
div.field-error { box-shadow: none !important; border-color: transparent !important; outline: 2px solid var(--error); outline-offset: 4px; border-radius: 6px; }
div.fdd.field-error { outline: none; }

/* ---------- submit / success ---------- */
.submit-row { text-align: center; margin: 26px 0 10px; }
.btn-primary {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #1d55a8 100%);
  border: none;
  border-radius: 999px;
  padding: 13px 44px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(18, 59, 122, 0.35);
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(18, 59, 122, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.submit-row .hint { margin-top: 12px; }

.success { text-align: center; padding: 44px 28px; }
.success-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 32px;
  line-height: 62px;
}
.success h2 { justify-content: center; color: var(--success); }
.success .ref { font-size: 15px; }
.success .ref strong { color: var(--primary-dark); word-break: break-all; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0 30px;
}
