/**
 * 聯絡/預約報價頁面樣式
 */
@font-face {
  font-family: "MaokenAssortedSans";
  src: url("../../fonts/MaokenAssortedSans-TC.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* 讓文字在字體下載完前先顯示預設字體，避免空白 */
}

/* ========== 頁面容器 ========== */
.contact-page {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

/* 半透明深色遮罩 */
.contact-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}

/* ========== 內容包裝 ========== */
.contact-wrap {
  position: relative;
  z-index: 1;
  max-width: 1270px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  margin: 0 auto;
}

/* ========== 左側資訊面板 ========== */
.info-panel {
  width: 408px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #ffffff;
  padding: 40px 20px 40px 0;
  align-self: center;
}

.info-boxs {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 48px;
}

.info-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.info-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.info-text {
  font-weight: 500;
  color: #ffffff;
  line-height: 1.4;
}

.follow-us-wrap {
  display: flex;
  gap: 16px;
}

.follow-us-label {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 1px;
}

.social-icons {
  display: flex;
  gap: 21px;
  align-items: center;
}

.social-link img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: opacity 0.2s;
}

.social-link:hover img {
  opacity: 0.8;
}

/* ========== 右側表單卡片 ========== */
.form-card {
  background: #ffffff;
  border-radius: 30px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  padding: 47px 45px 55px;
}

/* ========== 表單樣式 ========== */
.quote-form {
  width: 100%;
}

.quote-form .form-title {
  color: #53bf6f;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 40px;
}

.quote-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

.quote-form .form-label {
  color: #5a8164;
  font-weight: 500;
  line-height: 1.3;
}

.required-star {
  color: #b10000;
  margin-left: 0;
}

.quote-form .form-input {
  background: #e9e9e9;
  height: 55px;
  border-radius: 10px;
  border: none;
  outline: none;
  padding: 0 16px;
  color: #333;
  width: 100%;
  box-sizing: border-box;
}

.quote-form .form-input::placeholder {
  color: #999;
}

.quote-form .form-input:focus {
  outline: 2px solid #53bf6f;
}

/* ========== 自訂下拉選單（filter-group 風格）========== */
.quote-form .filter-group {
  position: relative;
  width: 100%;
}

/* 主按鈕 */
.quote-form .filter-main-btn {
  width: 100%;
  height: 55px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  background-color: #e9e9e9;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease;
  box-sizing: border-box;
  text-align: left;
}

.quote-form .filter-main-btn:hover:not(:disabled) {
  border-color: #53bf6f;
}

.quote-form .filter-main-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 小尺寸按鈕（年/月/日）*/
.quote-form .filter-main-btn--sm {
  height: 55px;
  padding: 0 12px;
  font-size: 15px;
}

/* 圖示容器 */
.quote-form .toggle-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}

.quote-form .arrow-svg {
  width: 100%;
  height: auto;
  transition: transform 0.25s ease;
}

/* 啟動狀態 */
.quote-form .filter-group.active .filter-main-btn {
  background-color: #ffac27;
  border-color: #ffac27;
  color: #fff;
}

.quote-form .filter-group.active .arrow-svg {
  transform: rotate(180deg);
}

/* 下拉面板 */
.quote-form .filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 160px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 200;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    padding 0.25s ease;
}

.quote-form .filter-group.active .filter-dropdown {
  max-height: 260px;
  opacity: 1;
  padding: 8px 0;
  overflow-y: auto;
}

/* 捲軸美化 */
.quote-form .filter-dropdown::-webkit-scrollbar {
  width: 4px;
}
.quote-form .filter-dropdown::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* 選項 */
.quote-form .dropdown-option {
  display: block;
  padding: 10px 18px;
  color: #333;
  font-size: 15px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.quote-form .dropdown-option:hover {
  background-color: #e5ffec;
  color: #53bf6f;
}

.quote-form .dropdown-option.selected {
  background-color: #d0f5db;
  color: #3aaa5b;
  font-weight: 600;
}

/* ========== 2欄格線 ========== */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

.form-grid-2col .form-group {
  margin-bottom: 20px;
}

/* ========== 日期群組 ========== */
.form-date-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 年 */
.form-date-group .filter-group:nth-child(1) {
  flex: 0 0 130px;
}

/* 月、日 */
.form-date-group .filter-group:nth-child(2),
.form-date-group .filter-group:nth-child(3) {
  flex: 0 0 90px;
}

/* ========== 地址群組 ========== */
.form-address-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 縣市、鄉鎮市區：各佔 1fr */
.form-address-group .filter-group {
  flex: 1;
}

/* 路段門號固定較寬 */
.quote-form .form-input--address {
  flex: 0 0 280px;
}

/* ========== 送出按鈕包裝 ========== */
.submit-wrap {
  position: relative;
  margin-top: 32px;
}

/* ========== 浮動錯誤氣泡 ========== */
.form-toast {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff0f0;
  color: #b10000;
  border: 1px solid #f5c6cb;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  max-width: 480px;
  width: max-content;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 300;
  display: none;
  pointer-events: none;
}

/* 向下三角箭頭 */
.form-toast::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff0f0;
}

/* ========== 送出按鈕 ========== */
.submit-btn {
  display: block;
  width: 100%;
  height: 65px;
  background: #53bf6f;
  border: 4px solid #ffffff;
  border-radius: 32.5px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.submit-btn:hover {
  filter: brightness(0.9);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========== 裝飾點 ========== */
.contact-dot {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  top: 40px;
  right: 80px;
  pointer-events: none;
}

/* ========== 響應式：平板 (≤1280px) ========== */
@media (max-width: 1280px) {
  .contact-wrap {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .info-panel {
    width: 100%;
    max-width: 858px;
    padding: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    justify-content: space-between;
  }

  .info-boxes {
    margin-bottom: 0;
  }

  .form-card {
    width: 100%;
    max-width: 858px;
  }
}

/* ========== 響應式：手機 (≤768px) ========== */
@media (max-width: 768px) {
  .contact-page {
    padding: 36px 36px 55px;
    align-items: flex-start;
  }

  .form-card {
    padding: 33px 28px;
    border-radius: 20px;
  }
  .contact-dot {
    width: 65px;
    height: 65px;
    top: 15px;
    right: 15px;
  }

  .quote-form .form-title {
    font-size: 16px !important;
    margin-bottom: 10px;
    font-weight: 500;
    font-family: "MaokenAssortedSans";
    text-align: center;
  }

  .quote-form .form-label {
    font-size: 18px;
  }

  .quote-form .form-group label {
    gap: 4px;
  }

  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .quote-form .form-group {
    margin-top: 25px;
    margin-bottom: 0;
  }

  .quote-form .form-grid-2col .form-group {
    margin-bottom: 0;
    margin-top: 0;
  }

  .form-date-group {
    gap: 16px;
  }

  .form-date-group .filter-group:nth-child(1) {
    flex: 100%;
  }

  .form-date-group .filter-group:nth-child(2),
  .form-date-group .filter-group:nth-child(3) {
    flex: 1;
  }

  .form-address-group {
    flex-wrap: wrap;
    gap: 10px 20px;
  }

  .form-address-group .filter-group {
    flex: 1;
    min-width: 0;
  }

  .quote-form .form-input--address {
    flex: none;
    width: 100%;
  }

  .submit-btn {
    font-size: 20px;
    height: 56px;
  }

  .info-boxs {
    align-self: center;
  }

  .info-panel {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .contact-wrap {
    flex-direction: column-reverse;
    gap: 21.5px;
  }

  .quote-form .form-group label {
    height: 17px;
  }

  .info-panel {
    align-content: center;
    gap: 28px;
  }

  .info-boxs {
    gap: 12px;
    margin-bottom: 0;
  }

  .info-icon {
    width: 20px;
    height: auto;
  }

  .info-text {
    font-size: 12px;
    font-weight: 400;
  }
  .follow-us-wrap {
    gap: 8px;
  }
  .social-icons {
    gap: 16px;
  }

  .follow-us-img {
    width: 63px;
    height: auto;
  }
  .social-link img {
    width: 20px;
    height: 20px;
  }
  .quote-form .toggle-icon {
    width: 10px;
    height: auto;
  }

  .time-dete-group {
    margin-top: 25px;
  }
  .quote-form .form-label {
    font-size: 14px;
  }
  .dropdown-label {
    align-content: center;
  }

  .quote-form .form-input,
  .quote-form .filter-main-btn {
    height: 24px;
    font-size: 10px;
    border-radius: 2px;
    padding: 0 15px;
  }

  .submit-wrap {
    margin-top: 10px;
  }

  .submit-btn {
    font-size: 16px;
    height: 42px;
    font-weight: 500;
  }

  /* dropdown menu */
  .quote-form .dropdown-option {
    font-size: 10px;
  }
  .quote-form .filter-dropdown {
    min-width: auto;
    border-radius: 2px;
  }
}
