/* Samla cookie consent banner.
   Standalone CSS — does NOT depend on Tailwind. Loaded on every page so
   the banner renders consistently across landing.html, index.html
   (Flutter SPA), privacy.html, terms.html, and delete-account.html. */

#samla-consent-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: #1E1E2E;
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 20px 50px -10px rgba(15, 23, 42, 0.25);
  padding: 18px 20px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 640px) {
  #samla-consent-banner {
    flex-direction: row;
    align-items: center;
    bottom: 24px;
  }
}

.samla-consent-text {
  flex: 1;
  color: #475569;
}

.samla-consent-text p {
  margin: 0;
}

.samla-consent-text a {
  color: #3838ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.samla-consent-text a:hover {
  color: #1E1E2E;
}

.samla-consent-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.samla-consent-actions button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-width: 96px;
}

#samla-consent-reject {
  background: #ffffff;
  color: #1E1E2E;
  border-color: #E2E8F0;
}

#samla-consent-reject:hover {
  background: #F8F9FA;
  border-color: #CBD5E1;
}

#samla-consent-accept {
  background: #3838ff;
  color: #ffffff;
}

#samla-consent-accept:hover {
  background: #2a2ad9;
}

#samla-consent-banner button:focus-visible {
  outline: 2px solid #3838ff;
  outline-offset: 2px;
}

/* "Manage cookies" trigger — small text-button users can place wherever
   (e.g. privacy policy, footer). Pure styling — actual click handler is
   `window.samlaShowConsent()`. */
.samla-manage-cookies {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.samla-manage-cookies:hover {
  color: #1E1E2E;
}

/* === Dark mode ===
   OS-driven (prefers-color-scheme), no toggle — the banner has no app-theme
   context of its own. Lives here (the shared file) so EVERY page that links
   consent.css gets it: index.html (Flutter app), landing.html, privacy.html,
   terms.html, delete-account.html. Values mirror the Flutter dark palette
   (#1E1E1E surface, #26262A alt surface, slate text). Previously these rules
   were duplicated inside index.html's <style>; consolidated here as the single
   source of truth once the marketing/legal pages also went dark. */
@media (prefers-color-scheme: dark) {
  #samla-consent-banner {
    background: #1E1E1E;
    color: #E8E8EC;
    border: 1px solid #3A3A3E;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  }

  .samla-consent-text {
    color: #94A3B8;
  }

  .samla-consent-text a {
    color: #9C8FFF;
  }

  .samla-consent-text a:hover {
    color: #C4BBFF;
  }

  #samla-consent-reject {
    background: #26262A;
    color: #E8E8EC;
    border-color: #3A3A3E;
  }

  #samla-consent-reject:hover {
    background: #303036;
    border-color: #4A4A4E;
  }

  /* Accept keeps the indigo CTA — white text reads fine on it in both modes. */

  .samla-manage-cookies:hover {
    color: #E8E8EC;
  }
}
