:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #0f172a;
  --surface: #f8fafc;
  --radius: 16px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html.dark {
  --bg: #020617;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --primary: #38bdf8;
  --surface: #0f172a;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

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

a:hover {
  opacity: 0.8;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== Site Header (match main page style) ===== */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px) saturate(1.1);
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease;
}

html.dark #siteHeader {
  background: rgba(2, 6, 23, 0.65);
}

#siteHeader .header-inner {
  max-width: 980px;
  /* ikut pay page container width */
  margin: 0 auto;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#siteHeader .brand img {
  height: 48px;
  /* adjust kalau Abg nak lebih besar */
  width: auto;
}

#siteHeader .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Make theme button feel like main header (clean, no boxy UI) */
#siteHeader #themeBtn {
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 16px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

#siteHeader #themeBtn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  height: 40px;
  width: auto;
  transition: transform 0.2s ease;
}

.brand:hover img {
  transform: scale(1.05);
}

.pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
}

/* Main Card */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

p {
  margin: 10px 0;
  color: var(--muted);
}

.steps {
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.steps li {
  margin: 8px 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 600;
  background: var(--surface);
  transition: all 0.2s ease;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--muted);
}

.btn.primary {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

html.dark .btn.primary {
  color: #020617;
}

.btn.primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Packages Grid */
.sectionTitle {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.8;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .pill {
    font-size: 12px;
    color: var(--muted);
    border: 0px;
    padding: 0px;
    border-radius: 0px;
    background: 0px;
    font-weight: 500;
  }
}

.pack {
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.pack:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--muted);
  z-index: 10;
}

.pack h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.price {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}

.pack ul {
  margin: 0 0 20px 18px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  flex-grow: 1;
}

.pack ul li {
  margin-bottom: 6px;
}

.pack .btn {
  width: 100%;
  box-sizing: border-box;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.inlineLinks a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 4px;
}

.inlineLinks a:hover {
  text-decoration-color: var(--text);
}

/* Actions & FAQ */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.faq {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.faq h2 {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--bg);
  transition: background-color 0.2s ease;
}

details:hover {
  background: var(--surface);
}

details + details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  /* Hide default arrow in some browsers */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
}

details[open] summary::after {
  content: "−";
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

button#themeBtn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button#themeBtn:hover {
  background: var(--bg);
  border-color: var(--muted);
}

@media (max-width: 640px) {
  .card {
    padding: 20px;
    margin-top: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .container {
    padding: 16px;
  }

  .topbar {
    padding-bottom: 10px;
  }

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .btn {
    width: 100%;
  }
}

.pulse {
  outline: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateZ(0);
}

/* Refactor phase 4: utility classes replacing remaining inline style attributes */

.pack-cta-secondary {
  margin-top: 10px;
}

.small-tight {
  margin-top: -6px;
  margin-bottom: 14px;
}

.small-note {
  margin-top: 16px;
}

.small-spaced,
.small.inlineLinks.small-spaced {
  margin-top: 20px;
}

/* ===== Scroll to top ===== */

.scroll-top-btn {
  --scroll-top-offset-desktop: 24px;
  --scroll-top-offset-mobile: 14px;

  position: fixed;
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(var(--scroll-top-offset-desktop) + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #111827;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  touch-action: manipulation;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
}

.scroll-top-btn svg {
  width: 34px;
  height: 34px;
  display: block;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  transform: translateY(-2px);
}

.scroll-top-btn:focus-visible {
  outline: none;
}

html.dark .scroll-top-btn {
  color: #ffffff;
}

body.has-sticky-cta .scroll-top-btn {
  --scroll-top-offset-mobile: 104px;
}

@media (max-width: 819px) {
  .scroll-top-btn {
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(var(--scroll-top-offset-mobile) + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }

  .scroll-top-btn svg {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn {
    transition: none;
  }
}
