/* theme-deferred.css
   Below-the-fold and conditional styles split out of theme.css so the
   main critical bundle isn't dragged down by them. Loaded async via
   <link rel="preload" as="style" onload="..."> on every page that loads
   theme.css. The split categories are:
     - .back-to-top-button (only appears after scroll)
     - .cookie-consent-banner (revealed by deferred cookie-consent.js)
     - @media print (only applied when printing)
*/

/* ===== back-to-top (extracted from theme.css for async load) ===== */
/* ── Back to top floating button ────────────────────────────────────────── */
.back-to-top-button {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: var(--z-floating);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  cursor: pointer;
  box-shadow: 0 0.6rem 1.4rem rgba(3, 7, 12, 0.45);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.back-to-top-button[hidden] {
  display: none;
}

body:has(.cookie-consent-banner--visible) .back-to-top-button {
  bottom: 5.25rem;
}

.back-to-top-button:hover,
.back-to-top-button:focus-visible {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
}

.back-to-top-button svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 575.98px) {
  .back-to-top-button {
    right: 0.85rem;
    bottom: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top-button { transition: none; }
  .back-to-top-button:hover, .back-to-top-button:focus-visible { transform: none; }
}

/* ===== cookie-banner (extracted from theme.css for async load) ===== */
/* ── Cookie consent banner ──────────────────────────────────────────────── */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-banner);
  background: #1e293b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  padding: 0.875rem 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-consent-banner--visible {
  transform: translateY(0);
}

.cookie-consent-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  row-gap: 0.75rem;
}

.cookie-consent-text {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
  min-width: 200px;
}

.cookie-consent-link {
  color: #93c5fd;
  text-decoration: underline;
  white-space: nowrap;
}

.cookie-consent-link:hover,
.cookie-consent-link:focus-visible {
  color: #bfdbfe;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-consent-btn {
  padding: 0.65rem 1.2rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 44px;
}

.cookie-consent-btn--accept {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cookie-consent-btn--accept:hover,
.cookie-consent-btn--accept:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Decline must be visually equivalent to Accept (GDPR / EDPB guidance:
   reject as easy as accept). Same min-height/padding via .cookie-consent-btn;
   here we give it a solid contrasting fill so it doesn't read as secondary. */
.cookie-consent-btn--decline {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #f1f5f9;
}

.cookie-consent-btn--decline:hover,
.cookie-consent-btn--decline:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Tertiary "Customize" disclosure: outlined so it reads as a secondary option
   between the two primary CTAs without competing visually. */
.cookie-consent-btn--customize {
  background: transparent;
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.55);
}

.cookie-consent-btn--customize:hover,
.cookie-consent-btn--customize:focus-visible {
  background: rgba(226, 232, 240, 0.12);
  border-color: rgba(226, 232, 240, 0.85);
  color: #f8fafc;
}

.cookie-consent-options {
  flex-basis: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.cookie-consent-option {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  line-height: 1.45;
  cursor: pointer;
  margin: 0;
}

.cookie-consent-option input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.cookie-consent-options__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.cookie-consent-btn--save {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cookie-consent-btn--save:hover,
.cookie-consent-btn--save:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ===== print (extracted from theme.css for async load) ===== */
/* Print: strip site chrome, overlays, and floating widgets so the printed
   page shows page content only. Restores readable black-on-white text. */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .navbar,
  .site-footer,
  .skip-link,
  .back-to-top-button,
  .cookie-consent-banner,
  .pwa-install-cta,
  .pwa-update-toast,
  .pwa-launch-overlay,
  .page-render-overlay,
  .global-loading-overlay,
  .calculator-loading-overlay,
  #feedStatusBanner,
  #startupOverlay,
  [data-print-hide],
  .visually-hidden-print {
    display: none !important;
  }
  a {
    color: inherit;
    text-decoration: underline;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
  main,
  .content-panel,
  .card,
  .feature-card,
  .faq-card,
  .hero-panel,
  .legal-copy,
  .stat-card {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .content-panel,
  .card,
  .feature-card,
  .faq-card {
    box-shadow: none !important;
    border: 1px solid #d4d4d4 !important;
    page-break-inside: avoid;
  }
  h1, h2, h3 {
    page-break-after: avoid;
  }
  img {
    max-width: 100% !important;
    height: auto !important;
  }
}
