/* 新增本地端字體宣告 */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/Roboto-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/Roboto-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/Roboto-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/NotoSansTC-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/NotoSansTC-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans TC';
  font-style: normal;
  font-weight: 700;
  src: url('fonts/NotoSansTC-Bold.ttf') format('truetype');
}

:root {
  --gf-bg: #F4E9DF;
  --gf-primary: #A0C09D;
  --gf-primary-hover: #BFD6BD;
  --gf-card-bg: #ffffff;
  --gf-text-main: #747575;
  --gf-text-sec: #B2B2B2;
  --gf-border: #ECD7C3;
  --gf-shadow: 0 6px 16px rgba(116, 117, 117, 0.06);
  --gf-shadow-hover: 0 10px 25px rgba(116, 117, 117, 0.12);
  --gf-radius: 16px;
  --gf-error: #e57373;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body, button, input, select, textarea {
  font-family: 'Roboto', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--gf-bg);
  color: var(--gf-text-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 插畫風格背景裝飾 Blob & Waves */
body::before {
  content: "";
  position: fixed;
  top: 10%;
  left: -40px;
  width: 160px;
  height: 160px;
  background-color: var(--gf-primary-hover);
  border-radius: 50% 30% 50% 40% / 40% 60% 30% 60%;
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 180px;
  height: 180px;
  background-color: var(--gf-border);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  opacity: 0.6;
  z-index: -1;
  pointer-events: none;
}

html::before {
  content: "";
  position: fixed;
  top: 30%;
  left: 2%;
  width: 40px;
  height: 120px;
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cpath d='M0,10 Q10,0 20,10 T40,10' fill='none' stroke='%23747575' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
}

html::after {
  content: "";
  position: fixed;
  bottom: 25%;
  right: 2%;
  width: 40px;
  height: 120px;
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cpath d='M0,10 Q10,20 20,10 T40,10' fill='none' stroke='%23747575' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
}

.banner, .banner2, .banner3 {
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  border-radius: var(--gf-radius);
  margin-top: 16px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--gf-shadow);
  border: 3px solid var(--gf-border);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
}
.banner { aspect-ratio: 2986 / 704; height: auto; background-image: url("../images/banner.png"); }
.banner2 { aspect-ratio: 2986 / 704; height: auto; background-image: url("../images/banner2.png"); }
.banner3 { aspect-ratio: 9832 / 3606; height: auto; background-image: url("../images/banner3.png"); }

@media (max-width: 600px) {
  .banner, .banner2, .banner3 { border-radius: 0; margin-top: 0; border: none; height: auto; }
}

/* Form Container */
.ai-form {
  width: 100%;
  max-width: 750px;
  margin: 0 auto 40px auto;
  padding: 0;
}

/* Common Card Style (Sections) */
.form-section, .form-section1, .success-section, .ErrorPage-section {
  background: var(--gf-card-bg);
  border-radius: var(--gf-radius);
  border: 3px solid var(--gf-border);
  box-shadow: var(--gf-shadow);
  padding: 28px;
  margin-bottom: 16px;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

/* Hover effect for active questions like Google Forms - 插畫對話框感 */
.form-section:hover, .form-section:focus-within {
  box-shadow: var(--gf-shadow-hover);
  border-color: var(--gf-primary);
  transform: translateY(-2px);
}

/* First section acts as the form header */
.form-section1 {
  padding: 32px 28px;
  text-align: left;
}
/* Optional: Make the very first form-section1 have the thick top border */
.ai-form .form-section1:first-of-type {
  border-top: 12px solid var(--gf-primary);
  border-top-left-radius: var(--gf-radius);
  border-top-right-radius: var(--gf-radius);
}

/* Labels and Texts */
.ai-form label {
  font-size: 1.05rem;
  color: #555555;
  display: block;
  margin-bottom: 16px;
  font-weight: 700;
}
.ai-form label .sub-label-zh {
  font-size: 0.9em;
  color: var(--gf-text-main);
  font-weight: 400;
}
.ai-form label small, .ai-form small {
  font-weight: 400;
  font-size: 0.85em;
  color: #999999;
  display: block;
  margin-top: 6px;
}

/* Inputs - 插畫手寫感圓角框 */
.ai-form input[type="text"],
.ai-form input[type="email"],
.ai-form select,
.ai-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gf-border);
  border-radius: 8px;
  background-color: #faf7f5;
  color: var(--gf-text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease-in-out;
  margin-bottom: 10px;
}

.ai-form input[type="text"]:focus,
.ai-form input[type="email"]:focus,
.ai-form select:focus,
.ai-form textarea:focus {
  border-color: var(--gf-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(160, 192, 157, 0.25);
}

.ai-form input[readonly] {
  color: #999999;
  border-style: dashed;
  background-color: #f7f3ef;
}

/* Radio and Checkbox Container */
.radio-text-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  font-weight: 400;
}
.radio-text-container label {
  display: flex;
  align-items: flex-start;
  font-weight: 500;
  margin-bottom: 0;
  cursor: pointer;
  color: var(--gf-text-main);
  font-size: 0.98rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.radio-text-container label:hover {
  background-color: #faf7f5;
  border-color: var(--gf-border);
}

input[type="radio"], input[type="checkbox"] {
  accent-color: var(--gf-primary);
  width: 18px;
  height: 18px;
  margin: 4px 0 0 0;
  flex-shrink: 0;
  margin-right: 12px !important;
  cursor: pointer;
}

/* Linear Scale (Table) */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}
th {
  font-weight: 700;
  color: var(--gf-text-main);
  padding: 12px;
  text-align: center;
  background-color: #faf7f5;
}
td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 2px solid #faf7f5;
}
td:first-child, th:first-child {
  text-align: left;
  color: var(--gf-text-main);
  font-weight: 500;
}
tr:hover {
  background-color: rgba(160, 192, 157, 0.08);
}

/* Buttons - 氣泡圓角藥丸 */
.submit-btn, .confirm-btn, .confirm-back-btn, .submit-btn1 {
  background-color: var(--gf-primary);
  color: white;
  border: 2px solid var(--gf-primary);
  border-radius: 30px;
  padding: 10px 28px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(160, 192, 157, 0.25);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: auto;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover, .confirm-btn:hover, .confirm-back-btn:hover {
  background-color: var(--gf-primary-hover);
  border-color: var(--gf-primary-hover);
  color: #747575;
  box-shadow: 0 6px 14px rgba(160, 192, 157, 0.35);
  transform: translateY(-2px);
}

.confirm-back-btn {
  background-color: transparent;
  color: var(--gf-text-main);
  border: 2px solid var(--gf-border);
  box-shadow: none;
  margin-right: 12px;
}

.confirm-back-btn:hover {
  background-color: #faf7f5;
  border-color: var(--gf-text-main);
  color: var(--gf-text-main);
  box-shadow: none;
  transform: translateY(-2px);
}

.submit-btn1[disabled], .submit-btn[disabled] {
  background-color: #e0e0e0 !important;
  border-color: #e0e0e0 !important;
  color: #9e9e9e !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Confirm Page Fields */
.confirm-field {
  margin-bottom: 24px;
}
.confirm-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gf-text-main);
  margin-bottom: 8px;
}
.confirm-label small {
  display: block;
  color: #999999;
  font-weight: 400;
  font-size: 0.85em;
  margin-top: 4px;
}
.confirm-value {
  background-color: #faf7f5;
  border: 2px solid var(--gf-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--gf-text-main);
  min-height: 48px;
  word-wrap: break-word;
}

/* Status / Alerts */
#patron_status {
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-block;
  padding: 8px 16px;
  border-radius: 30px;
  margin-top: 8px;
  border: 2px solid var(--gf-border);
  background-color: #ffffff;
}

a {
  color: var(--gf-primary);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  text-decoration: underline;
  color: var(--gf-primary-hover);
}

/* Success & Error Sections */
.success-section {
  border-top: 12px solid var(--gf-primary);
  text-align: center;
}
.ErrorPage-section {
  border-top: 12px solid var(--gf-error);
  text-align: center;
}
.success-title-tw, .ErrorPage-title-tw {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gf-text-main);
}
.success-title-en, .ErrorPage-title-en {
  font-size: 1rem;
  color: #999999;
  margin-bottom: 24px;
}
.patron-pill, .ErrorPage-patron-pill {
  background-color: #faf7f5;
  color: var(--gf-primary);
  border: 2px solid var(--gf-border);
  font-size: 1.1rem;
  padding: 12px 28px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  font-weight: 700;
}
.ErrorPage-patron-pill {
  color: var(--gf-error);
  border-color: #ffd8d6;
  background-color: #ffebee;
}
.feedback-msg-tw {
  font-size: 1.1rem;
  color: var(--gf-text-main);
  line-height: 1.8;
}
.btn-home {
  display: inline-block;
  background-color: transparent;
  color: var(--gf-primary);
  border: 2px solid var(--gf-primary);
  border-radius: 30px;
  padding: 8px 28px;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
  margin-top: 20px;
}
.btn-home:hover {
  background-color: var(--gf-primary-hover);
  color: #747575;
  border-color: var(--gf-primary-hover);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  width: 100%;
  margin-top: auto;
  padding: 28px 0;
  background-color: transparent;
  color: #999999;
  font-size: 0.85rem;
  text-align: center;
}
.footer-content {
  max-width: 770px;
  margin: 0 auto;
  line-height: 1.6;
}
.footer-content a {
  color: #999999;
}
.update-date {
  display: block;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .ai-form { padding: 0 10px; }
  .form-section, .form-section1 { border-radius: 8px; margin-bottom: 12px; padding: 24px 16px; }
  .form-section:hover, .form-section:focus-within { padding-left: 16px; }
  .ai-form .form-section1:first-of-type { border-top-left-radius: 8px; border-top-right-radius: 8px; }
  .action-btn-back-container, .action-btn-submit-container { text-align: center; margin: 10px 0; }
  .submit-btn, .confirm-btn, .confirm-back-btn { width: 100%; margin-bottom: 10px; }
}

/* Stat Form overrides if exist */
.stat-form { max-width: 750px; margin: 30px auto; }

/* 中英雙語對照選項樣式 (extracted from translations.php) */
.ai-form .translation-wrap {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  text-align: left;
  line-height: 1.3;
}
.ai-form .translation-en {
  font-size: 0.9em;
  color: #666;
  font-weight: normal;
  margin-top: 2px;
}