:root {
  --bg: #f7f9fc;
  --card-bg: #ffffff;
  --navy: #0f2440;
  --navy-hover: #0a1a30;
  --blue: #2f6fed;
  --blue-dark: #1d4ed8;
  --track-bg: #7fb1e6;
  --text-dark: #16233a;
  --text-muted: #626f80;
  --border: #d3d9e3;
  --pill-bg: #eef4fc;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 14px rgba(15, 36, 64, 0.07);
  --max-width: 1180px;
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition:
    transform 0.15s,
    background 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.btn:disabled,
.submit-btn:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.85;
}

.turnstile-wrap {
  /* Fixed to the widget's scaled-down size (below) so a red .has-error
     border hugs the actual visible widget instead of its unscaled box —
     a CSS transform shrinks what's painted, not the layout box, so the
     wrapper needs to shrink to match explicitly. */
  width: 255px;
  height: 55px;
  margin: 0 auto 12px;
  overflow: hidden;
  box-sizing: border-box;
}
.cf-turnstile {
  transform: scale(0.85);
  transform-origin: top left;
}

/* Loading-state spinner shared by any submit button toggling `is-loading` during an async/reload submit. */
.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}
.is-loading .btn-spinner {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-loading .btn-spinner {
    animation: none;
  }
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy-hover);
}
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text-dark);
}
.btn-outline:hover {
  border-color: var(--blue-dark);
  color: var(--blue-dark);
}

/* CONFIRM MODAL — replaces native window.confirm(); same component as dashboard.css, ported for customer pages. */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 36, 64, 0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.show {
  display: flex;
}
.confirm-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: confirm-in 0.16s ease;
}
.confirm-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  color: #d97706;
}
.confirm-icon svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
}
.confirm-icon.confirm-icon-neutral {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon.confirm-icon-neutral svg {
  width: 24px;
  height: 24px;
}
.confirm-message {
  font-size: 0.92rem;
  color: var(--text-dark);
  margin-bottom: 22px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .btn {
  flex: 1;
  justify-content: center;
}
.btn-danger-light {
  background: #f87171;
  color: #fff;
  border-color: #f87171;
}
.btn-danger-light:hover {
  background: #ef4444;
  border-color: #ef4444;
}
.btn-danger-solid {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger-solid:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

@keyframes confirm-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Customer notification bell — topbar dropdown (desktop + mobile), capped at the 6 most recent updates. */
.notification-bell-wrap {
  position: relative;
}
.notification-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f3f8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
}
.notification-bell:hover {
  background: var(--pill-bg);
}
.notification-bell svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}
.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  background: #e03e3e;
  color: #fff;
  border-radius: 999px;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 36, 64, 0.25);
  z-index: 930;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.notification-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.notification-dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
}
.notification-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
}
.notification-dropdown-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.notification-dropdown-item:last-child {
  border-bottom: none;
}
.notification-dropdown-item:hover {
  background: var(--bg);
}
.notification-dropdown-item .nd-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
}
.notification-dropdown-item .nd-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.notification-dropdown-empty {
  padding: 22px 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Google Sign-In button + divider — used on the login/signup page and homepage modals. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  margin-bottom: 4px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.btn-google:hover {
  border-color: var(--navy);
  background: var(--bg);
}
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile floating pill nav — logged-in customers only, see _customer_tabbar.html */
.customer-tabbar-spacer {
  display: none;
}
.customer-tabbar {
  display: none;
}
@media (max-width: 640px) {
  .customer-tabbar-spacer {
    display: block;
    height: calc(76px + env(safe-area-inset-bottom));
  }
  .customer-tabbar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 920;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 8px;
    box-shadow: 0 10px 28px rgba(15, 36, 64, 0.2);
  }
  /* Hide the floating pill when a modal is open or any field is focused (keyboard resize otherwise floats it on top). */
  body:has(.modal-overlay.show, input:focus, textarea:focus, select:focus) .customer-tabbar {
    display: none;
  }
  .customer-tab {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--text-muted);
    transition:
      background 0.15s,
      color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
  }
  .customer-tab svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
  }
  .customer-tab.is-active {
    color: #fff;
    background: var(--blue);
  }

  /* Guest state is a single labeled pill, not a 3-icon tray — the tray's own
     white background/padding would otherwise show as an unwanted ring around it. */
  .customer-tabbar-guest {
    background: none;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  .customer-tab-labeled {
    width: auto;
    padding: 0 20px;
    gap: 8px;
    color: #fff;
    background: var(--blue);
    border: none;
    font-size: 0.88rem;
    font-weight: 700;
  }
  .customer-tab-labeled:hover {
    background: var(--blue-dark);
  }
  .customer-tab-labeled svg {
    width: 19px;
    height: 19px;
  }
}

/* Shared desktop account dropdown (_account_menu.html) — hidden on mobile, covered by the floating pill nav above. */
.account-menu {
  position: relative;
  display: inline-block;
}
.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.account-menu-trigger:hover {
  border-color: var(--navy);
}
.account-menu-chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform 0.15s;
}
.account-menu-trigger[aria-expanded="true"] .account-menu-chevron {
  transform: rotate(180deg);
}
.account-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(15, 36, 64, 0.14);
  padding: 6px;
  z-index: 200;
}
.account-menu-panel.show {
  display: block;
}
.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.account-menu-item:hover {
  background: var(--pill-bg);
}
.account-menu-item-danger {
  color: #b91c1c;
}
@media (max-width: 640px) {
  .account-menu {
    display: none;
  }
}

/* Per-field validation error — reuses the same red already used for
   destructive buttons (#dc2626) and the status-banner-error text (#991b1b)
   instead of introducing a new color. */
.field.has-error input,
.field.has-error select {
  border-color: #dc2626;
}
.field-error-text {
  display: block;
  margin-top: 4px;
  color: #991b1b;
  font-size: 0.8rem;
}
/* The Turnstile widget is a cross-origin iframe, so it can't be styled
   directly — redden the wrapper box around it instead. */
.field.has-error .turnstile-wrap {
  border: 1.5px solid #dc2626;
  border-radius: var(--radius-md);
}
