/* ══════════════════════════════════════════════
   PUBLIC INQUIRY FORM
   Load order: variables.css → theme.css → style.css
   Layout: one column, built for a phone held at a booth.
   ══════════════════════════════════════════════ */

.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-sm) var(--space-md);
  padding-top: max(var(--space-sm), env(safe-area-inset-top));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px -18px rgba(7, 21, 40, 0.35);
  overflow: hidden;
}

/* ---------- Header ---------- */
.head {
  position: relative;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  background: var(--navy);
}
.logo-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.logo { display: block; height: 34px; width: auto; }
.head h1 {
  margin: 0;
  max-width: 14em;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  color: #FFFFFF;
}
.head p { margin: 0; font-size: 0.9rem; color: var(--head-text); max-width: 36em; }
.pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tag-ink);
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
/* The one memorable detail: a maple-leaf watermark (momiji) from Hiroshima. */
.momiji {
  position: absolute;
  right: 14px;
  top: 6px;
  font-size: 4.2rem;
  line-height: 1;
  font-weight: 700;
  color: #FFFFFF;
  opacity: 0.10;
  pointer-events: none;
  user-select: none;
}

/* ---------- Form ---------- */
form { padding: 8px 24px 28px; display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0;
  margin-bottom: 2px;
}
.req { color: var(--danger); }
.hint { font-weight: 400; color: var(--faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;            /* 16px+ stops iOS zooming into the field */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input[type="tel"] { font-family: var(--font-mono); letter-spacing: 0.01em; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
[hidden] { display: none !important; }

/* Phone: flag + code picker and the number in ONE row (intl-tel-input).
   The library's own stylesheet is loaded first; these rules only re-colour it
   with the brand variables. The scoped selectors keep the dropdown (which the
   library moves to <body>) untouched by the form layout. */
:root {
  --iti-border-color: var(--line);
  --iti-country-selector-bg: var(--surface);
  --iti-hover-color: color-mix(in srgb, var(--gold) 16%, transparent);
  --iti-icon-color: var(--faint);
}
#phoneField .iti { display: block; width: 100%; }
#phoneField .iti input[type="tel"] { width: 100%; }
#phoneField .iti__selected-country-primary { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.iti__selected-dial-code { font-family: var(--font-mono); font-size: 1rem; color: var(--ink); }
.iti__country-selector { font-family: var(--font-body); font-size: 0.95rem; color: var(--ink); border-radius: var(--radius-md); overflow: hidden; }
.iti__search-input { font: inherit; color: var(--ink); background: transparent; outline: none; }
.iti__search-input::placeholder { color: var(--faint); }
.iti__country { padding-top: 10px; padding-bottom: 10px; }
.iti__country-list .iti__dial-code { color: var(--faint); }
/* Flags: the library's rounded corners + shadow stop the big flag sprite from painting on
   high-density phone screens (blank grey box). Square corners + a thin outline avoid that. */
.iti__flag { border-radius: 0; box-shadow: none; outline: 1px solid rgba(0, 0, 0, 0.18); outline-offset: -1px; }

/* Segmented Student / Professional control */
.seg { position: relative; display: flex; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--bg); }
.seg input, .chip input, .consent input.sr { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.seg label + input + label { border-left: 1px solid var(--line); }
.seg input:checked + label { background: var(--navy); color: var(--on-navy); font-weight: 700; }
.seg input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: -3px; }

/* Interest chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip label {
  display: block;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.chip input:checked + label {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--tag-ink);
  font-weight: 700;
}
.chip input:checked + label::before { content: "✓ "; color: var(--gold-deep); }
.chip input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Consent */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--navy); }
.consent label { cursor: pointer; }

/* Honeypot — off-screen, not display:none (some bots skip those) */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn-primary, .btn-secondary {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
.btn-primary { color: var(--on-navy); background: var(--navy); border: 0; border-radius: var(--radius-lg); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.65; cursor: progress; }
.btn-secondary { color: var(--navy-ink); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.btn-secondary:hover { border-color: var(--gold); }

/* Error banner */
.alert {
  background: var(--danger-tint);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Confirmation ---------- */
.confirm { padding: var(--space-md) 24px 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.confirm .check {
  width: 56px; height: 56px; margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--navy-ink);
  animation: pop 0.35s ease-out;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm h2 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; }
.confirm p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.confirm .ref { font-family: var(--font-mono); font-size: 0.82rem; color: var(--faint); }

.summary {
  margin: 4px 0 6px;
  padding: 6px 16px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}
.summary div { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--faint); }
.summary dd { margin: 0; overflow-wrap: anywhere; }

.foot { text-align: center; font-size: 0.78rem; color: var(--faint); margin: 16px 0 0; }