/* ============================================================
   全台借貸媒合網 — 前台樣式
   設計方向：深藍 + 米白 + 琥珀點綴，走專業金融感。
   刻意避開同業常見的金黃插畫風與吉祥物，改以幾何線條與留白建立信任感。
   ============================================================ */

:root {
  --navy-900: #0b2239;
  --navy-800: #0f2c4c;
  --navy-700: #163a61;
  --navy-600: #1f4b78;
  --amber: #d4a24c;
  --amber-light: #e8c583;
  --amber-dark: #b8863a;
  --cream: #faf8f4;
  --white: #ffffff;
  --ink: #16202b;
  --muted: #5a6b7c;
  --muted-light: #8a99a8;
  --border: #e2e6eb;
  --border-strong: #cbd3dc;
  --success: #1f7a5c;
  --danger: #c0392b;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(11, 34, 57, 0.06);
  --shadow: 0 4px 16px rgba(11, 34, 57, 0.08);
  --shadow-lg: 0 12px 40px rgba(11, 34, 57, 0.12);

  --max-width: 1140px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC',
    'Noto Sans TC', 'Microsoft JhengHei', 'Helvetica Neue', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--amber-dark); }

img { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section--cream { background: var(--cream); }
.section--white { background: var(--white); }

.section-head {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 44px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

/* 小標籤：取代同業常見的插畫裝飾 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin-bottom: 12px;
}

/* ===================== 頁首 ===================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy-800);
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--navy-800); }

/* 幾何標誌：三條遞增的線，象徵額度級距 */
.logo__mark {
  display: grid;
  gap: 3px;
  width: 26px;
}

.logo__mark span {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--navy-700);
}

.logo__mark span:nth-child(1) { width: 60%; }
.logo__mark span:nth-child(2) { width: 100%; background: var(--amber); }
.logo__mark span:nth-child(3) { width: 80%; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a:hover { color: var(--navy-800); }

/* ===================== 按鈕 ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover:not(:disabled) {
  background: var(--navy-700);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn--accent {
  background: var(--amber);
  color: var(--navy-900);
}

.btn--accent:hover:not(:disabled) {
  background: var(--amber-light);
  color: var(--navy-900);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--navy-800);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--navy-600);
  color: var(--navy-800);
}

.btn--sm { padding: 9px 16px; font-size: 0.9rem; }
.btn--block { width: 100%; }

/* ===================== 首屏 ===================== */

.hero {
  position: relative;
  background: var(--navy-800);
  color: var(--white);
  padding: 64px 0 80px;
  overflow: hidden;
}

/* 幾何背景：斜向網格線，取代插畫 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      115deg,
      transparent 0 46%,
      rgba(255, 255, 255, 0.035) 46% 47%,
      transparent 47%
    ),
    linear-gradient(
      115deg,
      transparent 0 68%,
      rgba(212, 162, 76, 0.14) 68% 69%,
      transparent 69%
    );
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 56px;
  align-items: start;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber-light);
}

.hero__lead {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 30em;
  margin-bottom: 28px;
}

.hero .eyebrow { color: var(--amber-light); }

.hero__points {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  gap: 12px;
}

.hero__points li {
  position: relative;
  padding-left: 26px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.97rem;
}

.hero__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 2px;
  background: var(--amber);
}

.hero__stats {
  display: flex;
  gap: 36px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero__stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--amber-light);
  line-height: 1.2;
}

.hero__stat span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.66);
}

/* ===================== 表單卡片 ===================== */

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: var(--ink);
}

.form-card__head {
  padding: 22px 28px 0;
}

.form-card__head h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.form-card__head p {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0;
}

/* 進度條 */
.steps {
  display: flex;
  gap: 6px;
  padding: 18px 28px 0;
}

.steps__item {
  flex: 1;
  font-size: 0.76rem;
  color: var(--muted-light);
  font-weight: 600;
}

.steps__bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-bottom: 7px;
  transition: background-color 0.25s ease;
}

.steps__item.is-active { color: var(--navy-800); }
.steps__item.is-active .steps__bar { background: var(--amber); }
.steps__item.is-done .steps__bar { background: var(--navy-600); }
.steps__item.is-done { color: var(--muted); }

.form-body { padding: 22px 28px 28px; }

.form-step { display: none; }
.form-step.is-active { display: block; animation: fade-in 0.25s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 6px;
}

.field label .req { color: var(--danger); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.97rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(31, 75, 120, 0.12);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}

.field__error {
  display: none;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 5px;
}

.field.has-error .field__error { display: block; }

.field__hint {
  font-size: 0.79rem;
  color: var(--muted-light);
  margin-top: 5px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* 選項卡片：比原生 radio 好按，手機尤其明顯 */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
  display: block;
}

/* 視覺上隱藏但保留無障礙性：不能用 width/height:0 或 display:none，
   那會讓鍵盤操作與螢幕閱讀器失效。 */
.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.choice span {
  display: block;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.choice input:checked + span {
  border-color: var(--navy-700);
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(31, 75, 120, 0.18);
}

.choice:hover span { border-color: var(--navy-600); }
.choice input:checked + span:hover { border-color: var(--navy-700); }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.form-actions .btn { flex: 1; }

/* Honeypot：對真人完全不可見，機器人卻會填 */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-note {
  font-size: 0.78rem;
  color: var(--muted-light);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.6;
}

.form-alert {
  display: none;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.form-alert.is-visible { display: block; }
.form-alert--error { background: #fdecea; color: var(--danger); }
.form-alert--info { background: #eef4fa; color: var(--navy-700); }

/* 送出成功 */
.form-success { text-align: center; padding: 12px 0 4px; }

.form-success__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(31, 122, 92, 0.1);
  display: grid;
  place-items: center;
  color: var(--success);
  font-size: 1.6rem;
}

.track-code {
  display: inline-block;
  padding: 12px 22px;
  margin: 6px 0 14px;
  background: var(--cream);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--navy-800);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ===================== 流程 / 特色 ===================== */

.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  counter-reset: flow;
}

.flow__item {
  position: relative;
  padding-top: 18px;
  counter-increment: flow;
}

.flow__item::before {
  content: counter(flow, decimal-leading-zero);
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--amber-dark);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.flow__item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 3px;
  background: var(--amber);
  border-radius: 2px;
}

.flow__item h3 { margin-bottom: 6px; }
.flow__item p { color: var(--muted); font-size: 0.94rem; margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { color: var(--navy-800); margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.93rem; margin: 0; }

.card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(15, 44, 76, 0.06);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.card__icon svg { width: 20px; height: 20px; stroke: var(--navy-700); }

/* 額度級距表 */
.range-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.range-table th,
.range-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

.range-table th {
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.range-table tr:last-child td { border-bottom: none; }
.range-table td:first-child { font-weight: 600; color: var(--navy-800); }
.range-table tbody tr:hover { background: var(--cream); }

.table-scroll { overflow-x: auto; }

/* ===================== FAQ ===================== */

.faq { max-width: 780px; margin: 0 auto; }

.faq__item {
  border-bottom: 1px solid var(--border);
}

.faq__item summary {
  padding: 18px 34px 18px 0;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq__item[open] summary::after { transform: translateY(-20%) rotate(-135deg); }

.faq__item p {
  color: var(--muted);
  font-size: 0.94rem;
  padding-bottom: 18px;
  margin: 0;
}

/* ===================== 法遵揭露 ===================== */

.legal {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  padding: 52px 0;
  font-size: 0.87rem;
}

.legal h2 {
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.legal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.legal h3 {
  color: var(--amber-light);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.legal p { margin: 0 0 8px; line-height: 1.7; }

.legal strong { color: var(--white); }

/* ===================== 頁尾 ===================== */

.site-footer {
  background: var(--navy-800);
  color: rgba(255, 255, 255, 0.6);
  padding: 40px 0 28px;
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: rgba(255, 255, 255, 0.78); }
.site-footer a:hover { color: var(--amber-light); }

.site-footer__links { display: flex; gap: 20px; flex-wrap: wrap; }

.site-footer__bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ===================== 查詢頁 ===================== */

.track-page {
  min-height: 62vh;
  display: grid;
  place-items: center;
  padding: 56px 20px;
}

.track-box {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 30px;
}

.track-result {
  display: none;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.track-result.is-visible { display: block; }

.track-result dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 0;
  font-size: 0.92rem;
}

.track-result dt { color: var(--muted); }
.track-result dd { margin: 0; font-weight: 600; color: var(--navy-800); }

.status-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill--pending { background: #fff4e0; color: #96660d; }
.status-pill--processing { background: #e6f0fa; color: var(--navy-700); }
.status-pill--done { background: #e4f5ee; color: var(--success); }
.status-pill--invalid { background: #f1f3f5; color: var(--muted); }

/* ===================== 響應式 ===================== */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .flow { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 56px 0; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.btn) { display: none; }
  .hero { padding: 44px 0 56px; }
  .hero__stats { gap: 22px; flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; }
  .form-card__head, .steps, .form-body { padding-left: 20px; padding-right: 20px; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
}

/* 尊重使用者的減少動態偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
