/* ============================================================
   TrailChat — stylesheet
   USTP-inspired blue & gold palette (approximations — USTP does not publish official hex codes)
   ============================================================ */

/* ---------- Design tokens ---------- */
.hidden {
  display: none !important;
}

:root {
  /* Brand (USTP-style blue & gold, approximated) */
  --color-brand-dark: #0b3d91;   /* deep USTP navy */
  --color-brand: #1661c3;        /* USTP blue */
  --color-brand-light: #4a90e2;
  --color-gold: #f2b705;         /* USTP gold */
  --color-gold-dark: #d49a00;

  /* Semantic */
  --color-bg: #f7f9fc;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-shadow: 0 10px 25px -5px rgba(11, 61, 145, 0.08);

  /* Radius / spacing */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: 0.25s ease;

  /* Max width */
  --container: 1200px;

  /* Dark mode */
  --color-bg-dark: #121212;
  --color-surface-dark: #1e1e1e;
  --color-text-dark: #f1f1f1;
  --color-text-muted-dark: #b3b3b3;
  --color-border-dark: #333333;
  --color-shadow-dark: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --color-bg: var(--color-bg-dark);
  --color-surface: var(--color-surface-dark);
  --color-text: var(--color-text-dark);
  --color-text-muted: var(--color-text-muted-dark);
  --color-border: var(--color-border-dark);
  --color-shadow: var(--color-shadow-dark);
  --color-brand: var(--color-brand-light);
  --color-brand-dark: var(--color-brand-dark);
  --color-gold: var(--color-gold-dark);
  --color-gold-dark: var(--color-gold-dark);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--color-brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  padding: 0 1.5rem;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
}

.btn--primary {
  background: var(--color-brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-brand-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--color-shadow);
}

.btn--outline {
  background: transparent;
  color: var(--color-brand);
  border: 2px solid var(--color-brand);
}

.btn--outline:hover {
  background: var(--color-brand);
  color: #fff;
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn--ghost:hover {
  background: #f3f4f6;
  color: var(--color-text);
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn--outline-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-width: 1.5px;
}

.btn--primary-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 1rem;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner__content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--color-shadow);
}

.cookie-banner__text strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-brand-dark);
  font-size: 1.1rem;
}

.cookie-banner__text p {
  margin: 0 0 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.cookie-banner__text a {
  color: var(--color-brand);
  font-weight: 600;
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Cookie settings drawer ---------- */
.cookie-drawer {
  position: fixed;
  inset: 0;
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.5);
  padding: 1rem;
}

.cookie-drawer.hidden {
  display: none;
}

.cookie-drawer__panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 560px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--color-shadow);
  position: relative;
}

.cookie-drawer__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}

.cookie-drawer__close:hover {
  color: var(--color-text);
}

.cookie-drawer h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--color-brand-dark);
}

.cookie-drawer__intro {
  margin: 0.25rem 0 1.75rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.cookie-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cookie-setting:last-child {
  border-bottom: none;
}

.cookie-setting__info strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.cookie-setting__info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 24px;
  transition: var(--transition);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-brand);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.cookie-drawer__actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-brand-dark);
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-highlight {
  color: var(--color-gold-dark);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-brand);
  text-decoration: none;
}

.nav-cta {
  margin-left: 1rem;
}

.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5rem 0 7rem;
  overflow: hidden;
}

.hero--small {
  padding: 3.5rem 0 4rem;
}

.hero__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
}

.hero__shape {
  width: 560px;
  height: 560px;
  background: var(--color-brand);
  top: -120px;
  left: -120px;
}

.hero__shape--2 {
  width: 440px;
  height: 440px;
  background: var(--color-gold);
  bottom: -60px;
  right: -80px;
  opacity: 0.25;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(22, 97, 195, 0.1);
  color: var(--color-brand);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(22, 97, 195, 0.2);
}

.hero__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1.25rem;
  color: var(--color-text);
  letter-spacing: -1px;
}

.hero__title--accent {
  color: var(--color-brand);
  display: block;
}

.hero__desc {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero__stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.stat {
  text-align: center;
}

.stat__number {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-brand-dark);
}

.stat__label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ---------- Sections ---------- */
section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-brand-dark);
  margin: 0 0 0.75rem;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Features ---------- */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-surface);
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--color-shadow);
  border-color: var(--color-brand-light);
}

.feature-card__icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--color-brand-dark);
}

.feature-card__desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- CTA section ---------- */
.cta-section {
  background: var(--color-brand-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cta__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.cta__title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.cta__desc {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 600px;
}

.cta-section .btn--primary {
  background: var(--color-gold);
  color: #5b4300;
}

.cta-section .btn--primary:hover {
  background: var(--color-gold-dark);
  color: #fff;
}

/* ---------- Donation cards ---------- */
.donate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.donate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.donate-card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--color-shadow);
}

.donate-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.donate-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  margin: 0 0 0.75rem;
}

.donate-desc {
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.donate-number {
  display: block;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-brand);
  background: rgba(22, 97, 195, 0.08);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.donate-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.donate-cta {
  max-width: 640px;
  margin: 2.5rem auto 0;
  padding: 1.5rem;
  background: rgba(242, 183, 5, 0.1);
  border: 1px solid rgba(242, 183, 5, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--color-brand-dark);
}

.donate-cta p {
  margin: 0;
  font-size: 1rem;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--color-surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(22, 97, 195, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ---------- Form success state ---------- */
.form-success {
  text-align: center;
  padding: 2rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-lg);
  color: #065f46;
}

.form-success strong {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.form-success p {
  margin: 0;
  font-size: 0.9rem;
  color: #047857;
}

/* ---------- FAQ accordion ---------- */
.faq-section {
  padding: 3rem 0;
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--color-brand);
  box-shadow: var(--color-shadow);
}

.faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--color-brand-dark);
}

.faq-item p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.faq-item .faq-content {
  display: block;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-trigger:hover {
  color: var(--color-brand);
}

.faq-trigger span {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.faq-item.open .faq-trigger span {
  transform: rotate(45deg);
  color: var(--color-brand);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-content {
  max-height: 400px;
  padding: 0 0 1.25rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-brand-dark);
  color: #e5e7eb;
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 260px;
}

.footer__brand .brand-mark {
  background: var(--color-gold);
  color: #5b4300;
}

.footer__brand .brand-highlight {
  color: var(--color-gold);
}

.footer__tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.5;
}

.footer__link-group h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem;
}

.footer__link-group a {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.footer__link-group a:hover {
  color: var(--color-gold);
  text-decoration: none;
  padding-left: 4px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer__bottom p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar__menu {
    position: fixed;
    inset: 72px 0 0 0;
    background: #fff;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    align-items: stretch;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--color-shadow);
  }

  .navbar__menu.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .navbar__toggle {
    display: block;
  }

  .nav-cta {
    margin-left: 0;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero__stats {
    gap: 1.5rem;
  }

  .stat__number {
    font-size: 1.5rem;
  }
}