html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* =========================
   GOIF Mobile UI (WebPOS)
   ========================= */

:root {
  --goif-green: #00b14f;
  --goif-text: #1d2b36;
  --goif-muted: #7c8a96;
  --goif-border: #e6eaee;
  --goif-bg: #ffffff;
  --goif-soft: #f5f7f9;
  --goif-danger: #ff4d5a;

  --bs-font-sans-serif: "Helvetica", Arial, sans-serif;
  --bs-body-font-family: "Helvetica", Arial, sans-serif;

  /* RWD：依螢幕寬度自動縮放的尺寸（手機到平板） */
  --goif-fs-h1: 32px;
  --goif-fs-title: 24px;
  --goif-fs-label: 16px;
  --goif-fs-body: 16px;
  --goif-fs-help: 14px;
  --goif-fs-input: 20px;
  --goif-fs-btn: 16px;
  --goif-fs-amount: clamp(32px, 8vw, 42px);
  --goif-fs-remaining: clamp(24px, 7vw, 34px);

  --goif-pad-page-y: clamp(18px, 4.5vw, 28px);
  --goif-pad-page-x: clamp(14px, 4vw, 18px);
  --goif-img-h: clamp(190px, 52vw, 250px);
  --goif-icon-modal: 88px;

  /* 固定 footer（.goif-fixed-cta）佔位：避免蓋住中間內容 */
  --goif-footer-space: clamp(110px, 24vw, 150px);
}

body {
  margin-bottom: 0;
  background: var(--goif-bg);
  color: var(--goif-text);
  font-family: "Helvetica", Arial, sans-serif;
}

body.goif-parking {
  --bs-font-sans-serif: "Helvetica", Arial, sans-serif;
  --bs-body-font-family: "Helvetica", Arial, sans-serif;
  font-family: "Helvetica", Arial, sans-serif;
}

.goif-app {
  min-height: 100vh;
}

.goif-page {
  /* RWD：內容貼齊左右（不做固定置中欄位），只保留自適應 padding */
  max-width: 100%;
  margin: 0;
  padding: var(--goif-pad-page-y) var(--goif-pad-page-x) calc(var(--goif-footer-space) + env(safe-area-inset-bottom));
  width: 100%;
}

/* Web：固定寬度 798px 並置中 */
@media (min-width: 798px) {
  .goif-page {
    max-width: 798px;
    margin: 0 auto;
  }

  .goif-topbar {
    max-width: 798px;
    margin: 0 auto;
  }

  .goif-fixed-cta {
    width: 798px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
  }
}

.goif-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--goif-bg);
  padding: 10px 12px;
  border-bottom: 1px solid var(--goif-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.goif-topbar__title {
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  margin: 0;
  flex: 1;
  text-align: center;
  color: var(--goif-text);
}

.goif-icon-btn {
  border: 0;
  background: transparent;
  padding: 6px;
  line-height: 1;
  color: var(--goif-text);
  font-size: 22px;
}

/* Topbar back icon (SPEC/Icon: 通用左上角返回鍵 icon 圖檔.svg) */
.goif-icon-btn__img {
  width: 42px;
  height: 42px;
  display: block;
}

.goif-h1 {
  font-size: var(--goif-fs-h1);
  font-weight: 700;
  line-height: 34px;
  margin: 6px 0 0;
  letter-spacing: 0;
}

.goif-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  color: var(--goif-muted);
  margin: 6px 0 24px;
}

.goif-hero {
  position: relative;
  overflow: hidden;
}

.goif-hero__car {
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: auto;
}

.goif-payment-badges {
  display: flex;
  gap: 14px;
}

.goif-payment-badge {
  flex: 1;
  border: 1px solid var(--goif-border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.goif-payment-badge img {
  max-width: 100%;
  height: 42px;
}

.goif-method-icon {
  width: auto;
  height: 40px;
  object-fit: contain;
}

.goif-method-icon--small {
  width: 18px;
  height: 18px;
}

/* 1.2 Multi-Payment */
.goif-multipayment {
  margin-top: 18px;
  padding: 16px;
  background: #F2F4F8;
  border-radius: 8px;
}

.goif-multipayment__title {
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  color: rgba(38, 52, 58, 0.85);
  margin-bottom: 12px;
}

.goif-multipayment__box {
  border: 1px solid rgba(38, 52, 58, 0.2);
  border-radius: 8px;
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  overflow: hidden;
}

.goif-multipayment__option {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  height: 40px;
}

.goif-multipayment__option + .goif-multipayment__option {
  border-left: 0;
}

.goif-multipayment__icon {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.goif-label {
  font-size: var(--goif-fs-label);
  font-weight: 700;
  line-height: 26px;
  margin-bottom: 10px;
}

.goif-required {
  color: var(--goif-danger);
  margin-left: 2px;
}

.goif-input {
  width: 100%;
  height: 56px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--goif-border);
  background: var(--goif-soft);
  font-size: var(--goif-fs-input);
  letter-spacing: 1px;
  box-sizing: border-box;
}

/* Input with QR code icon */
.goif-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.goif-input--with-icon {
  padding-right: 56px;
}

.goif-qrcode-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.goif-qrcode-btn:hover {
  opacity: 0.7;
}

.goif-qrcode-btn:active {
  opacity: 0.5;
}

.goif-qrcode-btn img {
  width: 28px;
  height: 28px;
  display: block;
}

.goif-help {
  color: var(--goif-muted);
  font-size: var(--goif-fs-help);
  margin: 10px 0 22px;
}

.goif-btn-primary {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: var(--goif-fs-btn);
  font-weight: 700;
  line-height: 16px;
  background: var(--goif-green);
  color: #fff;
  box-sizing: border-box;
}

/* SearchCar: Next 未選取車輛時（disabled）背景要半透明 */
.goif-btn-primary:disabled,
.goif-btn-primary[disabled] {
  background: rgba(0, 177, 79, 0.35);
  color: rgba(255, 255, 255, 0.9);
  cursor: not-allowed;
}

/* 表單驗證（BuyerInfo） */
.goif-error-text {
  display: none;
  margin-top: 8px;
  color: var(--goif-danger);
  font-weight: 700;
  font-size: var(--goif-fs-help);
  line-height: 1.25;
}

.goif-error-text.is-visible {
  display: block;
}

.goif-input.is-invalid {
  border-color: var(--goif-danger);
  background: #fff5f6;
}

.goif-btn-outline {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
  background: transparent;
  color: var(--goif-green);
  border: 2px solid var(--goif-green);
  box-sizing: border-box;
}

.goif-select-btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: var(--goif-fs-btn);
  font-weight: 700;
  line-height: 16px;
  background: #81C100; /* Select */
  color: #fff;
  box-sizing: border-box;
}

.goif-card.is-selected .goif-select-btn {
  background: #5F8D01; /* Selected */
}

.goif-select-btn:disabled {
  opacity: 1;
}

.goif-fixed-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Footer 視覺：跟 header 一樣為白底 */
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--goif-border);
  min-height: calc(var(--goif-footer-space) - env(safe-area-inset-bottom));
}

.goif-card {
  border: 1px solid var(--goif-border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

/* 1.3：選到任一車輛後，其他未選取的卡片半透明 */
body.goif-has-selected-vehicle .goif-card[data-vehicle-card] {
  opacity: 0.45;
  transition: opacity 120ms ease;
}

body.goif-has-selected-vehicle .goif-card[data-vehicle-card].is-selected {
  opacity: 1;
}

.goif-vehicle-img {
  width: 100%;
  /* 依據等比例縮放：不裁切圖片內容 */
  height: auto;
  max-height: var(--goif-img-h);
  object-fit: contain;
  display: block;
  background: #dfe6ee;
}

/* 車輛照片：依頁面規格維持固定比例（以 327px 為設計基準，窄螢幕會等比例縮小） */
.goif-vehicle-media {
  width: 100%;
  /* 依螢幕寬度等比例縮放，不限制最大寬度（讓 placeholder/圖片都能貼齊容器寬度） */
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #dfe6ee;
  opacity: 1;
}

.goif-vehicle-media--search {
  aspect-ratio: 327 / 180;
}

.goif-vehicle-media--detail {
  aspect-ratio: 327 / 220;
  margin-top: 14px; /* gap: 14px */
}

.goif-vehicle-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
}

.goif-vehicle-media__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  color: #5b6b78;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.goif-vehicle-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--goif-img-h);
  background: #dfe6ee;
  color: #5b6b78;
  font-weight: 700;
}

.goif-section-title {
  font-size: var(--goif-fs-title);
  font-weight: 700;
  line-height: 34px;
  margin: 14px 0 14px;
  letter-spacing: 0;
}

.goif-divider {
  height: 1px;
  background: var(--goif-border);
  margin: 14px 0;
}

.goif-remaining {
  background: #fdecee;
  border-radius: 8px;
  height: 48px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
}

.goif-remaining > img {
  height: 26px;
  width: auto;
  flex-shrink: 0;
}

.goif-remaining__label {
  color: #5a6772;
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 1%;
  flex: 1;
}

.goif-remaining__time {
  color: var(--goif-danger);
  font-weight: 700;
  font-size: 24px;
  line-height: 26px;
  letter-spacing: 1%;
}

.goif-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 10px;
  align-items: baseline;
  font-size: var(--goif-fs-body);
}

.goif-kv__k {
  color: var(--goif-muted);
  font-weight: 500;
  line-height: 26px;
}

.goif-kv__v {
  text-align: right;
  font-weight: 500;
  line-height: 26px;
  color: var(--goif-text);
}

.goif-kv__v--green {
  color: var(--goif-green);
}

.goif-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
}

.goif-amount__value {
  color: var(--goif-green);
  font-size: 24px;
  font-weight: 700;
  line-height: 34px;
}

.goif-radio {
  border: 1px solid var(--goif-border);
  border-radius: 8px;
  height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  box-sizing: border-box;
}

.goif-radio.is-selected {
  border: 2px solid var(--goif-green);
}

.goif-radio__dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #c5d0da;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.goif-radio.is-selected .goif-radio__dot {
  border-color: var(--goif-green);
}

.goif-radio.is-selected .goif-radio__dot::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--goif-green);
  display: block;
}

.goif-modal-card {
  border-radius: 22px;
  overflow: hidden;
  border: 0;
}

.goif-modal-body {
  padding: 26px 22px 22px;
  text-align: center;
}

.goif-modal-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  margin: 10px 0 4px;
}

.goif-modal-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--goif-muted);
  margin: 0 0 16px;
}

/* 共用：modal icon 尺寸（會依寬度縮放） */
.goif-modal-icon {
  width: var(--goif-icon-modal);
  height: var(--goif-icon-modal);
}

/* Receipt：讓中間內容字級可跟著寬度縮放 */
.goif-receipt {
  font-size: clamp(10px, 2.8vw, 12.7px);
  font-weight: 1000;
}

.goif-receipt-card {
  border: 1px solid #d9d9d9;
  padding: 18px 16px;
  background: #fff;
  width: 310px;
  height: 647px;
  position: relative;
  margin: 10px auto 0;
  opacity: 1;
  box-sizing: border-box;
  overflow: hidden;
}

.goif-receipt-header {
  text-align: center;
  font-size: clamp(14px, 3vw, 13px);
  margin-bottom: 8px;
}

.goif-receipt-logo {
  width: min(100%, 250px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.goif-receipt-tagline {
  margin-top: 4px;
  font-style: italic;
  font-weight: 700;
  color: #4a5a66;
}

.goif-receipt-address {
  margin-top: 8px;
  color: #5f6b76;
  font-weight: 600;
}

.goif-receipt-divider {
  border-top: 2px solid #d9d9d9;
  margin: 12px 0;
}

.goif-receipt-block {
  display: grid;
  gap: 4px;
}

.goif-receipt-line {
  line-height: 1.35;
}

.goif-receipt-label {
  font-weight: 700;
}

.goif-receipt-split {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.goif-receipt-total {
  text-align: right;
  font-weight: 700;
}

.goif-receipt-address-block {
  margin-top: 6px;
  line-height: 1.35;
}

.goif-receipt-footer {
  text-align: center;
  font-weight: 700;
  margin-top: 10px;
}

/* Buyer information form */
.goif-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 420px) {
  .goif-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.goif-field-label {
  font-weight: 500;
  margin: 10px 0 8px;
  font-size: var(--goif-fs-label);
  line-height: 26px;
}

.goif-input--form {
  border-radius: 12px;
}

.goif-field-hint {
  color: var(--goif-muted);
  font-size: var(--goif-fs-help);
  margin-top: 8px;
}

.goif-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.goif-modal-actions--single {
  grid-template-columns: 1fr;
}

.goif-center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.goif-overlay {
  background: rgba(0, 0, 0, 0.25);
}

/* 1.18 System Maintenance Notice */
.goif-maintenance {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  text-align: center;
}

.goif-maintenance__card {
  width: min(92vw, 480px);
  margin: 0 auto;
  color: #26343a;
}

.goif-maintenance__icon {
  width: 88px;
  height: 88px;
  display: inline-block;
  margin-bottom: 14px;
}

.goif-maintenance__title {
  font-size: 32px;
  font-weight: 700;
  margin: 4px 0 12px;
  line-height: 40px;
  letter-spacing: 0;
}

.goif-maintenance__divider {
  height: 1px;
  background: #e3e6eb;
  margin: 12px auto 16px;
  width: 72%;
}

.goif-maintenance__text {
  font-size: 16px;
  font-weight: 400;
  color: #3c4a54;
  line-height: 24px;
  margin: 0;
}

.goif-maintenance__time {
  display: block;
  color: #00b14f;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  margin: 6px 0;
}

/* 1.19 Download APP */
.goif-download {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px calc(var(--goif-footer-space) + env(safe-area-inset-bottom));
  text-align: center;
}

.goif-download__top {
  max-width: 520px;
  margin: 0 auto;
}

.goif-download__bottom {
  max-width: 520px;
  margin: auto auto 0;
  width: 100%;
}

.goif-download__icon {
  margin: 18px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goif-download__icon img {
  width: 82px;
  height: 82px;
}

.goif-download__title {
  font-size: 32px;
  font-weight: 700;
  margin: 8px 0 10px;
  color: #26343a;
  line-height: 40px;
}

.goif-download__divider {
  height: 1px;
  background: #e3e6eb;
  width: 70%;
  margin: 0 auto 12px;
}

.goif-download__subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #3c4a54;
  margin: 0 0 20px;
}

.goif-download__card {
  border: 1px solid #d7dbe0;
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  margin-top: 0;
  margin-bottom: 14px;
}

.goif-download__card-icon {
  width: min(100%, clamp(76px, 20vw, 110px));
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  justify-self: center;
}

.goif-download__card-icon img {
  width: 70%;
  height: auto;
  max-width: 100%;
  display: block;
}

.goif-download__card-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 24px;
  color: #26343a;
  margin-bottom: 4px;
}

.goif-download__card-text {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #5b6b78;
  line-height: 16px;
  margin: 0;
}

