/* ── Header logo + title ───────────────────────────────────────────────── */
.md-logo img {
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
}

.md-header__title {
  margin-left: 0 !important;
  font-size: 1.1rem;
}

@media (max-width: 960px) {
  .md-header__inner {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* ── Content width + side margins ──────────────────────────────────────── */
.md-grid {
  max-width: 82rem;
  padding-inline: 1.5rem;
  box-sizing: border-box;
}

body {
  padding-bottom: 6rem;
}

/* ── FaultNet brand colours ────────────────────────────────────────────── */
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #1b2f5e;
  --md-primary-fg-color--light: #2952a3;
  --md-primary-fg-color--dark:  #182951;
  --md-accent-fg-color:         #3d7ef2;
  --md-typeset-a-color:         #2952a3;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #1b2f5e;
  --md-primary-fg-color--light: #2952a3;
  --md-primary-fg-color--dark:  #182951;
  --md-accent-fg-color:         #3d7ef2;
  --md-typeset-a-color:         #508bf3;
}

/* ── Homepage hero ─────────────────────────────────────────────────────── */
.fn-hero-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(to right, #1b2f5e 0%, #2952a3 100%);
  border-radius: 12px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.fn-hero {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 2rem 2rem 1.75rem;
  color: #fff;
}

.fn-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: #fff !important;
  line-height: 1.2;
}

.fn-hero p {
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.87);
}

.fn-hero-image {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.fn-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.fn-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 800px) {
  .fn-hero-wrap {
    flex-direction: column;
    background: linear-gradient(to bottom, #1b2f5e 0%, #2952a3 100%);
  }

  .fn-hero {
    text-align: center;
  }

  .fn-cta-group {
    justify-content: center;
  }

  .fn-hero-image {
    padding: 0 1rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
  }
}

.fn-btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none !important;
  transition: opacity 0.15s ease;
}

.fn-btn:hover { opacity: 0.88; }

.fn-btn--primary {
  background: #3d7ef2;
  color: #fff !important;
}

.fn-btn--outline {
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #fff !important;
}

/* ── Feature cards grid ────────────────────────────────────────────────── */
.fn-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.fn-card {
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-default-bg-color);
}

.fn-card-icon {
  margin-bottom: 0.75rem;
  line-height: 0;
}

.fn-card-icon ion-icon {
  font-size: 2.25rem;
  color: #3d7ef2;
}

.fn-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.fn-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--md-default-fg-color--light);
}

/* ── How it works ──────────────────────────────────────────────────────── */
.fn-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  counter-reset: step;
}

.fn-step {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  border-radius: 8px;
  background: var(--md-code-bg-color);
  counter-increment: step;
}

.fn-step::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #3d7ef2;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fn-step h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.fn-step p  { margin: 0; font-size: 0.875rem; color: var(--md-default-fg-color--light); }

/* ── Plans / pricing ───────────────────────────────────────────────────── */
.fn-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: 1.5rem;
  margin: 2rem 0;
}

.fn-plan {
  border-radius: 10px;
  border: 1px solid var(--md-default-fg-color--lightest);
  overflow: hidden;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}

.fn-plan--pro {
  border-color: #3d7ef2;
  box-shadow: 0 0 0 2px #3d7ef233;
}

.fn-plan-header {
  padding: 1.5rem;
  background: var(--md-code-bg-color);
}

.fn-plan-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fn-plan-header h2 ion-icon {
  font-size: 1.2rem;
  color: #3d7ef2;
  flex-shrink: 0;
}

.fn-plan-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3d7ef2;
  line-height: 1;
}

.fn-plan-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--md-default-fg-color--light);
}

.fn-plan-price-alt {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  margin-top: 0.3rem;
}

.fn-plan-price-alt em {
  font-style: normal;
  color: #2e9e5b;
  font-weight: 600;
}

.fn-plan-body {
  padding: 1.25rem 1.5rem;
}

.fn-plan-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fn-plan-body li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.fn-plan-body li::before {
  content: "✓ ";
  color: #2e9e5b;
  font-weight: 700;
}

.fn-upgrade-btn {
  display: block;
  text-align: center;
  padding: 0.75rem;
  background: #3d7ef2;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 0 0 8px 8px;
  transition: background 0.15s ease;
}

.fn-upgrade-btn:hover { background: #2952a3; }

/* ── Demo page screenshot grid ─────────────────────────────────────────── */
.fn-screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.fn-screenshot {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  background: var(--md-code-bg-color);
}

.fn-screenshot img,
.fn-screenshot svg {
  width: 100%;
  display: block;
}

.fn-screenshot-caption {
  padding: 0.75rem 1rem;
}

.fn-screenshot-caption h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.fn-screenshot-caption p {
  margin: 0;
  font-size: 0.825rem;
  color: var(--md-default-fg-color--light);
}

/* ── Contact page ──────────────────────────────────────────────────────── */
.fn-contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 700px) {
  .fn-contact-layout { grid-template-columns: 1fr; }
}

.fn-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--md-default-fg-color);
}

.fn-form input,
.fn-form select,
.fn-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--md-default-fg-color--light);
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}

.fn-form input:focus,
.fn-form select:focus,
.fn-form textarea:focus {
  outline: none;
  border-color: #3d7ef2;
  box-shadow: 0 0 0 3px #3d7ef233;
}

.fn-form textarea { min-height: 130px; resize: vertical; }

.fn-form-submit {
  width: 100%;
  padding: 0.8rem;
  background: #1b2f5e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.fn-form-submit:hover { background: #2952a3; }
.fn-form-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.fn-input--invalid {
  border-color: #dc2626 !important;
  outline: 2px solid #dc2626 !important;
  outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
  margin-bottom: 0.25rem !important;
}

.fn-field-error {
  display: block;
  font-size: 0.8rem;
  color: #dc2626;
  margin-bottom: 0.75rem;
}

.fn-form-success,
.fn-form-error {
  padding: 1rem;
  border-radius: 6px;
  display: none;
  margin-top: 0.75rem;
}

.fn-form-success { background: #d1fae5; color: #065f46; }
.fn-form-error   { background: #fee2e2; color: #991b1b; }

.fn-contact-info h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.fn-contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fn-contact-detail-icon {
  font-size: 1.4rem;
  color: #3d7ef2;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.fn-contact-detail p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--md-default-fg-color--light);
}

.fn-contact-detail strong {
  display: block;
  color: var(--md-default-fg-color);
  margin-bottom: 0.15rem;
}

/* ── Admonition colour overrides ──────────────────────────────────────── */

/* question (FAQ) — match Pro admonition light blue */
.md-typeset .admonition.question,
.md-typeset details.question {
  border-color: #3d7ef2;
}

.md-typeset .admonition.question:focus-within,
.md-typeset details.question:focus-within {
  box-shadow: 0 0 0 .2rem rgba(61, 126, 242, 0.2);
}

.md-typeset .question > .admonition-title,
.md-typeset .question > summary {
  background-color: rgba(61, 126, 242, 0.1);
}

.md-typeset .question > .admonition-title::before,
.md-typeset .question > summary::before {
  background-color: #3d7ef2;
}

.md-typeset .question > .admonition-title::after,
.md-typeset .question > summary::after {
  color: #3d7ef2;
}

.md-typeset .question > summary {
  padding-top: 11px;
}

/* ── Pro admonition ────────────────────────────────────────────────────── */
.admonition.pro {
  border-color: #3d7ef2;
}

.admonition.pro > .admonition-title {
  background-color: #3d7ef220;
}

.admonition.pro > .admonition-title::before {
  background-color: #3d7ef2;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z'/%3E%3C/svg%3E");
}

/* ── Bottom CTA section ────────────────────────────────────────────────── */
.fn-cta-section {
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.fn-cta-section p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.fn-cta-secondary {
  font-size: 0.9rem;
  color: var(--md-default-fg-color--light) !important;
  text-decoration: none !important;
}

.fn-cta-secondary:hover {
  color: var(--md-accent-fg-color) !important;
}

/* ── Back to top ───────────────────────────────────────────────────────── */
#fn-back-to-top {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #1b2f5e;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.15s ease;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 960px) {
  #fn-back-to-top {
    bottom: 6.5rem;
    right: 0.6rem;
  }
}

#fn-back-to-top ion-icon {
  font-size: 1.25rem;
}

#fn-back-to-top:hover {
  background: #2952a3;
}

#fn-back-to-top.fn-back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.md-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background-color: var(--md-primary-fg-color);
}

.md-footer-meta {
  background-color: var(--md-primary-fg-color);
}

.md-footer-meta__inner {
  text-align: center;
  justify-content: center;
}

.md-copyright {
  text-align: center;
  width: 100%;
  font-size: 14px;
}

.md-copyright__highlight {
  margin-bottom: -3px;
}


/* ── Prevent page-level horizontal overflow on mobile ───────────────────── */
html {
  overflow-x: hidden;
}

@media (max-width: 800px) {
  .md-typeset table th:first-child,
  .md-typeset table td:first-child {
    min-width: 100px;
    max-width: 200px;
    word-break: break-word;
  }
}

/* ── Pro badge (inline, used in screenshot captions) ───────────────────── */
.fn-pro-badge {
  background: #3d7ef2;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 5px;
  margin-right: 5px;
  letter-spacing: 0.03em;
}

/* ── Screenshot image sizing ───────────────────────────────────────────── */
.fn-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}
