/* CERPS 會員系統自訂樣式 - 補強 Tailwind */
:root {
  --cerps-primary: #435495;
  --cerps-primary-dark: #2e3c75;
  --cerps-primary-light: #6c7eb8;
  --cerps-accent: #f59e0b;
  --cerps-accent-dark: #d97706;
  --cerps-ink: #1f2937;
  --cerps-muted: #64748b;
  --cerps-line: #d9e0ec;
  --cerps-bg: #f8fafc;
  --cerps-surface: #ffffff;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--cerps-ink);
  background:
    linear-gradient(180deg, #eef3fb 0%, #f8fafc 260px, #f8fafc 100%);
}

.cerps-gradient-bg {
  background-image: linear-gradient(135deg, #2e3c75 0%, #435495 54%, #6577ad 100%);
}

/* Tailwind CDN custom-color fallback. Keeps text readable if custom config is delayed. */
.bg-cerps-50 { background-color: #f3f5fb; }
.bg-cerps-100 { background-color: #e6ebf6; }
.bg-cerps-600 { background-color: #435495; }
.bg-cerps-700 { background-color: #384878; }
.bg-cerps-800 { background-color: #2e3c75; }
.bg-cerps-900 { background-color: #1f2a52; }
.bg-white { background-color: #fff; }
.bg-amber-500 { background-color: #f59e0b; }
.hover\:bg-amber-600:hover { background-color: #d97706; }
.text-white { color: #fff; }
.text-cerps-600 { color: #435495; }
.text-cerps-700 { color: #384878; }
.text-cerps-800 { color: #2e3c75; }
.border-cerps-600 { border-color: #435495; }
.hover\:bg-cerps-50:hover { background-color: #f3f5fb; }
.hover\:bg-cerps-900:hover { background-color: #1f2a52; }
.shadow-card { box-shadow: 0 10px 30px -18px rgba(31, 42, 82, .35); }

/* Header */
.site-header {
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.site-header__inner {
  min-height: 72px;
}
.site-brand img {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
}
.site-nav a {
  color: rgba(255,255,255,.88);
  border-radius: 8px;
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.13);
}
.site-nav a.is-active {
  color: #fff;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

/* Cards */
.plan-card { border-radius: 8px; transition: transform .2s ease, box-shadow .2s ease; }
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(31, 42, 82, .45); }
.form-card {
  max-width: 100%;
  background: var(--cerps-surface);
  border: 1px solid rgba(217, 224, 236, .95);
  border-radius: 8px;
  box-shadow: 0 18px 45px -34px rgba(31, 42, 82, .5);
}
.form-card + .form-card {
  margin-top: 20px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cerps-primary-dark);
  font-weight: 800;
  letter-spacing: 0;
}
.section-heading::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--cerps-accent);
}
.field-label {
  color: #334155;
  font-weight: 650;
}

/* Loading 動畫 */
.spin {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 表單焦點 */
.cerps-input {
  min-height: 44px;
  border: 1px solid var(--cerps-line);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.cerps-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 84, 149, .18);
  border-color: var(--cerps-primary);
}
.cerps-input::placeholder { color: #94a3b8; }

/* 表格捲動 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 客製按鈕 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--cerps-primary);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 26px -18px rgba(31, 42, 82, .8);
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.btn-primary:hover { background: var(--cerps-primary-dark); }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); }
.btn-white,
.bg-white.text-cerps-700 {
  color: var(--cerps-primary-dark);
}
.btn-payment {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--cerps-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 16px 26px -18px rgba(146, 64, 14, .75);
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.btn-payment:hover { background: var(--cerps-accent-dark); transform: translateY(-1px); }
.btn-payment:disabled { opacity: .78; cursor: wait; transform: none; }

/* 步驟列 */
.step-bar { display:flex; align-items:center; gap:8px; }
.step-bar .step {
  padding: 7px 12px;
  border-radius: 999px;
  background:#e7ebf3;
  color:#64748b;
  font-size: 13px;
  font-weight: 650;
}
.step-bar .step.active {
  background: var(--cerps-primary);
  color:#fff;
  box-shadow: 0 10px 24px -18px rgba(31, 42, 82, .9);
}
.step-bar .step.done { background: #10b981; color:#fff; }

/* Apply page */
.apply-shell {
  max-width: 960px;
  width: 100%;
}
.apply-hero {
  max-width: 100%;
  background: #fff;
  border: 1px solid rgba(217, 224, 236, .95);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 18px 45px -36px rgba(31, 42, 82, .55);
}
.apply-eyebrow {
  color: var(--cerps-accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.plan-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  color: var(--cerps-muted);
}
.plan-pill,
.store-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--cerps-primary-dark);
  font-weight: 750;
  font-size: 12px;
}
.payment-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--cerps-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.payment-option:hover {
  border-color: var(--cerps-primary-light);
  background: #fbfcff;
}
.payment-option:has(input:checked) {
  border-color: var(--cerps-primary);
  box-shadow: 0 0 0 3px rgba(67, 84, 149, .12);
}
.payment-title {
  overflow-wrap: anywhere;
  color: #172033;
  font-weight: 800;
}
.payment-desc {
  overflow-wrap: anywhere;
  color: var(--cerps-muted);
  font-size: 13px;
}
.terms-card {
  background: #fffdf8;
  border: 1px solid #fde7bd;
  border-radius: 8px;
}
.amount-panel {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cerps-primary-dark), var(--cerps-primary));
  color: #fff;
  box-shadow: 0 20px 44px -28px rgba(31, 42, 82, .85);
}
.amount-label { color: rgba(255,255,255,.78); }
.amount-value { color: #fff; letter-spacing: 0; }

/* Footer */
footer { background:#1f2937; color:#cbd5e1; }
footer a { color:#cbd5e1; }
footer a:hover { color:#fff; }

@media (max-width: 640px) {
  .site-header__inner { align-items: flex-start; }
  .site-nav {
    width: 100%;
    overflow-x: visible;
    padding-bottom: 2px;
    flex-wrap: wrap;
  }
  .site-nav a {
    padding: 7px 9px;
    font-size: 13px;
  }
  .apply-hero { padding: 20px; }
  .form-card { padding: 20px !important; }
  .payment-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .store-chip {
    grid-column: 2;
    justify-self: start;
  }
  .step-bar { gap: 6px; }
  .step-bar .step { font-size: 12px; padding: 6px 9px; }
  .amount-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .btn-payment { width: 100%; }
  .plan-card { margin-bottom: 1rem; }
}
