/* =============================================================================
   SDLust — Socially Deviant
   Main Stylesheet v1.0
   Brand: Sensual, playful, inclusive. Dark by default. Mean Girls energy.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   DESIGN TOKENS
   ----------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --color-plum:        #1a0a1e;   /* deepest background */
  --color-plum-mid:    #26102d;   /* card backgrounds */
  --color-plum-light:  #3a1a45;   /* elevated surfaces */
  --color-plum-border: #52285f;   /* borders */

  --color-rose:        #e8427a;   /* primary accent */
  --color-rose-light:  #f06fa0;   /* hover state */
  --color-rose-dark:   #c4295c;   /* active/pressed */
  --color-rose-glow:   rgba(232, 66, 122, 0.15);

  --color-gold:        #d4a017;   /* secondary accent — "selective" feel */
  --color-gold-light:  #f0c040;
  --color-gold-subtle: rgba(212, 160, 23, 0.12);

  --color-text-primary:   #f2e8f5;
  --color-text-secondary: #c4a8d0;
  --color-text-muted:     #8a6a96;
  --color-text-inverse:   #1a0a1e;

  --color-success:  #2ec27e;
  --color-error:    #e04848;
  --color-warning:  #d4a017;
  --color-info:     #5b9cf6;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  /* Borders */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(232, 66, 122, 0.2);

  /* Transitions */
  --transition: 0.18s ease;
}

/* Light theme (if user switches) */
[data-theme="light"] {
  --color-plum:        #fdf6ff;
  --color-plum-mid:    #f5e8fa;
  --color-plum-light:  #ecddf5;
  --color-plum-border: #d4a8e8;
  --color-text-primary:   #1a0a1e;
  --color-text-secondary: #4a2060;
  --color-text-muted:     #8a6a96;
  --color-text-inverse:   #fdf6ff;
}

/* -----------------------------------------------------------------------------
   RESET & BASE
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-plum);
  color: var(--color-text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-rose-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-gold-light); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--color-rose);
  outline-offset: 3px;
  border-radius: 2px;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
ul { list-style: none; }

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-rose);
  color: white;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* -----------------------------------------------------------------------------
   LAYOUT UTILITIES
   ----------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.main-content { flex: 1; }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }

/* -----------------------------------------------------------------------------
   SITE HEADER
   ----------------------------------------------------------------------------- */
/* =============================================================================
   ADMIN IMPERSONATION BANNER
   ============================================================================= */
.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 10000; /* above everything */
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 8px var(--space-lg);
  background: #2a0a0a;
  border-bottom: 2px solid #c0392b;
  font-size: 13px;
  color: #f5c6c6;
  flex-wrap: wrap;
}
.impersonate-banner-icon { font-size: 16px; flex-shrink: 0; }
.impersonate-banner-text { flex: 1; min-width: 0; }
.impersonate-banner-text strong { color: #fff; }
.impersonate-banner-sep { color: rgba(255,255,255,0.4); margin: 0 2px; }
.impersonate-banner-form { flex-shrink: 0; margin: 0; }
.impersonate-exit-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-body);
}
.impersonate-exit-btn:hover {
  background: rgba(255,255,255,0.22);
}

/* When impersonating, push the sticky header below the banner by keeping the
   banner sticky too — both use position:sticky so they stack naturally in flow */
.is-impersonating .site-header {
  top: 0; /* header is immediately below the banner in document flow */
}

/* Mobile: impersonation banner stacks vertically */
@media (max-width: 640px) {
  .impersonate-banner {
    padding: 8px var(--space-md);
    gap: var(--space-sm);
  }
  .impersonate-banner-text { font-size: 12px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-plum-border);
}
/* backdrop-filter lives on ::before so the header element itself is NOT a
   containing block for position:fixed descendants (the mobile nav overlay). */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 30, 0.92);
  backdrop-filter: blur(12px);
  z-index: -1;
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  height: 64px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-sd {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-rose);
  letter-spacing: -1px;
  line-height: 1;
}
.logo-lust {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: center;
  margin-left: 4px;
}
.site-logo:hover { text-decoration: none; }
.site-logo:hover .logo-sd { color: var(--color-rose-light); }

/* =============================================================================
   VIP STAR — gold star badge overlaid on a VIP member's avatar.
   Parent must be position:relative. Scales to the avatar via %.
   ============================================================================= */
.vip-star {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 34%;
  min-width: 15px;
  max-width: 26px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--color-gold-light), var(--color-gold));
  color: #2a1a02;
  border-radius: 50%;
  border: 2px solid var(--color-plum);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 2;
}
.vip-star svg { width: 64%; height: 64%; display: block; }
[data-theme="light"] .vip-star { border-color: #fff; }

/* Main nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
}

.nav-link {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-link:hover { color: var(--color-text-primary); background: var(--color-plum-light); text-decoration: none; }
.nav-link.active { color: var(--color-rose-light); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-md);
  right: var(--space-md);
  height: 2px;
  background: var(--color-rose);
  border-radius: var(--radius-pill);
}

/* Badge (unread count) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-rose);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  margin-left: 4px;
  vertical-align: middle;
}

/* Generic page tabs (search, profiles, etc.) */
.sdl-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-plum-border);
  margin-bottom: var(--space-lg);
}
.sdl-tab {
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), border-color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sdl-tab:hover { color: var(--color-text-primary); text-decoration: none; }
.sdl-tab.is-active {
  color: var(--color-rose-light);
  border-bottom-color: var(--color-rose);
}
.sdl-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
}
.sdl-tab.is-active .sdl-tab-badge {
  background: rgba(232,66,122,0.12);
  border-color: rgba(232,66,122,0.25);
  color: var(--color-rose-light);
}

/* Nav search */
.nav-search-form {
  display: flex;
  align-items: center;
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin: 0 var(--space-sm);
}
.nav-search-form:focus-within {
  border-color: var(--color-rose);
  box-shadow: 0 0 0 2px rgba(232,66,122,0.15);
}
.nav-search-input {
  background: none;
  border: none;
  outline: none;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--color-text-primary);
  width: 220px;
  transition: width var(--transition);
}
.nav-search-input:focus { width: 300px; }
.nav-search-input::placeholder { color: var(--color-text-muted); }
.nav-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px 5px 4px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.nav-search-btn:hover { color: var(--color-rose-light); }

/* Header user area */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-plum-border);
  object-fit: cover;
  transition: border-color var(--transition);
}
.nav-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-plum-light);
  color: var(--color-rose);
  font-weight: 700;
  font-size: 15px;
}

/* User dropdown */
.user-menu { position: relative; }
.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px var(--space-sm);
  background: none;
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
  font-size: 14px;
  transition: border-color var(--transition), color var(--transition);
}
.user-menu-toggle:hover { border-color: var(--color-rose); color: var(--color-text-primary); }
.chevron { font-size: 10px; }

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: 200;
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a,
.user-menu-dropdown .menu-btn,
.mobile-nav-overlay .menu-btn {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
  line-height: inherit;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown .menu-btn:hover { background: var(--color-plum-light); color: var(--color-text-primary); }
.menu-divider { height: 1px; background: var(--color-plum-border); margin: 4px 0; }
.menu-danger { color: var(--color-error) !important; }

/* Mobile nav overlay — hidden everywhere by default; shown only via .is-open on mobile */
.mobile-nav-overlay { display: none; }

/* -----------------------------------------------------------------------------
   MOBILE SUBNAV TRAYS — slide-up panels matching desktop dropdowns
   Hidden on desktop; managed by JS on mobile via .is-open
   ----------------------------------------------------------------------------- */
.mobile-subnav-backdrop,
.mobile-subnav-tray { display: none; }

@media (max-width: 640px) {
  /* Backdrop dims page content when a tray is open */
  .mobile-subnav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 4, 14, 0.55);
    z-index: 7900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .mobile-subnav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Tray — slides up from bottom, sits above the tab bar */
  .mobile-subnav-tray {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 8500;
    background: var(--color-plum-mid);
    border: 1px solid var(--color-plum-border);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    max-height: 72dvh;
    /* Hidden state: shifted below viewport */
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.22s ease;
  }
  .mobile-subnav-tray.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Drag handle visual */
  .mobile-subnav-handle {
    width: 36px;
    height: 4px;
    background: var(--color-plum-border);
    border-radius: var(--radius-pill);
    margin: var(--space-sm) auto var(--space-xs);
  }

  /* Tray heading */
  .mobile-subnav-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: var(--space-xs) var(--space-lg) var(--space-sm);
  }

  /* Tray links */
  .mobile-subnav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 14px var(--space-lg);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--color-plum-border);
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-subnav-item:first-of-type { border-top: none; }
  .mobile-subnav-item:hover,
  .mobile-subnav-item:active { background: var(--color-plum-light); color: var(--color-text-primary); }
  .mobile-subnav-item.is-current {
    color: var(--color-rose-light);
    background: var(--color-rose-glow);
  }
  .mobile-subnav-item svg { flex-shrink: 0; color: var(--color-text-muted); }
  .mobile-subnav-item.is-current svg { color: var(--color-rose-light); }

  /* Tab button active indicator when its tray is open */
  .mobile-tab--tray-open {
    color: var(--color-rose-light) !important;
  }
  .mobile-tab--tray-open svg { stroke: var(--color-rose-light); }
}

/* -----------------------------------------------------------------------------
   MOBILE BOTTOM TAB BAR
   ----------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none; /* shown only at ≤ 640px via media query */
}

@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 8000;
    background: rgba(26, 10, 30, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-plum-border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: color var(--transition);
    position: relative;
    min-height: 56px;
  }
  .mobile-tab:hover { color: var(--color-rose-light); text-decoration: none; }
  .mobile-tab.active { color: var(--color-rose); }
  .mobile-tab svg { flex-shrink: 0; }

  /* Badge on messages tab */
  .mobile-tab-badge-wrap { position: relative; display: inline-flex; }
  .mobile-tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--color-rose);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
  }

  /* Avatar thumbnail on Me tab */
  .mobile-tab-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid transparent;
  }
  .mobile-tab.active .mobile-tab-avatar { border-color: var(--color-rose); }
  .mobile-tab-avatar-ph {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-plum-light);
    border: 1px solid var(--color-plum-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
  }
  .mobile-tab.active .mobile-tab-avatar-ph { border-color: var(--color-rose); color: var(--color-rose); }

  /* Push main content above the tab bar */
  .main-content {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* Hamburger becomes "More" — keep it visible */
  .mobile-menu-toggle { display: flex; }

  /* Nav search hidden on mobile — accessible via /search and mobile overlay */
  .nav-search-form { display: none; }

  /* Remove sign-in btn from header on mobile (already in mobile overlay) */
  .header-user .btn-ghost { display: none; }

  /* User menu is fully duplicated in the overlay — hide it to keep the header lean */
  .user-menu { display: none; }

  /* Prevent iOS auto-zoom on header search input */
  .nav-search-input { font-size: 16px; }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  margin-left: auto;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* -----------------------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--color-rose); outline-offset: 3px; }

.btn-primary {
  background: var(--color-rose);
  border-color: var(--color-rose);
  color: white;
}
.btn-primary:hover {
  background: var(--color-rose-light);
  border-color: var(--color-rose-light);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  color: white;
}
.btn-primary:active { background: var(--color-rose-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--color-plum-border);
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  border-color: var(--color-rose);
  color: var(--color-text-primary);
  text-decoration: none;
}

.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-lg  { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-rose-light);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   FORMS
   ----------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

/* Grid form rows — global utilities used across all feature pages */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-md); }
@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 { grid-template-columns: 1fr; }
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.label-link {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-input:focus {
  border-color: var(--color-rose);
  box-shadow: 0 0 0 3px var(--color-rose-glow);
}
.form-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
}

.has-error .form-input { border-color: var(--color-error); }
.has-error .form-input:focus { box-shadow: 0 0 0 3px rgba(224, 72, 72, 0.15); }

.form-input-file {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.form-input-file::file-selector-button {
  background: var(--color-rose);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 6px 14px;
  margin-right: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.form-input-file::file-selector-button:hover {
  opacity: 0.85;
}

.input-row {
  display: flex;
  align-items: center;
  position: relative;
}
.input-row .form-input { padding-right: 44px; }

.search-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.search-form .form-input,
.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1;
}

.btn-show-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 4px;
  transition: color var(--transition);
}
.btn-show-password:hover { color: var(--color-rose); }

.input-status {
  position: absolute;
  right: 12px;
  font-size: 12px;
  font-weight: 600;
}
.status-ok  { color: var(--color-success); }
.status-err { color: var(--color-error); }

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.form-error {
  font-size: 12px;
  color: var(--color-error);
  font-weight: 500;
}

.form-error-banner {
  padding: var(--space-md);
  background: rgba(224, 72, 72, 0.12);
  border: 1px solid rgba(224, 72, 72, 0.3);
  border-radius: var(--radius-md);
  color: #f08080;
  font-size: 14px;
  margin-bottom: var(--space-md);
}
.form-info-banner {
  padding: var(--space-md);
  background: rgba(91, 156, 246, 0.12);
  border: 1px solid rgba(91, 156, 246, 0.3);
  border-radius: var(--radius-md);
  color: #90baf9;
  font-size: 14px;
  margin-bottom: var(--space-md);
}

/* Checkboxes */
.form-group--check { flex-direction: row; align-items: flex-start; gap: var(--space-sm); }
.check-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1.4;
}
.check-label input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-plum-border);
  border-radius: 4px;
  background: var(--color-plum-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: border-color var(--transition), background var(--transition);
}
.check-label input:checked + .check-box {
  background: var(--color-rose);
  border-color: var(--color-rose);
}
.check-label input:checked + .check-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.check-label input:focus-visible + .check-box {
  outline: 2px solid var(--color-rose);
  outline-offset: 2px;
}

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 20px;
}
.pw-bar {
  flex: 1;
  height: 4px;
  background: var(--color-plum-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.pw-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--transition), background var(--transition);
}
.pw-1 .pw-fill { width: 20%; background: var(--color-error); }
.pw-2 .pw-fill { width: 40%; background: #e07830; }
.pw-3 .pw-fill { width: 60%; background: var(--color-warning); }
.pw-4 .pw-fill { width: 80%; background: #8aca2a; }
.pw-5 .pw-fill { width: 100%; background: var(--color-success); }
.pw-label { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }

/* Inline form */
.inline-form { display: inline; }

/* -----------------------------------------------------------------------------
   AUTH PAGE LAYOUTS
   ----------------------------------------------------------------------------- */
.auth-page .main-content {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: calc(100vh - 64px);
}

/* Left brand panel */
.auth-brand {
  background: linear-gradient(145deg, var(--color-plum-mid) 0%, #200a28 100%);
  border-right: 1px solid var(--color-plum-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(232, 66, 122, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(212, 160, 23, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 380px; }
.auth-brand-logo {
  font-family: var(--font-display);
  font-size: 42px;
  margin-bottom: var(--space-lg);
  line-height: 1;
}
.auth-brand-headline {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.3;
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  font-style: italic;
}
.auth-brand-body {
  color: var(--color-text-secondary);
  font-size: 16px;
  margin-bottom: var(--space-lg);
}
.auth-brand-perks {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.auth-brand-perks li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.4;
}
.auth-brand-perks li::before {
  content: '✦';
  color: var(--color-rose);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Right form panel */
.auth-form-panel {
  background: var(--color-plum);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  overflow-y: auto;
}
.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}
.auth-subtext {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}
.auth-form { margin-top: var(--space-lg); }

/* Centered card layout (verify, reset, etc.) */
.auth-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  min-height: 60vh;
}
.auth-card {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.auth-card h1 { margin-bottom: var(--space-md); }
.auth-card p { color: var(--color-text-secondary); margin-bottom: var(--space-md); }

.auth-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(46, 194, 126, 0.12);
  border: 1px solid rgba(46, 194, 126, 0.3);
  color: var(--color-success);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}
.auth-error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(224, 72, 72, 0.12);
  border: 1px solid rgba(224, 72, 72, 0.3);
  color: var(--color-error);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

/* Auth success state inside form panel */
.auth-success { text-align: center; }
.auth-success .auth-success-icon { margin: 0 auto var(--space-lg); }
.auth-success h1 { margin-bottom: var(--space-md); }
.auth-success p  { color: var(--color-text-secondary); margin-bottom: var(--space-sm); }

/* Flash messages */
.flash {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  font-size: 14px;
}
.flash--info    { background: rgba(91, 156, 246, 0.1); color: #90baf9; }
.flash--success { background: rgba(46, 194, 126, 0.1); color: #7ee8a8; }
.flash--error   { background: rgba(224, 72, 72, 0.1);  color: #f08080; }

/* -----------------------------------------------------------------------------
   FOOTER
   ----------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-plum-border);
  padding: var(--space-xl) 0;
  background: var(--color-plum-mid);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
}
.footer-brand .logo-sd   { font-family: var(--font-display); font-size: 20px; color: var(--color-rose); }
.footer-brand .logo-lust { font-family: var(--font-display); font-size: 20px; }
.footer-tagline { color: var(--color-text-muted); font-size: 12px; font-style: italic; margin-top: 4px; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-left: auto;
}
.footer-nav a { color: var(--color-text-muted); font-size: 13px; }
.footer-nav a:hover { color: var(--color-text-primary); }
.footer-legal {
  width: 100%;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-plum-border);
}

/* -----------------------------------------------------------------------------
   NOTIFICATION BELL + DROPDOWN
   ----------------------------------------------------------------------------- */
.notif-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
  padding: 0;
}
.notif-bell-btn:hover { color: var(--color-text-primary); background: var(--color-plum-light); }
.notif-bell-btn[aria-expanded="true"] { color: var(--color-rose); }

.notif-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-rose);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 5000;
  overflow: hidden;
}
.notif-dropdown.is-open { display: block; }

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-plum-border);
}
.notif-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.notif-dropdown-all {
  font-size: 12px;
  color: var(--color-rose-light);
}

.notif-dropdown-empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: .875rem;
}

.notif-list { padding: var(--space-xs) 0; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--color-plum-light); text-decoration: none; }
.notif-item--unread {
  border-left-color: var(--color-rose);
  background: rgba(232, 66, 122, 0.05);
}

.notif-item-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-plum-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: var(--color-text-muted);
}
.notif-icon-wrap--connection_request,
.notif-icon-wrap--connection_accepted { color: var(--color-rose-light); }
.notif-icon-wrap--clique_vote,
.notif-icon-wrap--clique_approved     { color: var(--color-gold); }
.notif-icon-wrap--booking_request,
.notif-icon-wrap--booking_confirmed   { color: var(--color-success); }
.notif-icon-wrap--booking_cancelled   { color: var(--color-error); }
.notif-icon-wrap--event_approved      { color: var(--color-rose-light); }

.notif-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif-item-title {
  font-size: .875rem;
  color: var(--color-text-primary);
  line-height: 1.35;
}
.notif-item--unread .notif-item-title { font-weight: 600; }
.notif-item-sub {
  font-size: .75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  font-size: .7rem;
  color: var(--color-text-muted);
}

/* Notifications full page */
.notif-page-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--color-plum-border);
  transition: background var(--transition);
}
.notif-page-item:last-child { border-bottom: none; }
.notif-page-item:hover { background: var(--color-plum-light); text-decoration: none; }
.notif-page-item--unread {
  border-left-color: var(--color-rose);
  background: rgba(232, 66, 122, 0.04);
}
.notif-icon-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-plum-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.notif-page-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.notif-page-title {
  font-size: .9375rem;
  color: var(--color-text-primary);
  line-height: 1.35;
}
.notif-page-item--unread .notif-page-title { font-weight: 600; }
.notif-page-sub {
  font-size: .8125rem;
  color: var(--color-text-secondary);
}
.notif-page-time {
  font-size: .75rem;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  /* Pin dropdown to viewport so it never falls off either edge */
  .notif-dropdown {
    position: fixed;
    top: 64px;
    right: var(--space-sm);
    left: var(--space-sm);
    width: auto;
    max-height: calc(100dvh - 64px - 80px); /* leave room for bottom tab bar */
  }
}

/* -----------------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .logo-sub   { display: none; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }

  /* Mobile nav overlay — body-level sibling of <header>, position:fixed relative
     to viewport, so no stacking-context ancestor can interfere */
  .mobile-nav-overlay.is-open {
    display: flex;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-plum-mid);
    z-index: 9000;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-md) var(--space-md) calc(56px + env(safe-area-inset-bottom, 0px) + var(--space-lg));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-nav-overlay .nav-link {
    font-size: 16px;
    padding: 11px var(--space-md);
    border-radius: var(--radius-md);
    width: 100%;
    display: block;
  }
  .mobile-nav-overlay .nav-link.active {
    color: var(--color-rose-light);
    background: var(--color-rose-glow);
  }
  .mobile-nav-overlay .nav-link.active::after { display: none; }
  .mobile-nav-overlay .nav-link--danger { color: var(--color-error); }
  .mobile-nav-overlay .nav-link--cta {
    color: var(--color-rose-light);
    border: 1px solid var(--color-rose);
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: var(--space-xs);
  }
  .mobile-nav-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: var(--space-sm) var(--space-md) 2px;
  }
  .mobile-nav-overlay .mobile-nav-divider {
    border: none;
    border-top: 1px solid var(--color-plum-border);
    margin: var(--space-xs) 0;
  }

  /* Profile summary card at top of mobile overlay */
  .mobile-nav-profile-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-plum-light);
    border: 1px solid var(--color-plum-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
  }
  .mobile-nav-profile-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-plum-border);
    flex-shrink: 0;
  }
  .mobile-nav-profile-avatar-ph {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--color-plum-border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
  }
  .mobile-nav-profile-info {
    flex: 1;
    display: flex; flex-direction: column;
    min-width: 0;
  }
  .mobile-nav-profile-name {
    font-weight: 700; font-size: 16px;
    color: var(--color-text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-nav-profile-username {
    font-size: 13px; color: var(--color-text-muted);
  }
  .mobile-nav-profile-arrow {
    font-size: 24px; color: var(--color-text-muted);
    padding: var(--space-xs) var(--space-sm);
    text-decoration: none;
    flex-shrink: 0;
    line-height: 1;
  }

  /* button.mobile-tab — clear browser-specific button chrome only.
     Do NOT set font-size/color/font-weight here — those have higher specificity
     than .mobile-tab and would override the values set there. */
  button.mobile-tab {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
  }

  /* Hamburger → X when menu open */
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .auth-form-panel { padding: var(--space-lg) var(--space-md); }
  .container { padding: 0 var(--space-md); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-nav { margin-left: 0; }

  /* iOS Safari: prevent auto-zoom on inputs with font-size < 16px */
  .form-input, .form-select, .form-textarea { font-size: 16px; }

  /* Modals: centered with reduced padding and side margins on mobile */
  .modal {
    padding: var(--space-lg);
    max-height: 90vh;
    max-height: 90dvh;
    margin: 0 var(--space-sm);
    width: calc(100% - var(--space-md));
    max-width: calc(100% - var(--space-md));
  }
  .modal-lg { max-width: calc(100% - var(--space-md)); }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; min-width: 120px; justify-content: center; }
}

/* -----------------------------------------------------------------------------
   ACCESSIBILITY
   ----------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -----------------------------------------------------------------------------
   MODALS (shared across all pages)
   ----------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-card);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 560px; }
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--color-plum-light); color: var(--color-text-primary); }
.modal-title    { font-family: var(--font-display); font-size: 22px; font-weight: 400; margin-bottom: var(--space-xs); }
.modal-subtitle { color: var(--color-text-muted); font-size: 13px; margin-bottom: var(--space-lg); }
.modal-actions  { display: flex; gap: var(--space-sm); justify-content: flex-end; margin-top: var(--space-lg); }
/* -----------------------------------------------------------------------------
   MEMBER SEARCH RESULTS (shared: messages new-dm, clique invite, event invite)
   ----------------------------------------------------------------------------- */
.invite-results {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 280px;
  overflow-y: auto;
}
.invite-result-item {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.invite-result-item:hover { background: var(--color-plum-light); color: var(--color-text-primary); }
.invite-result-item em { color: var(--color-text-muted); font-style: normal; font-size: 12px; }
.invite-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.invite-avatar--ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-plum-light); color: var(--color-rose);
  font-weight: 700; font-size: 13px;
}

/* -----------------------------------------------------------------------------
   MEMBER TYPEAHEAD — reusable dropdown (input[data-member-search])
   ----------------------------------------------------------------------------- */
.mts-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.mts-wrap > input,
.mts-wrap > .form-input { width: 100%; }
.mts-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
}
.invite-result-item.is-active { background: var(--color-plum-light); color: var(--color-text-primary); }

/* -----------------------------------------------------------------------------
   PROFILE COMPLETION NUDGE
   ----------------------------------------------------------------------------- */
.profile-nudge {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.profile-nudge-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}
.profile-nudge-label {
  font-size: 13px;
  color: var(--color-text-muted);
  flex: 1;
}
.profile-nudge-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-rose);
}
.profile-nudge-dismiss {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.profile-nudge-dismiss:hover { color: var(--color-text-primary); }
.profile-nudge-bar-track {
  width: 100%;
  height: 6px;
  background: var(--color-plum-light);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}
.profile-nudge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-rose), var(--color-gold));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.profile-nudge-cta {
  display: inline-block;
  font-size: 13px;
  color: var(--color-rose);
  text-decoration: none;
  font-weight: 600;
}
.profile-nudge-cta:hover { text-decoration: underline; }
/* Compact variant shown on the edit page itself */
.profile-nudge--compact {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}
.profile-nudge--compact .profile-nudge-bar-track { margin-bottom: 0; }
.profile-nudge--compact .profile-nudge-cta { display: none; }
.invite-no-results { padding: var(--space-md); color: var(--color-text-muted); font-size: 13px; }
/* -----------------------------------------------------------------------------
   PENDING CONNECTION BADGE (nav + connections page)
   ----------------------------------------------------------------------------- */
.menu-item-badged { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.menu-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--color-rose);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.conn-section--pending {
  border-left: 3px solid var(--color-rose);
  padding-left: var(--space-md);
}
.conn-section-title--pending {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-rose);
}
.conn-pending-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: var(--color-rose);
  color: #fff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

/* =============================================================================
   PAGE CALLOUTS — inline notice banners used across multiple pages
   ============================================================================= */
.page-callout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(91, 156, 246, 0.08);
  border-left: 3px solid var(--color-info);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: var(--space-md);
}
.page-callout strong { color: var(--color-text-primary); }
.page-callout a { color: var(--color-rose-light); text-decoration: underline; }
.page-callout--rose {
  background: var(--color-rose-glow);
  border-left-color: var(--color-rose);
}
.page-callout--gold {
  background: var(--color-gold-subtle);
  border-left-color: var(--color-gold);
}
.page-callout-icon { font-size: 16px; flex-shrink: 0; line-height: 1.5; }

/* STI shield badge (profile view) — icon-only by default, expands on click */
.sti-shield-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: rgba(46, 194, 126, 0.12);
  border: 1px solid rgba(46, 194, 126, 0.3);
  border-radius: var(--radius-pill);
  color: #2ec27e;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: var(--space-xs);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, padding 0.3s ease;
}
.sti-shield-badge:hover { background: rgba(46, 194, 126, 0.2); border-color: rgba(46, 194, 126, 0.5); }
.sti-shield-badge svg { flex-shrink: 0; }
.sti-shield-label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  margin-left: 0;
  transition: max-width 0.35s ease, opacity 0.25s ease, margin-left 0.35s ease;
}
.sti-shield-badge.expanded { padding-right: 8px; }
.sti-shield-badge.expanded .sti-shield-label {
  max-width: 190px;
  opacity: 1;
  margin-left: 4px;
}
.sti-shield-check {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
  top: -1px;
}
[data-theme="light"] .sti-shield-badge {
  background: rgba(46, 194, 126, 0.15);
  border-color: rgba(46, 194, 126, 0.4);
}

/* =============================================================================
   SKELETON LOADING STATES (#15)
   ============================================================================= */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--color-plum-mid) 25%,
    var(--color-plum-light) 50%,
    var(--color-plum-mid) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton-text   { height: 14px; margin-bottom: 6px; border-radius: 4px; }
.skeleton-avatar { border-radius: 50%; }
.skeleton-msg-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}
.skeleton-msg-row .skeleton-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.skeleton-msg-row .skeleton-body   { flex: 1; }

/* =============================================================================
   MICRO-ANIMATIONS (#16)
   ============================================================================= */
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: scale(0.96); }

  @keyframes badge-pop {
    0%   { transform: scale(0);    opacity: 0; }
    70%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
  }
  .badge, .notif-bell-badge, .menu-badge, .section-badge {
    animation: badge-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

  @keyframes modal-enter {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
  }
  .modal-backdrop.open .modal {
    animation: modal-enter 0.2s ease both;
  }

  @keyframes msg-appear-new {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .message-row--new {
    animation: msg-appear-new 0.22s ease both;
  }

  @keyframes slide-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .alert, .toast {
    animation: slide-in-up 0.2s ease both;
  }
}

/* =============================================================================
   GLASSMORPHISM MODAL (#18)
   ============================================================================= */
.modal {
  background: rgba(38, 16, 45, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
[data-theme="light"] .modal {
  background: rgba(245, 232, 250, 0.90);
}
[data-theme="light"] .site-header::before {
  background: rgba(253, 246, 255, 0.82);
}
[data-theme="light"] .notif-dropdown,
[data-theme="light"] .user-menu-dropdown {
  background: rgba(245, 232, 250, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass {
  background: rgba(38, 16, 45, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-plum-border);
}
[data-theme="light"] .glass {
  background: rgba(245, 232, 250, 0.80);
}

/* =============================================================================
   THEME TOGGLE BUTTON (#19)
   ============================================================================= */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.theme-toggle-btn:hover {
  background: var(--color-plum-light);
  color: var(--color-text-primary);
}
.theme-toggle-btn svg { display: block; }

/* =============================================================================
   TOAST NOTIFICATIONS (global — used by window.sdlToast from main.js)
   ============================================================================= */
#toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 9500; /* above mobile overlay (9000) and bottom nav (8000) */
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  max-width: calc(100vw - var(--space-2xl));
}
.toast {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: auto;
}
.toast-show   { opacity: 1; transform: translateY(0); }
.toast--success { background: rgba(46,194,126,0.18); border: 1px solid rgba(46,194,126,0.4); color: #7ee8a8; }
.toast--error   { background: rgba(224,72,72,0.18);  border: 1px solid rgba(224,72,72,0.4);  color: #f08080; }
.toast--info    { background: rgba(91,156,246,0.18); border: 1px solid rgba(91,156,246,0.4); color: #90baf9; }

@media (max-width: 640px) {
  #toast-container {
    /* Sit above the mobile bottom tab bar */
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + var(--space-sm));
    left: var(--space-md);
    right: var(--space-md);
    max-width: none;
  }
}

/* =============================================================================
   LEGAL DOCUMENTS & COMPLIANCE — v17 additions
   ============================================================================= */

/* ── Acknowledgment banner (top of page, requires_acknowledgment docs) ───── */
.legal-ack-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-xl);
  background: color-mix(in srgb, var(--color-gold-light) 12%, var(--color-plum));
  border-bottom: 2px solid rgba(212, 160, 23, 0.45);
  font-size: 14px;
}
.legal-ack-banner-icon { font-size: 18px; flex-shrink: 0; }
.legal-ack-banner-text { flex: 1; color: var(--color-text-secondary); }
.legal-ack-banner-link { color: var(--color-gold-light); font-weight: 600; }
.legal-ack-banner-link:hover { text-decoration: underline; }

/* ── /legal index ────────────────────────────────────────────────────────── */
.legal-doc-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-2xl);
}

.legal-doc-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: background var(--transition), border-color var(--transition);
}
.legal-doc-card:hover {
  background: var(--color-plum-light);
  border-color: rgba(232,66,122,0.3);
}
.legal-doc-icon { font-size: 22px; flex-shrink: 0; }
.legal-doc-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.legal-doc-title { font-weight: 600; font-size: 15px; }
.legal-doc-meta { font-size: 12px; color: var(--color-text-muted); }
.legal-doc-arrow { font-size: 20px; color: var(--color-text-muted); flex-shrink: 0; }

.legal-index-footer {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-plum-border);
  font-size: 14px;
  color: var(--color-text-muted);
}
.legal-index-footer p { margin: 0 0 var(--space-sm); }

/* ── /legal/:slug view ───────────────────────────────────────────────────── */
.legal-doc-body {
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}
.legal-doc-body h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: var(--space-xl) 0 var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-plum-border);
}
.legal-doc-body p  { margin: 0 0 var(--space-md); }
.legal-doc-body ul,
.legal-doc-body ol { margin: 0 0 var(--space-md); padding-left: var(--space-xl); }
.legal-doc-body li { margin-bottom: 4px; }
.legal-doc-body a  { color: var(--color-rose-light); }
.legal-doc-body a:hover { text-decoration: underline; }

.legal-ack-box {
  background: color-mix(in srgb, var(--color-gold-light) 8%, var(--color-plum-mid));
  border: 1px solid rgba(212,160,23,0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.legal-ack-box p { margin: 0 0 var(--space-md); font-size: 14px; color: var(--color-text-secondary); }
.legal-ack-check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 14px;
  cursor: pointer;
}
.legal-ack-check-row input { margin-top: 3px; flex-shrink: 0; accent-color: var(--color-rose); }

.legal-ack-done {
  font-size: 14px;
  color: var(--color-success);
  margin-bottom: var(--space-xl);
}

.legal-doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-plum-border);
  font-size: 13px;
  color: var(--color-text-muted);
}
.legal-doc-footer a { color: var(--color-text-muted); }
.legal-doc-footer a:hover { color: var(--color-rose-light); }

@media (max-width: 600px) {
  .legal-ack-banner { padding: var(--space-sm) var(--space-md); }
  .legal-doc-card   { padding: var(--space-sm) var(--space-md); }
}

/* =============================================================================
   TICKET & GENDER TIER SYSTEM
   ============================================================================= */

/* ── Event form: ticket section ───────────────────────────────────────────── */
.ticket-section { border: 1px solid var(--color-plum-border); border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-lg); }
.ticket-section summary { cursor:pointer; display:flex; justify-content:space-between; align-items:center; font-size:16px; font-weight:600; list-style:none; }
.ticket-section summary::-webkit-details-marker { display:none; }
.ticket-section-body { margin-top: var(--space-lg); }
.ticket-type-row { margin-bottom: var(--space-md); }
.ticket-type-fields { display:flex; gap:var(--space-sm); align-items:flex-end; flex-wrap:wrap; }
.ticket-type-fields .form-group { margin-bottom:0; }
.ticket-remove-btn { flex-shrink:0; align-self:flex-end; padding:6px 10px; font-size:16px; line-height:1; }
.ticket-sold-badge { font-size:12px; color:var(--color-text-muted); padding:6px 0; flex-shrink:0; align-self:flex-end; }

/* ── Event view: ticket selection ─────────────────────────────────────────── */
.ticket-option { display:flex; align-items:center; gap:var(--space-sm); padding:var(--space-sm) var(--space-md); border:1px solid var(--color-plum-border); border-radius:var(--radius-md); margin-bottom:var(--space-sm); cursor:pointer; transition:border-color var(--transition), background var(--transition); }
.ticket-option input[type="radio"] { flex-shrink:0; }
.ticket-option:hover { border-color:var(--color-plum-light); background:var(--color-plum-light); }
.ticket-option--selected, .ticket-option:has(input:checked) { border-color:var(--color-rose); background:rgba(232,66,122,.06); }
.ticket-option--soldout { opacity:.5; cursor:not-allowed; }
.ticket-option-name  { flex:1; font-weight:600; }
.ticket-option-price { font-weight:700; color:var(--color-rose-light); font-size:15px; }
.ticket-option-cap   { font-size:12px; color:var(--color-text-muted); }

/* ── Payment pending banner ───────────────────────────────────────────────── */
.ticket-payment-pending { border:1px solid var(--color-plum-border); border-radius:var(--radius-lg); padding:var(--space-md); margin-top:var(--space-md); background:var(--color-plum-light); }
.ticket-payment-pending-header { font-size:15px; margin-bottom:var(--space-sm); }
.payment-methods-list { display:flex; flex-direction:column; gap:var(--space-xs); }
.payment-method-row  { display:flex; align-items:center; gap:var(--space-sm); padding:var(--space-xs) var(--space-sm); background:var(--color-surface); border-radius:var(--radius-md); }
.payment-method-type { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--color-text-muted); min-width:56px; }
.payment-method-handle { flex:1; font-weight:600; }

/* ── Group RSVP page ──────────────────────────────────────────────────────── */
.group-member-row { display:flex; align-items:center; gap:var(--space-sm); padding:var(--space-sm) 0; border-bottom:1px solid var(--color-plum-border); }
.group-member-row:last-child { border-bottom:none; }
.couple-option, .polycule-option { border:1px solid var(--color-plum-border); border-radius:var(--radius-md); padding:var(--space-md); margin-bottom:var(--space-md); }

/* ── Check-in door: gender + ticket columns ───────────────────────────────── */
.door-guest-gender { display:block; font-size:11px; color:var(--color-rose-light); margin-top:1px; }
.door-cell-ticket  { white-space:nowrap; }
.door-ticket-type  { display:block; font-size:13px; font-weight:600; }
.door-ticket-price { display:block; font-size:12px; color:var(--color-text-muted); }
.door-pay-badge    { display:inline-block; font-size:11px; font-weight:700; padding:1px 6px; border-radius:var(--radius-pill); margin-top:2px; }
.door-pay-badge--paid    { background:rgba(52,199,89,.15); color:#34c759; }
.door-pay-badge--pending { background:rgba(255,159,10,.15); color:#ff9f0a; }
.door-pay-badge--waived  { background:var(--color-plum-light); color:var(--color-text-muted); }
.door-avatar-btn { background:none; border:none; padding:0; cursor:pointer; flex-shrink:0; border-radius:50%; }
.door-avatar-btn:focus { outline:2px solid var(--color-rose); }

/* ── Profile modal ────────────────────────────────────────────────────────── */
.sdl-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; }
.sdl-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.6); }
.sdl-modal-box { position:relative; background:var(--color-surface); border:1px solid var(--color-plum-border); border-radius:var(--radius-xl); padding:var(--space-xl); width:90%; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.sdl-modal-close-btn { position:absolute; top:var(--space-sm); right:var(--space-sm); background:none; border:none; font-size:22px; cursor:pointer; color:var(--color-text-muted); line-height:1; padding:4px 8px; border-radius:var(--radius-sm); }
.sdl-modal-close-btn:hover { color:var(--color-text-primary); }
.btn-success { color:#34c759; border-color:rgba(52,199,89,.3); }
.btn-success:hover { background:rgba(52,199,89,.1); }

/* ── Guest grid: volunteer badge ──────────────────────────────────────────── */
.guest-chip--volunteer { border: 1px solid rgba(232,66,122,.3); position:relative; }
.guest-vol-badge { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; background:rgba(232,66,122,.15); color:var(--color-rose-light); padding:1px 5px; border-radius:var(--radius-pill); margin-left:4px; vertical-align:middle; }

/* ── Current host row (venue event form) ──────────────────────────────────── */
.current-host-row { display:flex; align-items:center; gap:var(--space-sm); padding:var(--space-sm) var(--space-md); background:var(--color-plum-light); border-radius:var(--radius-md); margin-bottom:var(--space-sm); }
