:root {
  --canvas: #060817;
  --surface: rgba(15, 18, 42, 0.96);
  --surface-2: #171a39;
  --text: #f7f8ff;
  --muted: #aeb4cf;
  --border: rgba(207, 215, 255, 0.18);
  --primary: #d93cff;
  --primary-2: #33c6ff;
  --accent: #c7f42b;
  --danger: #ff718c;
  --focus: #75dbff;
  --radius-lg: 24px;
  --radius-md: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 6% 8%, rgba(217, 60, 255, 0.19), transparent 27rem),
    radial-gradient(circle at 92% 76%, rgba(51, 198, 255, 0.16), transparent 30rem),
    var(--canvas);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.6;
}

button, input, select, textarea { font: inherit; }

.shell {
  display: grid;
  grid-template-columns: clamp(320px, 38vw, 570px) minmax(0, 1fr);
  min-height: 100svh;
}

.visual {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #08091a;
}

.visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 67%, var(--canvas));
}

.form-wrap {
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 56px clamp(24px, 5vw, 72px) 80px;
}

main { width: min(100%, 760px); min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(199, 244, 43, 0.5);
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 650px;
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 1.02rem;
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.event-item { min-width: 0; padding: 15px 17px; }
.event-item + .event-item { border-left: 1px solid var(--border); }
.event-item small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; }
.event-item strong { display: block; font-size: 0.92rem; overflow-wrap: anywhere; }

.location-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(117, 219, 255, 0.6);
  text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.location-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.location-link:focus-visible { outline: 3px solid rgba(117, 219, 255, 0.32); outline-offset: 3px; border-radius: 3px; }

form {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section { min-width: 0; padding: 30px; border: 0; margin: 0; }
.section + .section, .conditional + .section { border-top: 1px solid var(--border); }
.conditional .section:first-child { border-top: 1px solid var(--border); }

legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 20px;
  font-size: 1.12rem;
  font-weight: 800;
}

legend + * { clear: both; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }

label, .question-label { color: #eef0ff; font-size: 0.9rem; font-weight: 700; }
.question-label { margin: 0 0 10px; }
.required { color: var(--danger); }
.optional { color: var(--muted); font-size: 0.78rem; font-weight: 500; }

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-2);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder, textarea::placeholder { color: #777f9f; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(117, 219, 255, 0.18); }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-grid.transport { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; min-width: 0; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.choice label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.choice label::before {
  content: "";
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border: 2px solid #69708d;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--surface);
}

.choice input:checked + label { border-color: var(--primary-2); color: var(--text); background: rgba(51, 198, 255, 0.1); }
.choice input:checked + label::before { border-color: var(--primary-2); background: var(--primary-2); }
.choice input:focus-visible + label { outline: 3px solid rgba(117, 219, 255, 0.32); outline-offset: 2px; }
.conditional[hidden] { display: none; }
.helper { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }

.check-row { display: flex; align-items: flex-start; gap: 11px; }
.check-row input { flex: 0 0 auto; width: 19px; height: 19px; margin: 3px 0 0; accent-color: var(--primary-2); }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 30px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.025); }
.actions p { margin: 0; max-width: 360px; color: var(--muted); font-size: 0.78rem; }
.primary-button, .secondary-button { min-height: 50px; padding: 12px 22px; border: 0; border-radius: 12px; font-weight: 850; cursor: pointer; }
.primary-button { color: #080918; background: linear-gradient(100deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 28px rgba(51, 198, 255, 0.18); }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { cursor: wait; filter: saturate(0.3); opacity: 0.75; }
.primary-button:focus-visible, .secondary-button:focus-visible, .icon-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.form-status { min-height: 0; margin: 0; padding: 0 30px; color: var(--danger); font-size: 0.86rem; font-weight: 700; }
.form-status:not(:empty) { min-height: 48px; padding-top: 12px; padding-bottom: 12px; border-top: 1px solid var(--border); }

dialog { width: min(calc(100% - 32px), 600px); padding: 0; border: 1px solid var(--border); border-radius: 22px; color: var(--text); background: #10132c; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2, 3, 12, 0.78); backdrop-filter: blur(7px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 26px 16px; }
.success-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px; border-radius: 50%; color: #091014; background: var(--accent); font-weight: 900; }
.dialog-head h2 { margin: 0; font-size: 1.45rem; }
.dialog-head p { margin: 6px 0 0; color: var(--muted); }
.icon-button { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--text); background: rgba(255, 255, 255, 0.07); cursor: pointer; font-size: 1.25rem; }
.summary { margin: 0 26px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; white-space: pre-wrap; color: #e9ebf7; background: rgba(0, 0, 0, 0.2); font: 0.9rem/1.65 inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 26px 26px; }
.secondary-button { color: var(--text); background: rgba(255, 255, 255, 0.08); }

@media (max-width: 1180px) {
  .shell { display: block; }
  .visual {
    position: relative;
    display: grid;
    place-items: center;
    height: min(100svh, 210.76vw);
    min-height: 0;
    max-height: 980px;
    isolation: isolate;
  }
  .visual::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -28px;
    background:
      linear-gradient(rgba(6, 8, 23, 0.58), rgba(6, 8, 23, 0.82)),
      url("assets/event-poster.png") center / cover no-repeat;
    filter: blur(20px);
    transform: scale(1.06);
  }
  .visual img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }
  .visual::after {
    z-index: 2;
    background: none;
  }
  .form-wrap { position: relative; z-index: 1; margin-top: 0; padding-top: 0; }
  legend { margin-bottom: 26px; }
}

@media (max-width: 760px) {
  .visual { max-height: none; }
  .form-wrap { padding: 0 16px 48px; }
  h1 { font-size: 2.3rem; }
  .lede { margin-bottom: 22px; }
  .event-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .event-item { padding: 12px; }
  .event-item strong { font-size: 0.82rem; }
  .section { padding: 28px 24px 30px; }
  legend { margin-bottom: 30px; }
  .grid-2, .choice-grid.transport { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; padding: 20px; }
  .actions p { max-width: none; }
  .primary-button { width: 100%; }
  .form-status { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 480px) {
  .event-strip, .choice-grid { grid-template-columns: 1fr; }
  .event-item + .event-item { border-left: 0; border-top: 1px solid var(--border); }
  .dialog-actions { flex-direction: column; }
  .dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
