/* ==========================================================================
   The Arena 2026 — student feedback form
   Same design language as the submission portal: warm paper, Arena red,
   Archivo for display, Mulish for body.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --paper-warm: #fbf8f5;
  --surface: #fffdf9;
  --surface-sunk: #f4ece6;
  --ink: #231b1b;
  --ink-soft: #463c3c;
  --muted: #7a6e6c;
  --rule: #e6ded8;
  --rule-strong: #d3c8c0;
  --red: #b00101;
  --red-deep: #8c0101;
  --red-bright: #cf1b1b;
  --rose: #f0d6d2;
  --green: #1f6f43;
  --green-soft: #e3f0e8;
  --amber: #8a5a00;
  --amber-soft: #f7edd8;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(35, 27, 27, 0.05), 0 12px 32px -18px rgba(35, 27, 27, 0.25);
  --shadow-lift: 0 2px 4px rgba(35, 27, 27, 0.06), 0 24px 48px -24px rgba(35, 27, 27, 0.35);
  --font-display: "Archivo", "PingFang TC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", sans-serif;
  --font-body: "Mulish", "PingFang TC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(0.22, 0.72, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -240px, #fdf3f1 0%, rgba(253, 243, 241, 0) 70%),
    var(--paper-warm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }

:focus-visible {
  outline: 3px solid rgba(176, 1, 1, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.skip-link:focus { left: 16px; }

/* ---------- header ---------- */

.site-header {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  max-width: 1000px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-text span {
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.header-note {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}
.header-note span { color: #ffd7d1; font-size: 9px; vertical-align: 1px; margin-right: 4px; }

/* ---------- hero ---------- */

.page { max-width: 780px; padding-bottom: 72px; }

.hero { padding: 44px 0 26px; }

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-lead {
  margin: 0;
  max-width: 58ch;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.hero-meta li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 100px;
  box-shadow: 0 1px 1px rgba(35, 27, 27, 0.03);
}
.hero-meta strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink);
}
.hero-meta span { font-size: 13px; color: var(--muted); }

/* ---------- notices ---------- */

.notice {
  margin: 0 0 22px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--paper);
}
.notice h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 16px; }
.notice p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.notice-warn { border-color: #e8d5ae; background: var(--amber-soft); }
.notice-warn h2 { color: var(--amber); }

/* ---------- card ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-card { padding: 8px 26px 26px; }

.form-status {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #e8b4ae;
  background: #fdf1ef;
  color: #7d1a12;
  font-size: 14.5px;
  font-weight: 600;
}

/* ---------- questions ---------- */

.questions { display: block; }

.question {
  margin: 0;
  padding: 30px 0 26px;
  border: 0;
  border-top: 1px solid var(--rule);
  min-width: 0;
}
.question:first-of-type { border-top: 0; padding-top: 26px; }

.q-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0;
  margin: 0 0 4px;
}

.q-number {
  flex: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
  padding-top: 4px;
  min-width: 22px;
}

.q-text {
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.01em;
  float: none;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
  background: var(--rose);
  color: var(--red-deep);
  white-space: nowrap;
}
.tag-soft { background: var(--surface-sunk); color: var(--muted); }

.q-hint {
  margin: 0 0 16px;
  padding-left: 34px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.q-body { padding-left: 0; }

/* ---------- scale (1–5) ---------- */

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scale-item { position: relative; min-width: 0; }

.scale-item input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.scale-item label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 74px;
  padding: 10px 4px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}

.scale-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.scale-caption {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.scale-item label:hover { border-color: var(--rose); background: #fffaf9; }

.scale-item input:checked + label {
  border-color: var(--red);
  background: linear-gradient(180deg, #fff6f4 0%, #fdeeea 100%);
  box-shadow: inset 0 0 0 1px var(--red);
}
.scale-item input:checked + label .scale-value { color: var(--red); }
.scale-item input:checked + label .scale-caption { color: var(--red-deep); }

.scale-item input:focus-visible + label {
  outline: 3px solid rgba(176, 1, 1, 0.35);
  outline-offset: 2px;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- nps (0–10) ---------- */

.nps {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 5px;
}

.nps-item { position: relative; }
.nps-item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.nps-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.nps-item label:hover { border-color: var(--rose); background: #fffaf9; }
.nps-item input:checked + label {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(176, 1, 1, 0.9);
}
.nps-item input:focus-visible + label { outline: 3px solid rgba(176, 1, 1, 0.35); outline-offset: 2px; }

/* ---------- choice lists ---------- */

.choices {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.choices.single { grid-template-columns: 1fr; }

.choice { position: relative; min-width: 0; }

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}

.choice-box {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.choices.single .choice-box { border-radius: 50%; }

.choice-box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px) scale(0.4);
  opacity: 0;
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
.choices.single .choice-box::after {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: scale(0.4);
}

.choice label:hover { border-color: var(--rose); background: #fffaf9; }

.choice input:checked + label {
  border-color: var(--red);
  background: #fff6f4;
  color: var(--ink);
  font-weight: 600;
}
.choice input:checked + label .choice-box { background: var(--red); border-color: var(--red); }
.choice input:checked + label .choice-box::after { opacity: 1; transform: rotate(-45deg) translateY(-1px) scale(1); }
.choices.single .choice input:checked + label .choice-box::after { transform: scale(1); }

.choice input:focus-visible + label { outline: 3px solid rgba(176, 1, 1, 0.35); outline-offset: 2px; }
.choice input:disabled + label { opacity: 0.45; cursor: not-allowed; background: var(--surface-sunk); }

.choice-count {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.choice-count[data-full="true"] { color: var(--red-deep); font-weight: 600; }

/* ---------- text fields ---------- */

.field { display: block; }

.field textarea,
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field textarea { min-height: 104px; resize: vertical; }

.field textarea::placeholder,
.field input::placeholder { color: #a79a97; }

.field textarea:focus,
.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176, 1, 1, 0.12);
}

.field-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.counter[data-over="true"] { color: var(--red); font-weight: 700; }

/* ---------- validation ---------- */

.field-error {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #a1160c;
}

.question.is-invalid .field-error { display: block; }

.question.is-invalid .scale-item label,
.question.is-invalid .choice label,
.question.is-invalid .nps-item label,
.question.is-invalid textarea,
.question.is-invalid input[type="text"],
.question.is-invalid input[type="email"] {
  border-color: #d98b83;
}

.question.is-invalid .q-number { color: #a1160c; }

.profile-fields.is-invalid input { border-color: #d98b83; }

/* ---------- profile block ---------- */

.profile-block {
  margin: 4px 0 0;
  padding: 26px 0 6px;
  border-top: 1px solid var(--rule);
}

.profile-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}
.profile-head p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-field { min-width: 0; }
.profile-field:last-child { grid-column: 1 / -1; }

.profile-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.profile-field .field-error { margin-top: 6px; }
.profile-field.is-invalid .field-error { display: block; }

/* ---------- submit ---------- */

.submit-block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.submit-note {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 60ch;
}

.button-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 26px;
  border: 1px solid var(--red-deep);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 20px -14px rgba(140, 1, 1, 0.9);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}

.button-primary:hover { filter: brightness(1.06); box-shadow: 0 14px 26px -14px rgba(140, 1, 1, 0.9); }
.button-primary:active { transform: translateY(1px); }
.button-primary[disabled] { cursor: progress; filter: saturate(0.7) brightness(0.96); }

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.button-primary.is-busy .button-spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.submit-progress {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1em;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 22px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.button-secondary:hover { border-color: var(--red); background: #fffaf9; color: var(--red-deep); }

/* ---------- thanks ---------- */

.thanks-card {
  padding: 44px 30px 34px;
  text-align: center;
  animation: rise 0.4s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.thanks-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.thanks-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.thanks-body {
  margin: 0 auto 24px;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 16px;
}

.thanks-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 34px;
  margin: 0 0 8px;
  padding: 18px 0 0;
  border-top: 1px solid var(--rule);
}
.thanks-meta div { display: flex; flex-direction: column; gap: 2px; }
.thanks-meta dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.thanks-meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.thanks-count {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.thanks-actions { margin-top: 26px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 22px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 1000px;
}
.site-footer p { margin: 0; font-size: 12.5px; color: var(--muted); }
.footer-fine { color: #9c8f8c; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .header-inner { min-height: 60px; }
  .brand-logo { height: 24px; }
  .brand-divider { display: none; }
  .header-note { display: none; }
  .hero { padding: 30px 0 20px; }
  .hero-lead { font-size: 16px; }
  .hero-meta li { padding: 6px 11px; }
  .form-card { padding: 4px 18px 22px; }
  .q-text { font-size: 17px; }
  .q-hint { padding-left: 0; }
  .scale { gap: 6px; }
  .scale-item label { min-height: 62px; padding: 8px 2px; }
  .scale-value { font-size: 17px; }
  .scale-caption { font-size: 0; }
  .scale-caption::after { content: attr(data-short); font-size: 10.5px; }
  .nps { gap: 4px; }
  .nps-item label { height: 38px; font-size: 13.5px; }
  .choices { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .thanks-card { padding: 34px 20px 26px; }
  .thanks-card h2 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .hero-meta, .skip-link { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
