:root {
  --header-gradient-start: #dc2626;
  --header-gradient-mid: #f97316;
  --header-gradient-end: #fb923c;
  --header-mobile-bg: #c53030;
}

header#mainHeader {
  position: sticky;
  top: 0;
  z-index: 40;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  background-color: var(--header-gradient-start);
  background-image: linear-gradient(90deg, var(--header-gradient-start) 0%, var(--header-gradient-mid) 55%, var(--header-gradient-end) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

header#mainHeader .header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header#mainHeader .brand-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  text-decoration: none;
}

header#mainHeader .brand-link:hover .brand-title {
  transform: scale(1.05);
}

header#mainHeader .brand-title {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  line-height: 1;
  transition: transform 0.3s ease;
  transform-origin: left;
}

header#mainHeader .brand-subtitle {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  opacity: 0.95;
}

header#mainHeader .nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

@media (min-width: 768px) {
  header#mainHeader .nav-links {
    display: flex;
  }
}

header#mainHeader .nav-link {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

header#mainHeader .nav-link:hover {
  opacity: 0.8;
}

header#mainHeader .nav-cta {
  padding: 0.6rem 1.25rem;
  background: white;
  color: #ff5038;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

header#mainHeader .nav-cta:hover {
  background-color: #f3f4f6;
}

header#mainHeader .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  header#mainHeader .menu-toggle {
    display: none;
  }
}

header#mainHeader .mobile-menu {
  display: none;
  padding: 1rem 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.08) 100%);
  border-top: 1px solid rgba(255,255,255,0.22);
}

header#mainHeader .mobile-menu.open {
  display: block;
}

header#mainHeader .mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  text-decoration: none;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
}

header#mainHeader .mobile-menu a:last-child {
  margin-bottom: 0;
}

header#mainHeader .mobile-menu a::after {
  content: '›';
  font-size: 1.1rem;
  opacity: 0.9;
}

body {
  margin: 0;
  background-color: #FFFFFF;
  color: #111111;
  font-family: 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: #ff5038;
  color: white;
}

.text-editorial-spacing {
  letter-spacing: 0.05em;
  line-height: 1.85;
}

.card-image-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.85) 100%);
}

.input-pill {
  background-color: #FFFFFF;
  border-radius: 9999px;
  color: #111111;
  transition: all 0.3s ease;
}

.input-pill:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.reveal-element {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.active {
  opacity: 1;
  transform: translateY(0);
}

footer {
  background: linear-gradient(90deg, #dc2626 0%, #f97316 100%);
  color: white;
  padding-top: 4rem;
  padding-bottom: 3rem;
}

footer a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}

footer a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

#serviceModal,
#successModal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#serviceModal.hidden,
#successModal.hidden {
  display: none !important;
}

#serviceModal:not(.hidden),
#successModal:not(.hidden) {
  display: flex !important;
}

#serviceModal > div,
#successModal > div {
  background: white;
  border-radius: 1.5rem;
  max-width: 32rem;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.25s ease;
}

#serviceModal button[aria-label="關閉視窗"],
#successModal button[onclick="closeModal()"] {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: #9ca3af;
  font-size: 1.25rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#serviceModal button[aria-label="關閉視窗"]:hover,
#successModal button[onclick="closeModal()"]:hover {
  color: #111111;
}

#serviceModal input,
#serviceModal textarea,
#membershipForm input,
#membershipForm textarea,
.modal-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background-color: #f9fafb;
  color: #111111;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#serviceModal input:focus,
#serviceModal textarea:focus,
#membershipForm input:focus,
#membershipForm textarea:focus,
.modal-input:focus {
  outline: none;
  border-color: #ff5038;
  box-shadow: 0 0 0 3px rgba(255, 80, 56, 0.15);
}

#serviceModal button[type="submit"],
#membershipForm button[type="submit"],
.success-modal-button {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #ff5038 0%, #f97316 100%);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(255, 80, 56, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#serviceModal button[type="submit"]:hover,
#membershipForm button[type="submit"]:hover,
.success-modal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 80, 56, 0.28);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.modal-tag {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  background: #fff5f2;
  color: #ff5038;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.success-modal-content {
  background: white;
  border-radius: 1.5rem;
  max-width: 24rem;
  width: 100%;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}

.success-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2f8f6a 0%, #4caf50 100%);
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 10px 24px rgba(47, 143, 106, 0.25);
}

.tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #4b5563;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #f3f4f6;
}

.tab-btn.active {
  background: linear-gradient(90deg, #ff5038 0%, #f97316 100%);
  color: white;
  border-color: transparent;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
