/* 拓域資訊 Rootforge — 汽車重複質押查核服務 landing page
   色票／字級／圓角沿用 Linear 風格設計稿（方案 D） */

:root {
  --bg: #010102;
  --surface: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --border: #23252a;
  --border-strong: #34343a;
  --border-error: #3e3e44;
  --text-primary: #f7f8f8;
  --text-secondary: #8a8f98;
  --text-tertiary: #62666d;
  --text-quote: #d0d6e0;
  --accent: #5e6ad2;
  --accent-hover: #828fff;
  --accent-active: #5e69d1;
  --error: #d03238;
  --success: #27a644;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Noto Sans TC', -apple-system, sans-serif;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, p, ul { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  font: 500 14px/1 'Noto Sans TC';
  padding: 11px 16px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid rgba(94, 105, 210, 0.5); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); transform: translateY(1px); }
.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { background: var(--surface-3); }
.btn-outline:active { transform: translateY(1px); }
.btn-lg { font-size: 16px; padding: 18px 28px; min-height: 52px; }
.btn-block { width: 100%; }
.btn[disabled] {
  background: var(--surface-3);
  color: var(--text-tertiary);
  cursor: not-allowed;
}
.btn[disabled]:hover { background: var(--surface-3); }

/* header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon {
  display: flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
}
.brand-name {
  font: 600 16px/1 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* hero */
.hero {
  position: relative;
  min-height: clamp(520px, 64vw, 700px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  filter: saturate(0.75) brightness(0.88) contrast(1.04);
}
.hero-gradient-v {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(1,1,2,0.62) 0%, rgba(1,1,2,0.22) 26%, rgba(1,1,2,0.78) 74%, #010102 100%);
}
.hero-gradient-h {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(1,1,2,0.86) 0%, rgba(1,1,2,0.5) 44%, rgba(1,1,2,0.05) 80%, rgba(1,1,2,0) 100%);
}
.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) clamp(20px, 4vw, 48px) clamp(40px, 5vw, 72px);
}
.hero-content { max-width: min(100%, 40ch); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 16, 17, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 7px 14px;
  margin-bottom: 22px;
  font: 500 12px/1 'Noto Sans TC';
  color: var(--text-quote);
}
.hero h1 {
  font: 600 clamp(36px, 6.8vw, 66px)/1.1 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -2px;
  margin: 0 0 18px;
  text-shadow: 0 2px 24px rgba(1,1,2,0.6);
}
.hero p {
  font: 400 clamp(15px, 1.7vw, 19px)/1.75 'Noto Sans TC';
  color: var(--text-quote);
  margin: 0 0 30px;
  max-width: 38ch;
  text-shadow: 0 1px 12px rgba(1,1,2,0.7);
}
.hero-note {
  font: 400 13px/1.6 'Noto Sans TC';
  color: var(--text-secondary);
  margin-top: 14px;
}

/* services */
.services {
  padding: 56px clamp(20px, 4vw, 48px) clamp(40px, 5vw, 88px);
  max-width: 1180px;
  margin: 0 auto;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.card-media {
  position: relative;
  margin: -24px -24px 38px;
}
.card-media img {
  display: block;
  width: 100%;
  height: clamp(150px, 17vw, 190px);
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  filter: saturate(0.8) brightness(0.85);
}
.card-media-fade {
  position: absolute; inset: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(1,1,2,0.1) 0%, rgba(15,16,17,0.9) 100%);
}
.card-icon {
  position: absolute;
  left: 20px;
  bottom: -20px;
  display: flex;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  align-items: center;
  justify-content: center;
}
.card h2 {
  font: 500 22px/1.3 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin: 0 0 10px;
}
.card-desc {
  font: 400 14px/1.7 'Noto Sans TC';
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.card-quote {
  font: 400 13px/1.8 'Noto Sans TC';
  color: var(--text-quote);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.card-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.card-list li {
  font: 400 13px/1.6 'Noto Sans TC';
  color: var(--text-quote);
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.card-list li svg { flex: 0 0 auto; margin-top: 3px; }
.card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-price { font: 400 12px/1.4 Inter; color: var(--text-tertiary); }

/* steps */
.steps {
  padding: 0 clamp(20px, 4vw, 48px) clamp(40px, 5vw, 88px);
  max-width: 1180px;
  margin: 0 auto;
}
.steps-inner { border-top: 1px solid var(--border); padding-top: clamp(28px, 3.4vw, 48px); }
.steps h2 {
  font: 500 clamp(20px, 2.4vw, 28px)/1.3 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -0.6px;
  margin: 0 0 24px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-icon {
  display: flex;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}
.step-title { font: 500 15px/1.5 'Noto Sans TC'; color: var(--text-primary); margin-bottom: 4px; }
.step-desc { font: 400 13px/1.7 'Noto Sans TC'; color: var(--text-secondary); }

/* cta banner */
.cta-banner-wrap {
  padding: 0 clamp(20px, 4vw, 48px) clamp(40px, 5vw, 80px);
  max-width: 1180px;
  margin: 0 auto;
}
.cta-banner {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.cta-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.7);
}
.cta-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(1,1,2,0.94) 0%, rgba(1,1,2,0.82) 55%, rgba(1,1,2,0.6) 100%);
}
.cta-text { position: relative; }
.cta-text h2 {
  font: 500 clamp(19px, 2.2vw, 26px)/1.3 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.cta-text p { font: 400 14px/1.7 'Noto Sans TC'; color: var(--text-secondary); }
.cta-btn { position: relative; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(28px, 3.4vw, 48px) clamp(20px, 4vw, 48px);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand-name { display: flex; align-items: center; gap: 8px; font: 600 15px/1 'Noto Sans TC'; color: var(--text-primary); margin-bottom: 8px; }
.footer-brand-sub { font: 400 12px/1.6 Inter; color: var(--text-tertiary); letter-spacing: 0.5px; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 12px/1.6 'Noto Sans TC';
  color: var(--text-tertiary);
}

/* modal */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}
.modal-scrim[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  max-height: 92vh;
  overflow-y: auto;
  outline: none;
}
.modal-panel[hidden] { display: none; }
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.step-indicator, .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12px/1 Inter;
  color: var(--text-tertiary);
}
.back-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
}
.back-btn:hover { color: var(--text-primary); }
.back-btn:focus-visible { outline: 2px solid rgba(94, 105, 210, 0.5); outline-offset: 2px; }
.dot { display: inline-block; width: 24px; height: 3px; border-radius: 2px; background: var(--border); }
.dot-active { background: var(--accent); }
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -10px 0 0;
}
.icon-btn:hover { color: var(--text-primary); background: var(--surface-3); }
.icon-btn:focus-visible { outline: 2px solid rgba(94, 105, 210, 0.5); outline-offset: 2px; }

.modal-title {
  font: 600 21px/1.35 'Noto Sans TC';
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.modal-sub { font: 400 13px/1.7 'Noto Sans TC'; color: var(--text-tertiary); margin: 0 0 16px; }
.modal-title.tc, .modal-sub.tc { text-align: center; }
.modal-sub.mb24 { margin-bottom: 24px; }

.option-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.option-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.option-row.is-selected { background: var(--surface-2); border-color: var(--accent); }
.checkbox {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: transparent;
}
.option-row.is-selected .checkbox { background: var(--accent); border-color: var(--accent); color: #fff; }
.option-icon { flex: 0 0 auto; }
.option-title { display: block; font: 500 15px/1.4 'Noto Sans TC'; color: var(--text-primary); }
.option-desc { display: block; font: 400 12px/1.5 'Noto Sans TC'; color: var(--text-tertiary); margin-top: 3px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  display: inline-block;
  font: 500 12px/1.4 'Noto Sans TC';
  color: var(--text-quote);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 6px 12px;
}

.text-input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text-primary);
  font: 400 15px/1.4 'Noto Sans TC';
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 12px;
  min-height: 52px;
  outline: none;
}
.text-input.is-invalid { border-color: var(--error); }
.input-error {
  display: none;
  margin-top: 8px;
  font: 400 12px/1.5 'Noto Sans TC';
  color: var(--error);
}
.input-error.is-visible { display: block; }

.error-box {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-3);
  border: 1px solid var(--border-error);
  border-radius: 8px;
  padding: 12px 14px;
}
.error-box svg { flex: 0 0 auto; margin-top: 2px; }
.error-box span { font: 400 13px/1.6 'Noto Sans TC'; color: var(--text-quote); }

.submit-btn { margin-top: 18px; }
.submit-btn[disabled] { background: var(--accent-active); color: #fff; cursor: wait; }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(39, 166, 68, 0.14);
  margin: 12px auto 18px;
}
#stepSuccess { text-align: center; padding-bottom: 4px; }
