:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --bg-top: #f8fafc;
  --bg-bottom: #eef2ff;
  --card: #ffffff;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --success-bg: #ecfdf5;
  --success-ink: #065f46;
  --error-bg: #fef2f2;
  --error-ink: #991b1b;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 2rem;
}

/* ---------- Header ---------- */

.site-header {
  margin-bottom: 1.75rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0 0 2.25rem;
}

.brand-sub {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

/* ---------- Card / form ---------- */

.card {
  background: var(--card);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 16px;
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
}

.row {
  display: grid;
  gap: 0;
}

.field + .field,
.field + .row,
.row + .field,
.row + .row {
  margin-top: 1.15rem;
}

.row .field {
  margin-top: 0;
}

@media (min-width: 560px) {
  .row-2,
  .row-3 {
    gap: 1.15rem;

    /* cancel the extra top-margin between paired fields */
    margin-top: 1.15rem;
  }

  .row-2 {
    grid-template-columns: 1fr 1fr;
  }

  .row-3 {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.req {
  color: #dc2626;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.hint.center {
  text-align: center;
  margin: 0.85rem 0 0;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  resize: vertical;
  min-height: 9rem;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.4rem;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

button[type="submit"] {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: background-color 120ms ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-dark);
}

button[type="submit"]:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* ---------- Status messages ---------- */

#form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 9px;
  font-size: 0.95rem;
}

#form-status.success {
  display: block;
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid #a7f3d0;
}

#form-status.error {
  display: block;
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid #fecaca;
}

/* ---------- Honeypot ---------- */

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

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}

/* ---------- Feature checklist ---------- */

fieldset.field {
  border: 0;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

legend {
  padding: 0;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

legend .optional {
  display: block;
}

.checks {
  display: grid;
  gap: 0.45rem;
}

@media (min-width: 560px) {
  .checks {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 400;
  font-size: 0.95rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.check:hover {
  border-color: #94a3b8;
}

.check input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.18rem;
}

.check:has(input:checked) {
  border-color: var(--accent);
  background: #eef2ff;
}
