:root {
  --blue: #189ad6;
  --blue-dark: #0b6fa4;
  --blue-darker: #095a86;
  --green: #94c83d;
  --green-dark: #5e8f1b;
  --ink: #1d2b36;
  --muted: #5b6b78;
  --line: #d5dee6;
  --bg: #f3f7fa;
  --card: #ffffff;
  --error: #c62828;
  --radius: 14px;
  --focus: 0 0 0 3px rgba(24, 154, 214, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--blue-dark); }
.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { width: 150px; height: auto; display: block; }
.topbar-tag {
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue-dark); background: #e8f4fb; padding: 6px 12px; border-radius: 999px;
}

/* Hero */
.hero {
  background: linear-gradient(120deg, var(--blue-dark) 0%, var(--blue) 55%, #4fb0a0 80%, var(--green) 100%);
  color: #fff;
  padding: 28px 0 64px;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; font-weight: 750; }
.hero p { margin: 0; font-size: 16px; opacity: .95; max-width: 34ch; }
.hero-icon {
  width: 84px; height: 84px; flex: 0 0 auto; border-radius: 22px; background: #fff;
  padding: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

/* Card */
main.wrap { margin-top: -40px; padding-bottom: 32px; }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,40,60,.06), 0 8px 24px rgba(16,40,60,.08);
  padding: 8px 20px 24px;
}

fieldset { border: 0; margin: 0; padding: 18px 0 6px; border-bottom: 1px solid #edf1f4; }
fieldset:last-of-type { border-bottom: 0; }
legend {
  display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px;
  font-size: 17px; font-weight: 700; color: var(--ink);
}
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 700;
}

.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }

label, .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.req { color: var(--error); }
.opt { font-weight: 400; color: var(--muted); font-size: 14px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6b78' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 22px;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--error); }

.error { color: var(--error); font-size: 14px; margin: 6px 0 0; min-height: 0; }
.error:empty { display: none; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.counter { color: var(--muted); font-size: 13px; text-align: right; margin: 4px 0 0; }

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* File upload */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  border: 2px dashed #9cc9e3; border-radius: 12px; background: #f2f9fd;
  padding: 16px; color: var(--blue-dark); font-weight: 400; margin: 0;
  transition: background .15s, border-color .15s;
}
.dropzone strong { font-size: 16px; }
.dropzone small { color: var(--muted); font-size: 13px; }
.dropzone:hover, .file-input:focus + .dropzone { background: #e5f3fb; border-color: var(--blue); }
.file-input:focus-visible + .dropzone { box-shadow: var(--focus); }
.dropzone.drag { background: #dff0fa; border-color: var(--blue); }
.invalid .dropzone { border-color: var(--error); }
.file-chip {
  display: flex; align-items: center; gap: 12px; border: 1.5px solid #cfe6c0; background: #f4faee;
  border-radius: 12px; padding: 12px 14px; color: var(--green-dark);
}
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.file-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.file-meta small { color: var(--muted); }
.link-btn {
  font: inherit; font-size: 14px; color: var(--error); background: none; border: 0; padding: 8px; cursor: pointer;
  border-radius: 8px;
}
.link-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* Checkboxes */
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--blue-dark); }
.check label { font-weight: 400; font-size: 15px; margin: 0; }
.invalid.check label { color: var(--error); }

.privacy { margin: 6px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
.privacy summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 15px; color: var(--blue-dark); }
.privacy summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
.privacy div { padding: 0 14px 6px; font-size: 14px; color: var(--muted); }
.privacy p { margin: 0 0 10px; }

/* Submit */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; margin-top: 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--blue-dark); color: #fff; font: inherit; font-size: 17px; font-weight: 700;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--blue-darker); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .spinner {
  width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-secondary { background: #fff; color: var(--blue-dark); border: 1.5px solid var(--blue-dark); }
.btn-secondary:hover { background: #eef7fc; }
.fineprint { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.form-status { margin-top: 16px; font-size: 15px; }
.form-status:empty { display: none; }
.form-status.err { color: var(--error); background: #fdecec; border-radius: 10px; padding: 12px 14px; }
.progress { height: 8px; background: #e6eef4; border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .2s; }

/* Success */
.success { text-align: center; padding: 32px 22px; }
.success:focus { outline: none; }
.success-icon {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; background: #eef7e3; color: var(--green-dark);
}
.success h2 { margin: 0 0 8px; font-size: 24px; }
.success p { color: var(--muted); margin: 0 0 16px; }
.ref-box {
  display: inline-flex; flex-direction: column; gap: 2px; padding: 12px 22px; margin: 4px 0 16px;
  border-radius: 12px; background: #f2f9fd; border: 1px solid #cfe6f3;
}
.ref-box small { color: var(--muted); }
.ref-box strong { font-size: 20px; letter-spacing: .06em; color: var(--blue-dark); font-variant-numeric: tabular-nums; }

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

@media (min-width: 560px) {
  .hero { padding: 40px 0 72px; }
  .hero h1 { font-size: 32px; }
  .hero-icon { width: 104px; height: 104px; }
  .card { padding: 12px 32px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
