/*
 * Site-wide styles for Mirakle.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #202223;
  background: #f4f6f8;
}

a { color: #008060; }
a:hover { color: #004c3f; text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #008060;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ─── Site header ─────────────────────────────────────────────────────── */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e1e3e5;
  padding: 0.875rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .brand {
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  color: #202223;
  letter-spacing: -0.01em;
}
.site-header .brand:hover { color: #008060; text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav a,
.site-nav summary {
  text-decoration: none;
  color: #6d7175;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}
.site-nav a:hover,
.site-nav summary:hover { color: #008060; text-decoration: none; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::marker { display: none; }
.site-nav summary::after {
  content: "▾";
  font-size: 0.7rem;
  margin-left: 0.35rem;
}
.site-nav-dropdown {
  position: relative;
}
.site-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.45rem;
  z-index: 150;
}
.site-nav-dropdown[open] .site-nav-dropdown-menu {
  display: grid;
  gap: 0.15rem;
}
.site-nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
}
.site-nav-dropdown-menu a:hover {
  background: #f1f8f5;
}
.site-nav-dropdown-menu a:focus-visible {
  background: #f1f8f5;
}
.site-nav form { margin: 0; }
.site-nav .auth-button {
  background: #008060;
  border: none;
  color: #fff;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border-radius: 6px;
  transition: background 150ms;
}
.site-nav .auth-button:hover { background: #004c3f; }

/* ─── Main container ──────────────────────────────────────────────────── */

.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
.site-main.wide { max-width: 1100px; }

/* ─── Flash messages ──────────────────────────────────────────────────── */

.flash {
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
}
.flash.notice { background: #d4f5e9; border: 1px solid #95c9b4; color: #00664d; }
.flash.alert  { background: #ffd4d4; border: 1px solid #e8b4b4; color: #c0392b; }

/* ─── Home page ───────────────────────────────────────────────────────── */

.home-hero {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
}
.home-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  color: #202223;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.home-tagline {
  color: #6d7175;
  font-size: 1rem;
  margin: 0 0 1rem;
}
.home-body {
  color: #6d7175;
  font-size: 0.9375rem;
  margin: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.home-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.75rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 180ms, transform 180ms;
}
.home-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
  text-decoration: none;
}
.home-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #202223;
  font-weight: 600;
}
.home-card p {
  color: #6d7175;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}
.home-card-cta { color: #008060; font-weight: 600; font-size: 0.9375rem; }

/* ─── Page header ─────────────────────────────────────────────────────── */

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  color: #202223;
  letter-spacing: -0.01em;
}
.page-lede {
  color: #6d7175;
  font-size: 1rem;
  margin: 0 0 1.75rem;
}

/* ─── Blog list ───────────────────────────────────────────────────────── */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.post-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 180ms, transform 180ms;
}
.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-1px);
  text-decoration: none;
}
.post-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #202223;
  line-height: 1.3;
}
.post-meta {
  color: #6d7175;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.post-excerpt {
  color: #6d7175;
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.6;
}
.post-tags { margin-top: 0.875rem; }
.post-tags span {
  display: inline-block;
  background: #f4f6f8;
  border: 1px solid #e1e3e5;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 6px;
  color: #6d7175;
}

/* ─── Blog article ────────────────────────────────────────────────────── */

.post-article {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 2.5rem;
}
.post-article .post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e1e3e5;
}
.post-article .post-header h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  color: #202223;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #202223;
}
.post-content h2 { margin-top: 2.5rem; font-size: 1.5rem; color: #202223; }
.post-content h3 { margin-top: 2rem; font-size: 1.25rem; color: #202223; }
.post-content a { color: #008060; }
.post-content a:hover { color: #004c3f; }
.post-content code {
  background: #f4f6f8;
  border: 1px solid #e1e3e5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}
.post-content pre {
  background: #f4f6f8;
  border: 1px solid #e1e3e5;
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
}
.post-content pre code { background: none; border: none; padding: 0; }
.post-content blockquote {
  border-left: 4px solid #008060;
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: #6d7175;
  font-style: italic;
}

.back-link {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e1e3e5;
}
.back-link a { font-weight: 500; }

/* ─── Service pages ──────────────────────────────────────────────────── */

.service-page {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.service-page [id] {
  scroll-margin-top: 150px;
}

.service-nav {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 0.5rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  position: sticky;
  top: 72px;
  z-index: 50;
}
.service-nav a {
  color: #6d7175;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  transition: background 150ms, color 150ms;
}
.service-nav a:hover,
.service-nav a.active,
.service-nav a:focus-visible {
  color: #008060;
  background: #f1f8f5;
  text-decoration: none;
}

.service-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 2rem;
  align-items: stretch;
}
.service-hero-main,
.service-panel,
.service-card,
.service-callout,
.service-statement,
.service-cta-panel,
.service-contact-panel {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.service-hero-main {
  padding: 3.5rem;
}
.service-hero-main h1 {
  font-size: 3rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 760px;
}
.service-lede {
  color: #6d7175;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 720px;
  margin: 0 0 1.5rem;
}
.service-kicker {
  color: #008060;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.service-actions,
.service-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.service-primary-button,
.service-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms, color 150ms, transform 150ms;
}
.service-primary-button {
  background: #008060;
  color: #ffffff;
}
.service-primary-button:hover {
  background: #004c3f;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,128,96,0.22);
}
.service-secondary-button {
  background: #ffffff;
  color: #202223;
  border-color: #c9cccf;
}
.service-secondary-button:hover {
  color: #008060;
  border-color: #008060;
  text-decoration: none;
  transform: translateY(-1px);
}
.service-panel {
  padding: 2rem;
}
.service-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
.service-check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.service-check-list li,
.service-check-grid li {
  position: relative;
  padding-left: 1.4rem;
}
.service-check-list li::before,
.service-check-grid li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #008060;
  position: absolute;
  left: 0.25rem;
  top: 0.65rem;
}
.service-check-list li + li {
  margin-top: 0.85rem;
}
.service-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.service-badge {
  border: 1px solid #c9cccf;
  border-radius: 999px;
  background: #f4f6f8;
  color: #202223;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
}
.service-section {
  margin-top: 1.5rem;
}
.service-section-header {
  margin-bottom: 1.35rem;
  max-width: 720px;
}
.service-section-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.65rem;
  line-height: 1.25;
}
.service-section-header p:not(.service-kicker) {
  margin: 0;
  color: #6d7175;
}
.service-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.service-card-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.service-card {
  padding: 2rem;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms;
}
.service-card:hover {
  border-color: #d8dcde;
  box-shadow: 0 5px 18px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}
.service-card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  line-height: 1.3;
}
.service-card p {
  margin: 0;
  color: #6d7175;
  line-height: 1.7;
}
.service-link-card {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 180ms, transform 180ms;
}
.service-link-card:hover {
  color: inherit;
  text-decoration: none;
}
.service-link-card:focus-visible {
  color: inherit;
  text-decoration: none;
}
.service-card-meta {
  color: #008060 !important;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.6rem !important;
}
.service-card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.service-callout,
.service-statement,
.service-cta-panel {
  padding: 3rem;
}
.service-callout h2,
.service-statement h2,
.service-cta-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.55rem;
  line-height: 1.3;
  max-width: 760px;
}
.service-callout p,
.service-statement p,
.service-cta-panel p {
  color: #6d7175;
  margin: 0;
  max-width: 760px;
  line-height: 1.75;
}
.service-callout p + p {
  margin-top: 0.75rem;
}
.service-statement {
  text-align: center;
  background: #f1f8f5;
  border-color: #95c9b4;
}
.service-statement p {
  margin-left: auto;
  margin-right: auto;
}
.service-statement h2 {
  margin-left: auto;
  margin-right: auto;
}
.service-cta-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
}
.service-cta-panel h2,
.service-cta-panel p {
  grid-column: 1;
}
.service-cta-panel .service-primary-button {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.service-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}
.service-table th,
.service-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f4f6f8;
}
.service-table th {
  width: 220px;
  color: #202223;
}
.service-table td {
  color: #6d7175;
}
.service-check-grid {
  list-style: none;
  margin: 0;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
}
.service-contact-panel {
  padding: 2rem;
  scroll-margin-top: 150px;
}
.service-contact-form {
  margin-top: 1rem;
}
.service-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.service-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.service-form-field-wide {
  grid-column: 1 / -1;
}
.service-form-field label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #202223;
}
.service-form-field input,
.service-form-field select,
.service-form-field textarea {
  width: 100%;
  border: 1px solid #c9cccf;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: #202223;
  background: #ffffff;
}
.service-form-field textarea {
  resize: vertical;
}
.service-form-field input:focus,
.service-form-field select:focus,
.service-form-field textarea:focus {
  outline: 2px solid #95c9b4;
  outline-offset: 1px;
  border-color: #008060;
}
.service-form-actions {
  margin-top: 1rem;
}
.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ─── Newsletter ─────────────────────────────────────────────────────── */

.newsletter-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.newsletter-hero,
.newsletter-form-panel,
.newsletter-rejection {
  background: #ffffff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.newsletter-hero {
  padding: 3.5rem;
}
.newsletter-hero h1 {
  font-size: 3rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 760px;
}
.newsletter-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.newsletter-choice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.8rem 1rem;
  border: 1px solid #c9cccf;
  border-radius: 6px;
  background: #ffffff;
  color: #202223;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: border-color 180ms, box-shadow 180ms, transform 180ms;
}
.newsletter-choice-button:hover,
.newsletter-choice-button:focus-visible {
  color: #008060;
  text-decoration: none;
  border-color: #95c9b4;
  box-shadow: 0 5px 18px rgba(0,0,0,0.09);
  transform: translateY(-1px);
}
.newsletter-form-panel {
  padding: 1.5rem;
}
.newsletter-form {
  display: grid;
  gap: 1rem;
  align-items: start;
}
.newsletter-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.newsletter-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin: 0;
}
.newsletter-rejection {
  padding: 2rem;
  text-align: center;
}
.newsletter-rejection h1 {
  margin: 1rem 0 1.25rem;
  font-size: 2.2rem;
  line-height: 1.2;
}
.newsletter-rejection-image {
  display: block;
  width: min(100%, 720px);
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .service-hero,
  .service-card-grid,
  .service-card-grid-two,
  .service-check-grid,
  .service-form-grid,
  .newsletter-form-grid,
  .newsletter-options,
  .service-cta-panel {
    grid-template-columns: 1fr;
  }
  .service-cta-panel .service-primary-button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
  .service-nav {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }
  .site-nav {
    flex-wrap: wrap;
    gap: 0.9rem;
  }
  .site-nav-dropdown {
    position: static;
  }
  .site-nav-dropdown-menu {
    left: 1rem;
    right: 1rem;
    min-width: auto;
  }
  .site-main {
    padding: 1.25rem 1rem 3rem;
  }
  .service-hero-main,
  .service-panel,
  .service-callout,
  .service-statement,
  .service-cta-panel,
  .service-contact-panel,
  .newsletter-hero,
  .newsletter-form-panel,
  .newsletter-rejection {
    padding: 1.5rem;
  }
  .service-hero-main h1,
  .newsletter-hero h1 {
    font-size: 1.8rem;
  }
  .service-table th,
  .service-table td {
    display: block;
    width: 100%;
  }
  .service-table th {
    padding-bottom: 0.2rem;
  }
  .service-table td {
    padding-top: 0.2rem;
  }
}

.embedded-stat {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  background: #f4f6f8;
}
