:root {
  --navy: #1a4a7c;
  --navy-dark: #143a61;
  --gray: #7e8481;
  --ink: #1c2530;
  --muted: #5d6873;
  --line: #dfe4ea;
  --bg: #eef1f5;
  --card: #ffffff;
  --error: #c0392b;
  --ok: #1e7a45;
  --radius: 10px;

  /* Fluid type scale. Each step is rem + vw rather than vw alone, so the page
     still responds to the browser's own font-size setting and to zoom. */
  --fs-xs:   clamp(0.75rem,   0.723rem + 0.13vw, 0.8125rem);  /* 12 -> 13 */
  --fs-sm:   clamp(0.8125rem, 0.773rem + 0.20vw, 0.9375rem);  /* 13 -> 15 */
  --fs-base: clamp(1rem,      0.981rem + 0.10vw, 1.0625rem);  /* 16 -> 17 */
  --fs-md:   clamp(1.0625rem, 1.019rem + 0.21vw, 1.1875rem);  /* 17 -> 19 */
  --fs-lg:   clamp(1.25rem,   1.144rem + 0.53vw, 1.5rem);     /* 20 -> 24 */
  --fs-h1:   clamp(1.375rem,  1.135rem + 1.20vw, 2.125rem);   /* 22 -> 34 */

  /* Fluid spacing, same idea. */
  --pad-card: clamp(1.25rem, 0.98rem + 1.36vw, 2.5rem);       /* 20 -> 40 */
  --pad-wrap: clamp(1rem,    0.89rem + 0.54vw, 1.5rem);       /* 16 -> 24 */
  --gap:      clamp(0.75rem, 0.64rem + 0.54vw, 1.25rem);      /* 12 -> 20 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(1.25rem, 0.9rem + 1.7vw, 2.5rem) var(--pad-wrap) clamp(2.5rem, 2rem + 2.5vw, 4rem);
}
/* The admin console is a table, so it earns real width on a big screen.
   The form does not — past ~45em a line of text gets harder to read, not easier. */
.wrap--wide { max-width: min(1560px, 94vw); }

.logo {
  display: block;
  width: 100%;
  max-width: clamp(13.75rem, 11rem + 13.7vw, 21.25rem);  /* 220 -> 340 */
  height: auto;
  margin: 0 auto clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: 0 1px 3px rgba(20, 40, 70, .06);
}

h1 { font-size: var(--fs-h1); line-height: 1.2; margin: 0 0 8px; color: var(--navy); }
.lede { margin: 0 0 clamp(1.25rem, 1rem + 1.2vw, 1.75rem); color: var(--muted); font-size: var(--fs-base); }

.field { margin-bottom: var(--gap); }
.row { display: flex; gap: var(--gap); }
.row .field { flex: 1 1 0; min-width: 0; }

label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.req { color: var(--error); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], select {
  width: 100%;
  padding: clamp(0.7rem, 0.63rem + 0.34vw, 0.9rem) clamp(0.8rem, 0.73rem + 0.34vw, 1rem);
  font: inherit;
  /* Never below 16px: anything smaller makes iOS Safari zoom on focus. */
  font-size: max(1rem, var(--fs-base));
  color: var(--ink);
  background: #fff;
  border: 1px solid #c2cad4;
  border-radius: 8px;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path fill='%235d6873' d='M1 1l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(26, 74, 124, .35);
  outline-offset: 1px;
  border-color: var(--navy);
}

input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); }

.error { display: none; color: var(--error); font-size: var(--fs-sm); margin-top: 6px; }
.error.show { display: block; }

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

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 8px;
}
.consent input { margin: 3px 0 0; width: 22px; height: 22px; flex: none; accent-color: var(--navy); }
.consent label { font-weight: 400; font-size: var(--fs-sm); margin: 0; line-height: 1.55; }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: clamp(0.75rem, 0.68rem + 0.34vw, 0.95rem) clamp(1.1rem, 1rem + 0.5vw, 1.5rem);
}
.btn-primary { background: var(--navy); color: #fff; width: 100%; font-size: var(--fs-md); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-secondary { background: #fff; color: var(--navy); border-color: #c2cad4; padding: 10px 16px; font-size: var(--fs-sm); }
.btn-secondary:hover { background: #f4f7fa; }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 6px; font-size: var(--fs-sm); }

.notice {
  margin-top: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  padding-top: clamp(1rem, 0.85rem + 0.7vw, 1.375rem);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  line-height: 1.65;
  color: var(--muted);
}
.notice h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 8px; }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }

.banner { padding: 14px 16px; border-radius: 8px; margin-bottom: 20px; font-size: var(--fs-sm); }
.banner--error { background: #fdecea; color: #8c2a1e; border: 1px solid #f3c3bd; }
.banner--ok { background: #e8f5ee; color: #165c34; border: 1px solid #bfe3ce; }

.center { text-align: center; }
.success-mark {
  width: clamp(3.25rem, 2.9rem + 1.7vw, 4.5rem);
  height: clamp(3.25rem, 2.9rem + 1.7vw, 4.5rem);
  border-radius: 50%;
  background: var(--ok); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-h1); margin: 0 auto 18px;
}

.foot { text-align: center; margin-top: 22px; font-size: var(--fs-xs); color: var(--muted); }
.foot a { color: var(--muted); }

/* ---- admin ---- */
.admin-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-top h1 { margin: 0; font-size: var(--fs-lg); }
.admin-logo { height: 38px; width: auto; display: block; margin-bottom: 8px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls input, .controls select { width: auto; min-width: 190px; padding: 9px 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: var(--fs-lg); color: var(--navy); line-height: 1.2; }
.stat span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f6f8fa; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fbfc; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eaf0f7; color: var(--navy); font-size: var(--fs-xs); font-weight: 600; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.del { color: var(--error); background: none; border: none; cursor: pointer; font-size: var(--fs-sm); padding: 4px 6px; }
.signed-in { font-size: var(--fs-xs); color: var(--muted); }

/* ---- career fairs ---- */
.fairs { margin-bottom: 20px; }
.fairs-head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.section-title { margin: 0; font-size: var(--fs-lg); color: var(--navy); }
.fair-tz { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.fair-help { margin: 6px 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.fair-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 14px; align-items: end; }
.fair-form .field { margin-bottom: 0; }
.fair-form-actions { display: flex; gap: 8px; align-items: center; }
.fair-form-actions .btn-secondary { white-space: nowrap; }
.fair-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.fair-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fair-item:last-child { border-bottom: none; }
.fair-item b { color: var(--ink); }
.fair-meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.fair-actions { display: flex; gap: 4px; flex: none; }
.muted { color: var(--muted); }

.login { max-width: 420px; margin: clamp(4vh, 6vh, 8vh) auto 0; }

/* ---- phones ---- */
@media (max-width: 560px) {
  .row { flex-direction: column; gap: 0; }
  /* Full-width controls are easier to hit than a wrapped row of small ones. */
  .controls { width: 100%; }
  .controls input, .controls select, .controls button { width: 100%; min-width: 0; }
  .admin-top { gap: 10px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ---- very small phones (iPhone SE and similar) ---- */
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .consent { gap: 10px; }
}

/* ---- touch devices: meet the 44px minimum hit target ---- */
@media (pointer: coarse) {
  button, .btn-link { min-height: 44px; }
  .del { min-height: 44px; min-width: 44px; }
  .consent input { width: 24px; height: 24px; }
}

/* ---- large desktop: let the form breathe a little more ---- */
@media (min-width: 1280px) {
  .wrap { max-width: 720px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
