@import './tokens/colors.css';
@import './tokens/typography.css';
@import './tokens/spacing.css';

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.section-inner,
.header-inner,
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-sm { padding: 8px 14px; font-size: var(--text-sm); }
.btn-md { padding: 12px 20px; font-size: var(--text-base); }
.btn-lg { padding: 16px 28px; font-size: var(--text-lg); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--brand-primary);
  color: var(--text-onbrand);
  border-color: var(--brand-primary);
}
.btn-primary:hover { background: var(--brand-primary-hover); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--text-brand);
  border-color: var(--brand-primary);
}
.btn-secondary:hover { background: var(--brand-tint); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--brand-tint); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.badge-brand { background: var(--brand-tint); color: var(--text-brand); }

/* ---------- Cards (services) ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}
.card p {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* ---------- Check icon / list ---------- */
.check-icon { flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header { padding: 20px 48px; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon { height: 34px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--text-brand);
  letter-spacing: var(--tracking-tight);
}
.nav {
  display: flex;
  gap: 32px;
  align-items: center;
  position: relative;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav a:not(.btn) {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-pill);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px 48px 64px;
  display: flex;
  gap: 48px;
  align-items: center;
}
.hero-content {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  min-width: 0;
}
.hero-content > * {
  min-width: 0;
  max-width: 100%;
}
.hero-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
}
.hero-copy {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 520px;
}
.hero-media {
  flex: 1;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Services ---------- */
.services { background: var(--brand-tint); padding: 72px 0; }
.services .section-inner,
.pricing .section-inner { padding: 0 48px; }
.services h2, .pricing h2, .faq h2, .about-content h2, .why-content h2, .process h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin: 0 0 8px;
}
.section-lead {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: 40px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---------- Why us ---------- */
.why-us {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 72px 48px;
  display: flex;
  gap: 56px;
  align-items: center;
}
.why-stat {
  flex: 1;
  height: 320px;
  background: var(--green-800);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.why-stat-icon {
  position: absolute;
  right: -30px;
  bottom: -30px;
  height: 220px;
  opacity: 0.35;
}
.why-stat-number {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-heavy);
  color: var(--paper);
  line-height: 1;
}
.why-stat-copy {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--green-100);
  max-width: 320px;
}
.why-content { flex: 1; }
.why-content h2 { margin-bottom: 16px; }
.why-content > p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: var(--text-base);
}

/* ---------- Process ---------- */
.process {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 72px 48px;
}
.process h2 { margin-bottom: 40px; }
.process-steps { display: flex; gap: 40px; }
.process-step { flex: 1; }
.process-step-num {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  color: var(--text-brand);
  margin-bottom: 12px;
}
.process-step-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: 8px;
}
.process-step-copy {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* ---------- Pricing ---------- */
.pricing { background: var(--brand-tint); padding: 72px 0; }
.pricing-grid { display: flex; gap: 24px; align-items: stretch; }
.pricing-card {
  flex: 1;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pricing-card--highlight { background: var(--green-800); }
.pricing-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin: 0 0 8px;
  color: var(--text-primary);
}
.pricing-card--highlight h3 { color: var(--paper); }
.pricing-card > div:first-child > p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.pricing-card--highlight > div:first-child > p { color: var(--green-100); }
.pricing-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-features li {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: var(--text-sm);
}
.pricing-card--highlight .pricing-features li { color: var(--paper); }
.pricing-card .btn { margin-top: auto; }

/* ---------- About ---------- */
.about {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.about-inner {
  padding: 72px 48px;
  display: flex;
  gap: 56px;
  align-items: center;
}
.about-photo {
  flex: 0 0 280px;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.about-content { flex: 1; }
.about-content h2 { margin-bottom: 16px; }
.about-content p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: 12px;
  max-width: 560px;
}
.about-content p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 48px;
}
.faq .section-lead { margin-bottom: 24px; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 20px 0; }
.faq-question {
  all: unset;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  color: var(--text-primary);
}
.faq-icon { font-size: 22px; color: var(--text-brand); line-height: 1; }
.faq-answer {
  margin-top: 12px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 640px;
}
.faq-answer[hidden] { display: none; }

/* ---------- Closing CTA ---------- */
.closing-cta {
  background: var(--green-800);
  padding: 80px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.closing-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-heavy);
  color: var(--paper);
  max-width: 620px;
}
.closing-cta p {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--green-100);
  max-width: 560px;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--color-border); }
.footer-inner {
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand img { height: 22px; }
.footer-brand span { font-size: var(--text-sm); color: var(--text-secondary); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(20% 0.01 100 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
}
.modal h2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin: 0 0 8px;
}
.modal > p,
.modal-form-view > p:first-of-type {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.modal-thanks-view { display: flex; flex-direction: column; gap: 12px; padding: 24px 0; }
.modal-thanks-view p { font-size: var(--text-lg); }
.modal-thanks-view[hidden] { display: none; }

#survey-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--color-bg);
}
.form-field textarea { resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.service-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-error {
  color: #B3261E;
  font-size: var(--text-sm);
  margin: -8px 0 0;
}
.form-error[hidden] { display: none; }

.service-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  font-weight: var(--weight-regular);
  margin-bottom: 0;
}
.service-checkboxes input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero, .why-us, .about-inner { flex-direction: column; align-items: stretch; }
  .card-grid { grid-template-columns: 1fr; }
  .pricing-grid { flex-direction: column; }
  .process-steps { flex-direction: column; gap: 32px; }
  .form-row, .service-checkboxes { grid-template-columns: 1fr; }
  .about-photo { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 3 / 4; }
}

@media (max-width: 700px) {
  .site-header { padding: 16px 20px; }
  .hero { padding: 32px 20px 48px; }
  .section-inner, .about-inner, .why-us, .process, .faq, .closing-cta, .footer-inner { padding-left: 20px; padding-right: 20px; }
  .services .section-inner, .pricing .section-inner { padding: 0 20px; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 12px;
    z-index: 50;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a:not(.btn) { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); }
  .nav-links a:not(.btn):hover { background: var(--brand-tint); }
}
