/* Shared styles. Tenant colors and fonts come from /theme.css.php as CSS variables;
   the defaults below are what the super admin panel and an unstyled tenant use. */
:root {
  --brand-primary: #7a1f2b;
  --brand-primary-rgb: 122, 31, 43;
  --brand-primary-contrast: #ffffff;
  --brand-secondary: #c9a227;
  --brand-secondary-contrast: #1f1f24;
  --header-bg: #1f1f24;
  --header-text: #ffffff;
  --page-bg: #f6f5f2;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
}

body.look-admin,
body.look-public {
  background: var(--page-bg);
  font-family: var(--font-body);
  --bs-link-color-rgb: var(--brand-primary-rgb);
  --bs-link-hover-color-rgb: var(--brand-primary-rgb);
  --bs-primary-rgb: var(--brand-primary-rgb);
}
body.look-super { background: #f4f5f7; }

.look-admin h1, .look-admin h2, .look-admin h3,
.look-public h1, .look-public h2, .look-public h3 { font-family: var(--font-heading); }

.site-header { background: var(--header-bg); color: var(--header-text); }
.site-header .navbar-brand,
.site-header .nav-link,
.site-header .navbar-text,
.site-header a { color: var(--header-text); }
.site-header .nav-link { opacity: .8; }
.site-header .nav-link:hover,
.site-header .nav-link.active { opacity: 1; text-decoration: underline; text-underline-offset: .3em; }
.brand-logo { max-height: 40px; width: auto; vertical-align: middle; }
.brand-name { font-family: var(--font-heading); font-weight: 600; }

.look-admin .btn-primary,
.look-public .btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-color: var(--brand-primary-contrast);
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  --bs-btn-hover-color: var(--brand-primary-contrast);
  --bs-btn-active-bg: var(--brand-primary);
  --bs-btn-active-border-color: var(--brand-primary);
  --bs-btn-active-color: var(--brand-primary-contrast);
}
.look-admin .btn-primary:hover,
.look-public .btn-primary:hover { filter: brightness(1.1); }
.look-admin .btn-outline-primary,
.look-public .btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  --bs-btn-hover-color: var(--brand-primary-contrast);
}
.badge-brand { background: var(--brand-secondary); color: var(--brand-secondary-contrast); }

.support-banner { background: #fff3cd; color: #664d03; text-align: center; padding: .4rem 1rem; font-size: .9rem; }
.site-footer { color: #6c757d; font-size: .875rem; padding: 2rem 0; text-align: center; }

.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.form-help { font-size: .85rem; color: #6c757d; }
.swatch { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: .25rem; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.table td, .table th { vertical-align: middle; }
code.host { font-size: .9em; }

/* Flash messages (see flashToasts() in app/lib/layout.php). */
.flash-toasts { z-index: 1090; }
.flash-toasts .toast { box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.2); }
@media (prefers-reduced-motion: no-preference) {
  .flash-toasts .toast { animation: toast-slide-in .3s ease-out both; }
  .flash-toasts .toast:nth-child(2) { animation-delay: .08s; }
  .flash-toasts .toast:nth-child(3) { animation-delay: .16s; }
}
@keyframes toast-slide-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Keep each admin menu item on one line; the menu collapses below 1200px. */
.site-header .nav-link,
.site-header .navbar-text,
.site-header .btn { white-space: nowrap; }
/* A long name or logo shrinks (ending in "…") rather than push the menu off screen. */
.site-header .navbar-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Family portal menu, under the header. */
.portal-nav .nav-link { color: var(--bs-body-color); padding: .6rem .9rem; border-bottom: 3px solid transparent; }
.portal-nav .nav-link.active { border-bottom-color: var(--brand-primary); font-weight: 600; }
.portal-nav .nav { flex-wrap: nowrap; overflow-x: auto; }
.terms-text h2 { font-size: 1.15rem; margin-top: 1.25rem; }
.terms-text h2:first-child { margin-top: 0; }

/* Family portal: the pay bar stays in view at the bottom while fees are ticked. */
.pay-bar { position: sticky; bottom: .75rem; z-index: 10; box-shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .15); }
.pay-pick { flex-shrink: 0; }
label.me-auto { cursor: pointer; }
