/* =========================================================
   2026 新北好茶－報名查詢頁面
   檔案：inc/check.css
   說明：搭配 inc/home.css 使用，只放報名查詢與保險填寫頁
         專用的樣式。
   ========================================================= */

.lookup-page {
  min-height: 100vh;
  background: #ffffff;
}

/* ---------------------------------------------------------
   頂部列
   --------------------------------------------------------- */
.lookup-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(6px);
}

.lookup-bar__inner {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.lookup-bar__brand {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 2px;
  text-decoration: none;
  white-space: nowrap;
}

.lookup-bar__nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.lookup-bar__nav a {
  color: #4a4a4a;
  font-size: 0.94rem;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lookup-bar__nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------------------------------------------------------
   主要內容
   --------------------------------------------------------- */
.lookup-main {
  padding: 48px 0 64px;
}

.lookup-page.is-embedded .lookup-main {
  padding: 16px 0 32px;
}

.lookup-page.is-embedded .lookup-bar,
.lookup-page.is-embedded .site-footer {
  display: none;
}

.lookup-head {
  margin-bottom: 28px;
}

.lookup-head h1 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 2px;
}

.lookup-head p {
  margin: 0;
  max-width: 44em;
  color: var(--muted);
}

/* ---------------------------------------------------------
   查詢表單
   --------------------------------------------------------- */
.lookup-form {
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafcf8;
}

.lookup-form__label {
  display: block;
  margin-bottom: 8px;
  color: #3f4a3b;
  font-weight: 700;
}

.lookup-form__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lookup-form input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 11px 15px;
  border: 1px solid #cfd8c7;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lookup-form input[type="email"]:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.15);
}

.lookup-form button {
  flex: 0 0 auto;
  padding: 11px 34px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lookup-form button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------
   結果
   --------------------------------------------------------- */
.lookup-result__count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.lookup-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.lookup-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.92rem;
}

.lookup-table th,
.lookup-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.lookup-table thead th {
  background: #eef4e9;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.lookup-table tbody tr:last-child td {
  border-bottom: 0;
}

.lookup-table tbody tr:nth-child(even) {
  background: #fafcf8;
}

.lookup-table tbody tr:hover {
  background: #f4f9ef;
}

/* 付款狀態標籤 */
.lookup-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.lookup-badge--paid {
  background: #e7f4e5;
  color: #2f6b2c;
}

.lookup-badge--unpaid {
  background: #fdecea;
  color: #b3261e;
}

.lookup-badge--void {
  background: #fff4e0;
  color: #96620b;
}

.lookup-badge--free {
  background: #eceff1;
  color: #4b5563;
}

.lookup-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(74, 103, 65, 0.35);
  white-space: nowrap;
}

.lookup-link:hover {
  border-bottom-color: var(--primary);
}

.lookup-muted {
  color: #b0b8ac;
}

/* ---------------------------------------------------------
   提示訊息
   --------------------------------------------------------- */
.lookup-alert {
  margin: 16px 0 0;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.94rem;
}

.lookup-alert--error {
  border-left: 4px solid #b3261e;
  background: #fdecea;
  color: #8d1d17;
}

.lookup-alert--empty {
  border-left: 4px solid var(--secondary);
  background: #f7f9f4;
  color: #4f5a4b;
}

.lookup-alert--success {
  border-left: 4px solid #4a8f45;
  background: #edf7ec;
  color: #2f6b2c;
}

.lookup-alert a {
  color: var(--primary);
  font-weight: 700;
}

/* ---------------------------------------------------------
   注意事項
   --------------------------------------------------------- */
.lookup-note {
  margin-top: 36px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafcf8;
}

.lookup-note h2 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.lookup-note ul {
  margin: 0;
  padding-left: 1.25em;
  color: #4f5a4b;
  font-size: 0.94rem;
}

.lookup-note li {
  margin-bottom: 6px;
}

.lookup-note li:last-child {
  margin-bottom: 0;
}

.lookup-note a {
  color: var(--primary);
  font-weight: 700;
}

/* ---------------------------------------------------------
   保險資料表單
   --------------------------------------------------------- */
.insurance-card {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.insurance-card__title {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
}

.insurance-card__sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.insurance-person {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.insurance-person:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.insurance-person h3 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.insurance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.insurance-field label {
  display: block;
  margin-bottom: 5px;
  color: #3f4a3b;
  font-size: 0.88rem;
  font-weight: 700;
}

.insurance-field input,
.insurance-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cfd8c7;
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.insurance-field input:focus,
.insurance-field select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.15);
}

.insurance-submit {
  margin-top: 8px;
}

.insurance-submit button {
  padding: 12px 40px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.insurance-submit button:hover {
  background: var(--primary-dark);
}

/* ---------------------------------------------------------
   響應式：表格轉卡片
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .lookup-table {
    min-width: 0;
  }

  .lookup-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .lookup-table,
  .lookup-table tbody,
  .lookup-table tr,
  .lookup-table td {
    display: block;
    width: 100%;
  }

  .lookup-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .lookup-table tbody tr:last-child {
    border-bottom: 0;
  }

  .lookup-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  .lookup-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
  }

  .lookup-table td[data-label="操作"] {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
  }

  .lookup-table-wrap {
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .lookup-bar__inner {
    width: calc(100% - 28px);
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .lookup-bar__nav {
    gap: 14px;
  }

  .lookup-bar__nav a {
    font-size: 0.88rem;
  }

  .lookup-main {
    padding: 30px 0 44px;
  }

  .lookup-form,
  .lookup-note,
  .insurance-card {
    padding: 18px;
  }

  .lookup-form__row {
    flex-direction: column;
  }

  .lookup-form button {
    width: 100%;
  }

  .insurance-submit button {
    width: 100%;
  }
}
