:root {
  --orange: #fd8204;
  --orange-dark: #e87300;
  --orange-soft: #fff4e8;
  --ink: #1a1a1a;
  --muted: #8c8c8c;
  --line: #ebebeb;
  --bg: #ffffff;
  --field: #f7f7f7;
  --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; border: none; background: transparent; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ico {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.btn-ico .ico { color: #fff; }

.ico {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.ico-xs { width: 0.9rem; height: 0.9rem; }
.ico-sm { width: 1.05rem; height: 1.05rem; }
.ico-field { width: 1.15rem; height: 1.15rem; color: #b0b0b0; }
.ico-tip { width: 1rem; height: 1rem; color: #fff; }

.feat-ico {
  color: var(--orange);
  display: inline-flex;
  align-items: center;
}

/* ===== Landing ===== */
.page-landing { background: #fff; }
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.landing-brand {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 6vh;
}
.landing-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
}
.brand-logo {
  display: block;
  width: 50%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
}
.brand-slogan {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: #666;
  letter-spacing: 0.08em;
}
.landing-actions {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 2rem;
}
.landing-actions .btn-primary {
  height: 52px;
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(253, 130, 4, 0.25);
}
.landing-features {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: 0.35rem 0.25rem 0.5rem;
  font-size: 0.82rem;
  color: #555;
}
.feat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.feat-ico { color: var(--orange); }
.feat-divider {
  width: 1px;
  height: 14px;
  background: #ddd;
}

/* ===== Register ===== */
.page-register { background: #fff; }
.reg-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 1.15rem 2rem;
  display: flex;
  flex-direction: column;
}
.reg-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  height: 48px;
}
.nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  color: #333;
}
.nav-back .ico { width: 1.5rem; height: 1.5rem; }
.nav-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}
.reg-head { margin: 0.75rem 0 1rem; }
.reg-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
}
.reg-head p {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 0.9rem;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.tip-banner .tip-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.tip-banner .tip-icon-svg {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
}
.tip-ok .tip-icon-svg .ico { color: #07c160; }
.tip-warn .tip-icon-svg .ico { color: #faad14; }
.tip-err .tip-icon-svg .ico { color: #ff4d4f; }
.tip-ok { background: #e8f8ef; color: #067d3f; border: 1px solid #b7ebc6; }
.tip-ok .tip-icon { background: transparent; }
.tip-warn { background: #fff7e8; color: #9a6700; border: 1px solid #ffe1a6; }
.tip-warn .tip-icon { background: transparent; }
.tip-err { background: #ffece8; color: #d4380d; border: 1px solid #ffccc7; }
.tip-err .tip-icon { background: transparent; }

.field-label {
  display: block;
  margin: 0.85rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
}
.field-box {
  display: flex;
  align-items: center;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 0.35rem 0 0.85rem;
  min-height: 48px;
  position: relative;
}
.field-box:focus-within {
  border-color: rgba(253, 130, 4, 0.45);
  background: #fff;
}
.field-box input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 48px;
  color: var(--ink);
  position: relative;
  z-index: 0;
  background: transparent;
}
.field-box input::placeholder { color: #b0b0b0; }
.field-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  margin-right: 0.45rem;
  flex: 0 0 auto;
  pointer-events: none;
  position: relative;
  z-index: 0;
}
.eye-btn {
  color: #aaa;
  cursor: pointer;
  padding: 0.55rem 0.65rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}
.eye-btn .ico {
  color: #aaa;
  pointer-events: none;
}

.phone-box { padding-left: 0.35rem; }
.region-select-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 4.75rem;
  height: 36px;
  margin-right: 0.15rem;
  z-index: 5;
}
.region-select {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 3;
  cursor: pointer;
  font-size: 16px; /* avoid iOS input zoom */
  -webkit-appearance: menulist-button;
  appearance: auto;
  border: none;
  background: transparent;
}
.region-select-face {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 0.55rem;
  border-right: 1px solid #e2e2e2;
  color: var(--ink);
  font-weight: 600;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.region-select-face .chev {
  color: #999;
  margin-left: 0.15rem;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-right: 0.5rem;
}
.captcha-box input {
  flex: 1 1 auto;
  min-width: 0;
}
.captcha-img-btn {
  flex: 0 0 auto;
  border: 1px solid #dce5e1;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  line-height: 0;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.captcha-img-btn img {
  display: block;
  border-radius: 7px;
}

.reg-submit {
  margin-top: 1.5rem;
  height: 50px;
  font-size: 1.05rem;
  border-radius: 12px;
}
.reg-secure {
  margin-top: auto;
  padding-top: 1.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.reg-secure .ico { color: var(--orange); }

/* success page */
.page-success {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(165deg, #fff9f3 0%, #ffffff 45%, #f6faf8 100%);
}
.success-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.success-card {
  width: min(360px, 100%);
  text-align: center;
  animation: success-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.success-badge {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, #f0fff6 0%, #e3f9ec 55%, #d4f5e3 100%);
  box-shadow:
    0 0 0 10px rgba(7, 193, 96, 0.08),
    0 14px 32px rgba(7, 193, 96, 0.18);
  animation: success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s both;
}
.success-badge .ico {
  width: 2.5rem;
  height: 2.5rem;
  color: #07c160;
  stroke-width: 2.5;
}
.success-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2937;
  line-height: 1.45;
}
@keyframes success-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes success-pop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* cancelled page */
.page-cancelled {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(165deg, #fafafa 0%, #ffffff 45%, #f6f7f8 100%);
}
.cancelled-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.cancelled-card {
  width: min(360px, 100%);
  text-align: center;
  animation: success-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cancelled-badge {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, #fff8f6 0%, #fdeee9 55%, #f9e4de 100%);
  box-shadow:
    0 0 0 10px rgba(239, 68, 68, 0.06),
    0 14px 32px rgba(239, 68, 68, 0.12);
  animation: success-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s both;
}
.cancelled-badge .ico {
  width: 2.5rem;
  height: 2.5rem;
  color: #ef4444;
  stroke-width: 2.5;
}
.cancelled-title {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2937;
  line-height: 1.45;
}
.cancelled-sub {
  margin: 0;
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.55;
}

/* waiting / legacy result */
.result-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #fff;
}
.ico-lg { width: 1.6rem; height: 1.6rem; }
.fail-svg {
  background: #ffece8;
  color: #ee0a24;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.fail-svg .ico { color: #ee0a24; width: 1.75rem; height: 1.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.review-loading {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  padding: 1.5rem;
}
.review-loading-card {
  text-align: center;
  max-width: 280px;
}
.review-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #ffe4c4;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
.review-loading-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.review-loading-sub {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
