/*
 * Propshaft's `stylesheet_link_tag :app` loads this file on every page, the public site included. The admin portal's
 * own styles now live in app/assets/tailwind/admin.css; the rules below only keep the public site as it was, and
 * :where(html:not(.admin-ui)) keeps both their old (zero) specificity and the admin pages out of them.
 */

:where(html:not(.admin-ui)) *,
:where(html:not(.admin-ui)) *::before,
:where(html:not(.admin-ui)) *::after {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

:where(html:not(.admin-ui)) body {
  background-color: #0B0F1A;
}

:where(html:not(.admin-ui)) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Fix Select Options Readability */
:where(html:not(.admin-ui)) select option {
  background-color: #0F172A;
  color: #F8FAFC;
}

/* Custom Scrollbar */
:where(html:not(.admin-ui)) ::-webkit-scrollbar {
  width: 6px;
}

:where(html:not(.admin-ui)) ::-webkit-scrollbar-track {
  background: transparent;
}

:where(html:not(.admin-ui)) ::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 10px;
}

:where(html:not(.admin-ui)) ::-webkit-scrollbar-thumb:hover {
  background: #4B5563;
}

/* Rails wraps invalid inputs in .field_with_errors on re-render, which breaks
   flex/grid sizing (e.g. contact method rows collapse). Keep wrappers transparent. */
:where(html:not(.admin-ui)) .field_with_errors {
  display: contents;
}
