/* ═══════════════════════════════════════════════════════════════════
   慧燈中學 招生 — 報名表單 / 結果頁
   Built on huey-deng-design tokens (static/hd/) — mirrors the
   ui_kits/event/registration screen: deep summary sidebar + accent card.
   ═══════════════════════════════════════════════════════════════════ */

.reg-page {
  background: var(--surface-page);
  min-height: calc(100vh - 76px);
  padding: clamp(32px, 5vw, 56px) 24px clamp(56px, 7vw, 88px);
}

.reg-grid {
  max-width: var(--container-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, .72fr) 1.28fr;
  gap: 28px;
  align-items: start;
}

/* ── 左側深紫摘要卡（mirrors Card variant="deep"） ────────────────── */
.reg-side {
  position: sticky;
  top: 100px;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(178,115,182,.22), transparent 60%),
    var(--surface-brand-deep);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-lg);
}
.reg-side-mark {
  position: absolute;
  right: -70px; bottom: -50px;
  height: 260px;
  opacity: .07;
  pointer-events: none;
}
.reg-side .v3-eyebrow { color: var(--gold-300); }
.reg-side-h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1.32;
  margin: 16px 0 8px;
}
.reg-side-p {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-on-dark);
  opacity: .78;
  line-height: 1.8;
}
.reg-side-rows { margin-top: 30px; display: flex; flex-direction: column; gap: 18px; }
.reg-side-row { display: flex; gap: 14px; align-items: center; }
.reg-side-row .ico { color: var(--gold-300); display: grid; place-items: center; flex: none; }
.reg-side-row .ico svg { width: 20px; height: 20px; }
.reg-side-row .lbl {
  font-family: var(--font-ui);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(244,239,245,.55);
}
.reg-side-row .val {
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}
.reg-side-foot {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.reg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--gold-500);
  color: var(--violet-900);
}
.reg-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.reg-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.reg-download:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); }
.reg-download .ico { color: var(--gold-300); display: grid; place-items: center; }
.reg-download .ico svg { width: 17px; height: 17px; }

/* ── 右側表單卡（Card plain + gold accent） ───────────────────────── */
.reg-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
}
.reg-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-accent);
}
.reg-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 700;
  color: var(--text-strong);
  margin: 14px 0 6px;
}
.reg-sub {
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 34px;
}
.reg-sub .req { color: var(--red-500); }

/* ── 表單分節 ─────────────────────────────────────────────────────── */
.form-section { margin-bottom: 38px; }
.form-section:last-of-type { margin-bottom: 0; }
.form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.form-section-no {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  color: var(--text-brand);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ── 欄位（mirrors components/forms/Field & Select） ──────────────── */
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-body);
}
.form-field label .req { color: var(--red-500); margin-left: 4px; }

.form-field input:not([type="radio"]):not([type="checkbox"]),
.form-field select {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text-strong);
  padding: 12px 14px;
  min-height: 47px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1.5px solid var(--border-default);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23837589' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.form-field input:not([type="radio"]):not([type="checkbox"]):focus,
.form-field select:focus {
  border-color: var(--violet-400);
  box-shadow: var(--ring-focus);
}
.form-field input::placeholder { color: var(--plum-400); }

.radio-group { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.field-hint { margin: 2px 0 0; font-family: var(--font-ui); font-size: 13px; line-height: 1.5; color: var(--plum-600, #6b5570); }
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text-body);
}
.radio-label input[type="radio"] { accent-color: var(--violet-600); width: 18px; height: 18px; }

.phone-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.phone-row select { width: 132px; }

/* ── 個資法告知 ───────────────────────────────────────────────────── */
.pdpa-details {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-card);
}
.pdpa-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-brand);
  background: var(--surface-tint);
}
.pdpa-summary::-webkit-details-marker { display: none; }
.pdpa-summary::after {
  content: "＋";
  font-size: 17px;
  font-weight: 700;
  color: var(--violet-500);
}
.pdpa-details[open] .pdpa-summary { border-bottom: 1px solid var(--border-subtle); }
.pdpa-details[open] .pdpa-summary::after { content: "－"; }

.pdpa-box {
  max-height: 300px;
  overflow-y: auto;
  padding: 18px 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-muted);
}
.pdpa-box .pdpa-lead {
  text-align: center;
  font-weight: 800;
  color: var(--text-strong);
  font-size: 14px;
  margin: 0 0 12px;
}
.pdpa-box h4 {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-strong);
  margin: 16px 0 6px;
  line-height: 1.6;
}
.pdpa-box p { margin: 0 0 8px; }
.pdpa-box strong { color: var(--text-strong); }

.pdpa-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-brand);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.6;
}
.pdpa-consent input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--violet-600);
  cursor: pointer;
}
.pdpa-consent .req { color: var(--red-500); margin-left: 2px; }

/* ── 錯誤與送出 ───────────────────────────────────────────────────── */
.form-error {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  border: 1px solid var(--red-500);
  color: var(--red-500);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.form-error.visible { display: block; }

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-top: 28px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-brand-strong);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: filter var(--dur-fast), transform var(--dur-fast);
}
.submit-btn:hover:not(:disabled) { filter: brightness(1.07); }
.submit-btn:active:not(:disabled) { transform: translateY(1px); }
.submit-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── 結果頁（success / closed） ───────────────────────────────────── */
.result-wrap {
  background: var(--surface-page);
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.result-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(44px, 6vw, 64px) clamp(28px, 5vw, 48px);
}
.result-ico {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  font-size: 34px;
  font-weight: 700;
}
.result-ico.ok  { background: var(--green-50); color: var(--green-500); }
.result-ico.err { background: var(--red-50);   color: var(--red-500); }
.result-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 32px);
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 12px;
}
.result-p {
  font-family: var(--font-ui);
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 32px;
}
.result-p a { color: var(--text-brand); font-weight: 700; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── 響應式 ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .reg-grid { grid-template-columns: 1fr; }
  .reg-side { position: static; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .phone-row { grid-template-columns: 1fr; }
  .phone-row select { width: 100%; }
  .reg-side { padding: 32px 26px; }
}
