/* ==========================================================================
   iTribe - Main Stylesheet
   Purple-accented heritage brand, soft neutrals, pill buttons,
   clean generous whitespace.
   ========================================================================== */

/* ==========================================================================
   0. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Primary palette — iTribe brand purple */
  --color-primary: #6B5BA5;
  --color-primary-light: #E8E3F5;
  --color-primary-dark: #4F3D8A;
  --color-secondary: #8B7EC4;
  --color-secondary-light: #EFEBF8;
  --color-secondary-dark: #4F3D8A;

  /* Neutrals — off-white lavender ground */
  --color-bg: #F7F5FA;
  --color-bg-alt: #FFFFFF;
  --color-bg-warm: #FAF8FC;
  --color-white: #FFFFFF;
  --color-text: #1A1A2E;
  --color-text-light: #3A3A4C;
  --color-text-muted: #6E6B85;
  --color-text-secondary: #6E6B85;
  --color-text-primary: #1A1A2E;
  --color-border: #DAD4E8;
  --color-border-light: #EBE7F2;
  --color-neutral-light: #F2EFF7;

  /* Accent / semantic colors */
  --color-success: #4CAF7A;
  --color-success-light: #DDF2E6;
  --color-danger: #E5484D;
  --color-danger-light: #FBE4E5;
  --color-warning: #E8A94B;
  --color-warning-light: #FCEEDA;
  --color-info: #6B5BA5;
  --color-info-light: #E8E3F5;

  /* Typography — SF Pro style (Inter is the closest web equivalent) */
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1.0625rem;
  --font-size-lg: 1.1875rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.125rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3rem;
  --line-height-tight: 1.2;
  --line-height-base: 1.53;
  --line-height-relaxed: 1.7;

  /* Spacing — slightly tighter, Apple-like */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Layout */
  --container-max: 1120px;
  --container-narrow: 720px;
  --nav-height: 64px;

  /* Borders & Radius — Apple's continuous corner curves */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  /* Shadows — softer, more diffused like Apple */
  --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 14px 42px rgba(0, 0, 0, 0.12);

  /* Transitions — Apple spring-like easing (damped spring curves) */
  --transition-fast: 150ms cubic-bezier(0.2, 0.9, 0.3, 1);
  --transition-base: 250ms cubic-bezier(0.2, 0.9, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.2, 0.9, 0.3, 1);
}


/* ==========================================================================
   1. Reset & Base Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Prevent horizontal scroll bleeding from any descendant whose hero
     decoration or full-bleed gradient overshoots the viewport edge. */
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: 0.5em;
  letter-spacing: -0.022em;
}

h1 { font-size: var(--font-size-4xl); font-weight: 800; letter-spacing: -0.028em; }
h2 { font-size: var(--font-size-3xl); letter-spacing: -0.026em; }
h3 { font-size: var(--font-size-2xl); letter-spacing: -0.024em; }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  padding-left: 1.5rem;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

strong, .fw-bold {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

blockquote {
  border-left: 4px solid var(--color-secondary);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  background: var(--color-bg-warm);
  border-radius: 0 var(--radius) var(--radius) 0;
}

cite {
  font-style: normal;
}

::selection {
  background-color: var(--color-secondary);
  color: var(--color-white);
}


/* ==========================================================================
   2. Layout & Container
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.main-content {
  flex: 1;
  padding-top: var(--nav-height);
}

section,
.section {
  padding: var(--space-7) 0;
}

.section--alt-bg {
  background-color: var(--color-bg-alt);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-7);
}

.section__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-2);
}

.section__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto var(--space-3);
}

.section__divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  margin: var(--space-3) auto 0;
  border-radius: var(--radius-pill);
}

.section__action {
  text-align: center;
  margin-top: var(--space-6);
}


/* ==========================================================================
   3. Grid System (Bootstrap-compatible)
   ========================================================================== */

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.row.g-3 {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.row.g-3 > [class*="col"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

[class*="col"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.col-6 { width: 50%; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.333%; }
  .col-md-5 { width: 41.667%; }
  .col-md-6 { width: 50%; }
}

@media (min-width: 1024px) {
  .col-lg { flex: 1 0 0; }
  .col-lg-2 { width: 16.667%; }
  .col-lg-4 { width: 33.333%; }
  .col-lg-5 { width: 41.667%; }
  .col-lg-8 { width: 66.667%; }
}


/* ==========================================================================
   4. Navbar
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
  height: var(--nav-height);
  transition: box-shadow var(--transition-base);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo:hover {
  text-decoration: none;
}

.logo-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  flex-direction: column;
  gap: 5px;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-alt);
  text-decoration: none;
}

.nav-link.active {
  color: var(--color-primary);
  background-color: rgba(107, 91, 165, 0.1);
  font-weight: 600;
}

.nav-link--cta {
  background-color: var(--color-primary);
  color: var(--color-white) !important;
  font-weight: 600;
  border-radius: var(--radius);
}

.nav-link--cta:hover {
  background-color: var(--color-primary-light) !important;
  color: var(--color-white) !important;
}

.nav-link--admin {
  color: var(--color-warning);
}

.nav-link--admin:hover {
  color: var(--color-warning);
  background-color: var(--color-warning-light);
}

.nav-link--logout {
  color: var(--color-danger);
}

.nav-link--logout:hover {
  color: var(--color-danger);
  background-color: var(--color-danger-light);
}


/* ==========================================================================
   5. Flash Messages
   ========================================================================== */

.flash-messages {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: 100%;
  max-width: 600px;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: flashSlideIn 0.3s ease-out;
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash--success {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid #c8e6c9;
}

.flash--error {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid #f5c6cb;
}

.flash__text {
  flex: 1;
  margin-right: var(--space-3);
}

.flash__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.flash__close:hover {
  opacity: 1;
}


/* ==========================================================================
   6. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-user-select: none;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.08);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  filter: brightness(0.92);
  transform: scale(0.98);
  box-shadow: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
  filter: none;
}

/* Primary — Apple vibrant green */
.btn--primary,
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover,
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
}

/* Secondary */
.btn--secondary,
.btn-secondary {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-white);
}

.btn--secondary:hover,
.btn-secondary:hover {
  background-color: var(--color-secondary-light);
  border-color: var(--color-secondary-light);
  color: var(--color-white);
}

/* Outline */
.btn--outline,
.btn-outline-primary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--outline:hover,
.btn-outline-primary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Outline Light (for dark backgrounds) */
.btn--outline-light {
  background-color: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}

.btn--outline-light:hover {
  background-color: var(--color-white);
  color: var(--color-primary);
}

/* Additional outline variants (Bootstrap-compatible) */
.btn-outline-secondary {
  background-color: transparent;
  border-color: var(--color-text-light);
  color: var(--color-text-light);
}

.btn-outline-secondary:hover {
  background-color: var(--color-text-light);
  color: var(--color-white);
}

.btn-outline-success {
  background-color: transparent;
  border-color: var(--color-success);
  color: var(--color-success);
}

.btn-outline-success:hover {
  background-color: var(--color-success);
  color: var(--color-white);
}

.btn-outline-info {
  background-color: transparent;
  border-color: var(--color-info);
  color: var(--color-info);
}

.btn-outline-info:hover {
  background-color: var(--color-info);
  color: var(--color-white);
}

.btn-outline-warning {
  background-color: transparent;
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.btn-outline-warning:hover {
  background-color: var(--color-warning);
  color: var(--color-white);
}

.btn-outline-danger {
  background-color: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-outline-danger:hover {
  background-color: var(--color-danger);
  color: var(--color-white);
}

.btn-outline-dark {
  background-color: transparent;
  border-color: var(--color-text);
  color: var(--color-text);
}

.btn-outline-dark:hover {
  background-color: var(--color-text);
  color: var(--color-white);
}

/* Sizes */
.btn--lg,
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
}

.btn--sm,
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: var(--space-2);
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}


/* ==========================================================================
   7. Cards
   ========================================================================== */

.card {
  background-color: var(--color-white);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  background-color: var(--color-bg-warm);
}

.card-header h4 {
  margin-bottom: 0;
}

.card-body {
  padding: var(--space-4);
}

.card-body p:last-child {
  margin-bottom: 0;
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
  background-color: var(--color-bg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-2);
}

/* Card border color variants */
.border-primary { border-color: var(--color-primary) !important; }
.border-success { border-color: var(--color-success) !important; }
.border-warning { border-color: var(--color-warning) !important; }
.border-info { border-color: var(--color-info) !important; }
.border-secondary { border-color: var(--color-text-light) !important; }

/* Shadow variant */
.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

/* Stat Card */
.stat-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ==========================================================================
   8. Forms
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b6b6b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-label {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  cursor: pointer;
}

.form-text {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.form-error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-danger);
  font-weight: 500;
}

/* Validation states */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--color-danger);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--color-success);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.15);
}

/* Input group */
.input-group {
  display: flex;
  width: 100%;
}

.input-group .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  white-space: nowrap;
}


/* ==========================================================================
   9. Tables
   ========================================================================== */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-3);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background-color: var(--color-bg-alt);
}

.table th {
  padding: var(--space-3) var(--space-3);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
  color: var(--color-text);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Striped */
.table--striped tbody tr:nth-child(even),
.table-striped tbody tr:nth-child(even) {
  background-color: var(--color-bg);
}

/* Hover */
.table--hover tbody tr:hover,
.table-hover tbody tr:hover {
  background-color: var(--color-bg-alt);
  transition: background-color var(--transition-fast);
}

.table a {
  font-weight: 500;
}


/* ==========================================================================
   10. Badges & Labels
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.6em;
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Color variants */
.badge-primary,
.bg-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.badge-success,
.bg-success {
  background-color: var(--color-success);
  color: var(--color-white);
}

.badge-warning,
.bg-warning {
  background-color: var(--color-warning);
  color: var(--color-white);
}

.badge-danger,
.bg-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
}

.badge-info,
.bg-info {
  background-color: var(--color-info);
  color: var(--color-white);
}

.bg-secondary {
  background-color: var(--color-text-light);
  color: var(--color-white);
}

/* Status badges */
.badge-open {
  background-color: var(--color-info-light);
  color: var(--color-info);
  border: 1px solid #b6d4ea;
}

.badge-progress {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid #f7dc6f;
}

.badge-completed {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid #a9dfbf;
}

.badge-cancelled {
  background-color: #f5f5f5;
  color: var(--color-text-muted);
  border: 1px solid #ddd;
}

.badge-draft {
  background-color: #f0f0f0;
  color: var(--color-text-light);
  border: 1px solid #d5d5d5;
}

.badge-published {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid #a9dfbf;
}

.badge-pending {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid #f7dc6f;
}

.badge-failed {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid #f5c6cb;
}

.badge-refunded {
  background-color: #f0e6ff;
  color: #6c3483;
  border: 1px solid #d2b4de;
}

/* Priority badges */
.badge-low {
  background-color: var(--color-info-light);
  color: var(--color-info);
  border: 1px solid #b6d4ea;
}

.badge-medium {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid #f7dc6f;
}

.badge-high {
  background-color: #fde8e2;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

.badge-urgent {
  background-color: var(--color-danger);
  color: var(--color-white);
}

/* Rounded pill variant */
.rounded-pill {
  border-radius: var(--radius-pill) !important;
}


/* ==========================================================================
   11. Alerts
   ========================================================================== */

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border-color: #c8e6c9;
}

.alert-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-color: #f5c6cb;
}

.alert-info {
  background-color: var(--color-info-light);
  color: var(--color-info);
  border-color: #b6d4ea;
}

.alert-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border-color: #f7dc6f;
}


/* ==========================================================================
   12. List Groups
   ========================================================================== */

.list-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding-left: 0;
  border-radius: var(--radius);
  overflow: hidden;
  list-style: none;
}

.list-group-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-bottom: none;
  text-decoration: none;
}

.list-group-item:first-child {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.list-group-item:last-child {
  border-bottom: 1px solid var(--color-border-light);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.list-group-item h6 {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.list-group-item-action {
  transition: background-color var(--transition-fast);
}

.list-group-item-action:hover {
  background-color: var(--color-bg-alt);
  text-decoration: none;
  color: var(--color-text);
}


/* ==========================================================================
   13. Homepage - Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-secondary) 100%);
  overflow: hidden;
  margin-top: calc(-1 * var(--nav-height));
  padding-top: var(--nav-height);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: var(--space-6) var(--space-4);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-5xl);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-4);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--font-size-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-6);
  font-weight: 300;
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}


/* ==========================================================================
   14. Homepage - Mission
   ========================================================================== */

.section--mission {
  background-color: var(--color-white);
}

.mission__grid {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.mission__text {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

.mission__text p {
  margin-bottom: var(--space-4);
}


/* ==========================================================================
   15. Homepage - Four Pillars
   ========================================================================== */

.section--pillars {
  background-color: var(--color-bg-alt);
}

.pillars__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.pillar-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--color-border-light);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pillar-card__number {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-secondary);
  opacity: 0.3;
  margin-bottom: var(--space-3);
}

.pillar-card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.pillar-card__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}


/* ==========================================================================
   16. Homepage - Founder Quote
   ========================================================================== */

.section--quote {
  background-color: var(--color-white);
}

.founder-quote {
  max-width: var(--container-narrow);
  margin: 0 auto;
  text-align: center;
  padding: var(--space-6) var(--space-5);
  border-left: none;
  background: none;
  border-radius: 0;
}

.founder-quote__text {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--color-primary-dark);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

.founder-quote__attribution {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.founder-quote__attribution cite {
  font-style: normal;
}


/* ==========================================================================
   17. Homepage - History
   ========================================================================== */

.section--history {
  background-color: var(--color-bg-alt);
}

.history__content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.history__content p {
  margin-bottom: var(--space-4);
}


/* ==========================================================================
   18. Homepage - Events
   ========================================================================== */

.section--events {
  background-color: var(--color-white);
}

.events__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.event-card {
  display: flex;
  gap: var(--space-4);
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.event-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.event-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-primary);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.event-card__month {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.event-card__day {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
}

.event-card__info {
  flex: 1;
  min-width: 0;
}

.event-card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

.event-card__title a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.event-card__title a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.event-card__location {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.event-card__description {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-base);
}


/* ==========================================================================
   19. Homepage - CTA
   ========================================================================== */

.section--cta {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-secondary-dark) 100%);
  padding: var(--space-8) 0;
}

.cta__content {
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

.cta__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.cta__text {
  font-size: var(--font-size-md);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-6);
  line-height: var(--line-height-relaxed);
}

.cta__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}


/* ==========================================================================
   20. Page Hero (Subpages)
   ========================================================================== */

.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  padding: var(--space-8) 0 var(--space-7);
  text-align: center;
}

.page-hero__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.page-hero__subtitle {
  font-size: var(--font-size-lg);
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
}


/* ==========================================================================
   21. Volunteer Page
   ========================================================================== */

.volunteer__intro {
  max-width: var(--container-narrow);
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.opportunities__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.opportunity-card {
  background-color: var(--color-white);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.opportunity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.opportunity-card__icon {
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
}

.opportunity-card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.opportunity-card__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

/* Benefits */
.benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.benefit {
  text-align: center;
}

.benefit__icon {
  color: var(--color-secondary);
  margin-bottom: var(--space-3);
}

.benefit__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.benefit__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

/* Apply Steps */
.apply__steps {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.apply__step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.apply__step:last-child {
  border-bottom: none;
}

.apply__step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.apply__step-content h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.apply__step-content p {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}


/* ==========================================================================
   22. Text Helpers
   ========================================================================== */

.text--lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  font-weight: 400;
}


/* ==========================================================================
   23. Footer
   ========================================================================== */

.footer {
  background-color: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-8) 0 var(--space-5);
  margin-top: auto;
}

.footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

.footer__brand {
  max-width: 350px;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.footer__logo .logo-text {
  color: var(--color-white);
}

.footer__logo:hover {
  text-decoration: none;
}

.footer__tagline {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: var(--line-height-relaxed);
}

.footer__heading {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__links li {
  margin-bottom: var(--space-2);
}

.footer__links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__links a:hover {
  color: var(--color-white);
  text-decoration: none;
}

.footer__icon {
  flex-shrink: 0;
  opacity: 0.8;
}

.footer__legal {
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer__org {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-1);
}

.footer__tax {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--space-2);
}

.footer__copyright {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.4);
}


/* ==========================================================================
   24. Dashboard
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
}

.dashboard-section {
  margin-bottom: var(--space-5);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* Display number styling (used in dashboard stat cards) */
.display-6 {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1.2;
}


/* ==========================================================================
   25. Admin
   ========================================================================== */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.admin-header h1 {
  margin-bottom: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.filters .form-group {
  margin-bottom: 0;
}


/* ==========================================================================
   26. Pagination
   ========================================================================== */

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.pagination.justify-content-center {
  justify-content: center;
}

.page-item {
  list-style: none;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-primary);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-link:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* ==========================================================================
   27. Utility Classes - Text
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--color-text-muted) !important; }

.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }
.text-secondary { color: var(--color-text-light) !important; }

.fs-1 { font-size: var(--font-size-3xl); }
.fs-2 { font-size: var(--font-size-2xl); }
.fs-3 { font-size: var(--font-size-xl); }
.fs-4 { font-size: var(--font-size-lg); }
.fs-5 { font-size: var(--font-size-md); }
.fs-6 { font-size: var(--font-size-sm); }


/* ==========================================================================
   28. Utility Classes - Spacing
   ========================================================================== */

/* Margins - top */
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }

/* Margins - bottom */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }

/* Margins - end (right in LTR) */
.me-1 { margin-right: var(--space-1) !important; }
.me-2 { margin-right: var(--space-2) !important; }

/* Margins - start (left in LTR) */
.ms-1 { margin-left: var(--space-1) !important; }
.ms-2 { margin-left: var(--space-2) !important; }

/* Padding - all sides */
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }

/* Padding - vertical */
.py-1 { padding-top: var(--space-1) !important; padding-bottom: var(--space-1) !important; }
.py-2 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }
.py-3 { padding-top: var(--space-3) !important; padding-bottom: var(--space-3) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

/* Padding - horizontal */
.px-1 { padding-left: var(--space-1) !important; padding-right: var(--space-1) !important; }
.px-2 { padding-left: var(--space-2) !important; padding-right: var(--space-2) !important; }
.px-3 { padding-left: var(--space-3) !important; padding-right: var(--space-3) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }


/* ==========================================================================
   29. Utility Classes - Flexbox
   ========================================================================== */

.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-grid { display: grid !important; }
.d-none { display: none !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; }

.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }

.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }


/* ==========================================================================
   30. Utility Classes - Sizing & Misc
   ========================================================================== */

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.border { border: 1px solid var(--color-border-light) !important; }
.border-0 { border: 0 !important; }
.rounded { border-radius: var(--radius) !important; }

.overflow-hidden { overflow: hidden !important; }


/* ==========================================================================
   31. Auth Pages (Login, Register, etc.)
   ========================================================================== */

.row.justify-content-center {
  justify-content: center;
}

/* Ensure auth cards have nice styling */
.container.mt-5 .card {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}


/* ==========================================================================
   32. Mobile Navigation
   ========================================================================== */

@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
    /* Touch target — Apple HIG / WCAG 2.5.5 minimum is 44x44. */
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    /* Ensure the toggle sits above any hero-card decoration that might
       otherwise capture the tap on narrow viewports. */
    position: relative;
    z-index: 1001;
  }

  /* Animate the three lines into an X when the menu is open so users get
     unmistakable visual feedback that the click registered. */
  .nav-toggle.active .hamburger:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    /* Belt-and-suspenders width so a bad inset doesn't leave the panel
       a sliver wide on iOS Safari with the dynamic toolbar. */
    width: 100vw;
    /* Use small-viewport units when supported so the panel doesn't get
       clipped by mobile Safari's bottom URL bar. */
    height: calc(100vh - var(--nav-height));
    height: calc(100svh - var(--nav-height));
    background-color: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    gap: var(--space-2);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    /* Heavier shadow + top border so the open panel reads as a distinct
       surface, not the page background. */
    box-shadow: -8px 0 30px rgba(26, 26, 46, 0.18);
    border-top: 1px solid rgba(26, 26, 46, 0.06);
    z-index: 1000;
    /* Hide from screen readers + tab order while collapsed. */
    visibility: hidden;
  }

  .nav-menu.active {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-link {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    border-radius: var(--radius);
  }

  .nav-link--cta {
    text-align: center;
    margin-top: var(--space-2);
  }

  /* Lock the page behind the open menu so iOS doesn't scroll-bleed. */
  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }
}


/* ==========================================================================
   33. Responsive Design
   ========================================================================== */

/* ---- Small phones (up to 480px) ---- */
@media (max-width: 480px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --font-size-5xl: 2.25rem;
  }

  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .hero {
    min-height: 70vh;
  }

  .hero__title {
    font-size: var(--font-size-3xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-md);
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 280px;
  }

  .pillars__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .events__grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-card__date {
    flex-direction: row;
    gap: var(--space-2);
    width: auto;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .opportunities__grid {
    grid-template-columns: 1fr;
  }

  .benefits__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .cta__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta__actions .btn {
    width: 100%;
    max-width: 280px;
  }

  .page-hero {
    padding: var(--space-6) 0 var(--space-5);
  }

  .page-hero__title {
    font-size: var(--font-size-2xl);
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .apply__step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ---- Tablets (481px to 768px) ---- */
@media (min-width: 481px) and (max-width: 768px) {
  .pillars__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .events__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .footer__brand {
    grid-column: span 2;
  }

  .benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__title {
    font-size: var(--font-size-3xl);
  }
}

/* ---- Small tablets / large phones (up to 768px) ---- */
@media (max-width: 768px) {
  section,
  .section {
    padding: var(--space-6) 0;
  }

  .section__title {
    font-size: var(--font-size-2xl);
  }

  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Tables scroll on mobile */
  .table-responsive {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
  }

  .table {
    min-width: 600px;
  }
}

/* ---- Tablets to small desktops (769px to 1024px) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  .pillars__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

/* ---- Large screens (1200px+) ---- */
@media (min-width: 1200px) {
  .container {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }
}


/* ==========================================================================
   34. Animations & Transitions
   ========================================================================== */

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Smooth hover transitions for all interactive elements */
a,
button,
.btn,
.card,
.nav-link,
.page-link,
.list-group-item-action {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 250ms;
  transition-timing-function: ease;
}


/* ==========================================================================
   35. Print Styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .navbar,
  .nav-toggle,
  .flash-messages,
  .footer,
  .btn,
  .hero__actions,
  .cta__actions,
  .section--cta,
  .pagination,
  .filters {
    display: none !important;
  }

  .main-content {
    padding-top: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
  }

  .nav-link::after,
  .btn::after,
  .footer a::after {
    content: none !important;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  table, img, figure {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero__title {
    color: #000 !important;
    font-size: 24pt;
  }

  .hero__subtitle {
    color: #333 !important;
  }

  .table {
    border-collapse: collapse;
  }

  .table th,
  .table td {
    border: 1px solid #ccc;
  }

  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .badge {
    border: 1px solid #ccc;
    padding: 0.1em 0.4em;
  }

  @page {
    margin: 2cm;
  }
}


/* ==========================================================================
   36. Scrollbar Styling (WebKit)
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}


/* ==========================================================================
   37. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   38. Missing Classes — Dashboard, Admin, Forms
   ========================================================================== */

/* Dashboard welcome */
.dashboard-welcome { margin-bottom: var(--space-xl, 32px); }
.dashboard-welcome__roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Stat card variants */
.stat-card--success { border-left: 4px solid var(--color-success, #16a34a); }
.stat-card--warning { border-left: 4px solid var(--color-warning, #ca8a04); }
.stat-card--info { border-left: 4px solid var(--color-info, #2563eb); }

/* Admin toolbar (filter bar) */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md, 16px);
  align-items: flex-end;
  margin-bottom: var(--space-lg, 24px);
  padding: var(--space-md, 16px);
  background: var(--color-background, #fafaf7);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md, 16px);
  align-items: flex-end;
}

/* Section header for admin */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg, 24px);
}

.dashboard-section { margin-bottom: var(--space-xl, 32px); }
.dashboard-section-header { margin-bottom: var(--space-md, 16px); }
.dashboard-section-body { }

/* Dashboard empty state */
.dashboard-empty,
.empty-state {
  text-align: center;
  padding: var(--space-xl, 32px);
  color: var(--color-text-light, #6b7280);
}

/* Page container (form pages) */
.page-container { max-width: 1200px; margin: 0 auto; padding: var(--space-lg, 24px); }

/* Form page layout */
.form-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg, 24px);
}
.form-page__header { margin-bottom: var(--space-xl, 32px); }
.form-page__title { font-family: var(--font-heading); }
.form-page__subtitle { color: var(--color-text-light, #6b7280); margin-top: 4px; }

/* Form elements (BEM variant for agent-generated views) */
.form__group { margin-bottom: var(--space-md, 16px); }
.form__label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 0.875rem; }
.form__input,
.form__textarea,
.form__select { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border, #d1d5db); border-radius: var(--radius-md, 6px); font-size: 1rem; font-family: inherit; transition: border-color 0.2s; }
.form__input:focus,
.form__textarea:focus,
.form__select:focus { outline: none; border-color: var(--color-primary, #6B5BA5); box-shadow: 0 0 0 3px rgba(107, 91, 165, 0.12); }
.form__textarea { resize: vertical; min-height: 80px; }
.form__checkbox { display: flex; align-items: center; gap: 8px; }
.form__checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.form__checkbox-item { display: flex; align-items: center; gap: 6px; }
.form__checkbox-label { font-size: 0.875rem; }
.form__help,
.form__required { font-size: 0.8rem; color: var(--color-text-light, #6b7280); margin-top: 4px; }
.form__required { color: var(--color-error, #dc2626); }
.form__actions { display: flex; gap: 12px; margin-top: var(--space-lg, 24px); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md, 16px); }
.form__skip-link { display: block; text-align: center; margin-top: var(--space-md, 16px); color: var(--color-text-light, #6b7280); }

/* Event meta info (event-edit) */
.event-meta-info { display: flex; gap: var(--space-lg, 24px); margin-bottom: var(--space-lg, 24px); padding: var(--space-md, 16px); background: var(--color-background, #f9fafb); border-radius: var(--radius-md, 8px); }
.event-meta-info__item { }
.event-meta-info__label { font-size: 0.8rem; color: var(--color-text-light, #6b7280); }
.event-meta-info__value { font-weight: 600; font-size: 1.25rem; }

/* Content body */
.content-body { line-height: 1.7; }
.content-body h3 { margin-top: var(--space-lg, 24px); }
.content-body ul, .content-body ol { padding-left: 24px; }

/* Error page */
.error-page { text-align: center; padding: 80px 24px; }
.error-page__code { font-size: 6rem; font-weight: 700; color: var(--color-primary, #6B5BA5); line-height: 1; }
.error-page__title { font-size: 1.5rem; margin-top: 16px; }
.error-page__message { color: var(--color-text-light, #6b7280); margin-top: 8px; max-width: 500px; margin-left: auto; margin-right: auto; }
.error-page__actions { margin-top: var(--space-lg, 24px); }

/* Button variants used in older views */
.btn-link { background: none; border: none; color: var(--color-primary, #6B5BA5); text-decoration: underline; cursor: pointer; padding: 0; }
.btn-link:hover { color: var(--color-primary-dark, #1a3a0d); }
.btn-success { background-color: var(--color-success, #16a34a); color: #fff; border: none; }
.btn-success:hover { background-color: #15803d; }
.btn-warning { background-color: var(--color-warning, #ca8a04); color: #fff; border: none; }
.btn-warning:hover { background-color: #a16207; }
.btn--sm { padding: 6px 12px; font-size: 0.8rem; }

/* Badge extra variants */
.badge-default { background-color: var(--color-text-light, #6b7280); color: #fff; }
.badge-in-progress { background-color: var(--color-info, #2563eb); color: #fff; }

/* Contact page */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl, 32px); }
.contact__info { }
.contact__heading { font-family: var(--font-heading); margin-bottom: var(--space-md, 16px); }
.contact__details { list-style: none; padding: 0; }
.contact__detail { margin-bottom: 12px; }
.contact__form-wrapper { }

/* Char counter */
.char-counter { font-size: 0.75rem; color: var(--color-text-light, #6b7280); text-align: right; margin-top: 4px; }
.char-counter--warning { color: var(--color-warning, #ca8a04); }

/* Password strength */
.password-strength { margin-top: 6px; }
.strength-bar { height: 4px; border-radius: 2px; transition: width 0.3s ease, background-color 0.3s ease; }
.strength-text { font-size: 0.8rem; display: block; margin-top: 2px; }
.password-match { font-size: 0.8rem; display: block; margin-top: 4px; }

/* Pagination nav */
.pagination-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md, 16px);
  margin-top: var(--space-xl, 32px);
  padding: var(--space-md, 16px) 0;
}
.page-link {
  padding: 8px 16px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius-md, 6px);
  color: var(--color-primary, #6B5BA5);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}
.page-link:hover:not(.disabled) { background-color: var(--color-primary, #6B5BA5); color: #fff; }
.page-link.disabled { opacity: 0.4; pointer-events: none; color: var(--color-text-light, #6b7280); }
.page-info { font-size: 0.875rem; color: var(--color-text-light, #6b7280); }

/* Filters row */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md, 16px);
  align-items: flex-end;
}

/* Responsive for form rows */
@media (max-width: 768px) {
  .form__row { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .event-meta-info { flex-direction: column; }
  .filters { flex-direction: column; }
  .form-inline { flex-direction: column; }
}

/* ==========================================================================
   PWA & Mobile-First Optimizations
   ========================================================================== */

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
  .navbar {
    padding-top: env(safe-area-inset-top, 0);
  }
  .footer {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  body {
    -webkit-user-select: none;
    user-select: none;
  }
  /* Allow text selection in content areas */
  .main-content,
  .card,
  input,
  textarea,
  select {
    -webkit-user-select: text;
    user-select: text;
  }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-top)) {
  .navbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .footer__container {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Touch-friendly targets: minimum 44px for all interactive elements */
@media (pointer: coarse) {
  .btn,
  .nav-link,
  .form-control,
  select,
  input[type="checkbox"],
  input[type="radio"],
  .flash__close,
  .pagination a,
  .pagination span,
  .footer__links a,
  .badge,
  .tag {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-link {
    padding: 12px 16px;
  }

  .form-control,
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px 14px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 22px;
    height: 22px;
  }

  .table td,
  .table th {
    padding: 12px 10px;
  }

  /* Larger tap targets for card actions */
  .card__actions .btn {
    padding: 10px 18px;
  }
}

/* Prevent tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth momentum scrolling on iOS */
.table-responsive,
.nav-menu {
  -webkit-overflow-scrolling: touch;
}

/* Mobile table improvements */
@media (max-width: 640px) {
  /* Stack tables on very small screens */
  .table--stackable thead {
    display: none;
  }
  .table--stackable tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem;
  }
  .table--stackable tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid var(--color-border-light);
  }
  .table--stackable tbody td:last-child {
    border-bottom: none;
  }
  .table--stackable tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text);
    margin-right: 1rem;
    flex-shrink: 0;
  }

  /* Full-width buttons on small screens */
  .btn-group--mobile .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Stat cards stack on mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card__number {
    font-size: 1.5rem;
  }

  /* Dashboard sections */
  .dashboard-section {
    padding: 1rem;
  }
}

/* Ultra-small screens (320px) */
@media (max-width: 360px) {
  :root {
    --space-sm: 0.375rem;
    --space-md: 0.75rem;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero__buttons .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Pull-to-refresh visual indicator for PWA */
@media (display-mode: standalone) {
  body::before {
    content: '';
    display: block;
    height: 0;
    transition: height 0.3s ease;
  }
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .nav-toggle,
  .flash-messages,
  .btn,
  form {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 12pt;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state__icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.empty-state__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.empty-state__text {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg,
    var(--color-border-light) 25%,
    var(--color-bg) 50%,
    var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ==========================================================================
   Page Transition Animation
   ========================================================================== */

.main-content {
  animation: pageIn 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Enhanced Card Interactions
   ========================================================================== */

.card {
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

a.card:hover,
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Search Modal
   ========================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: fadeIn 0.15s ease;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  width: 90%;
  max-width: 600px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideDown 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-box__input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-size: 17px;
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text);
}

.search-box__results {
  max-height: 60vh;
  overflow-y: auto;
  border-top: 1px solid var(--color-border-light);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.15s;
}

.search-result:hover {
  background: var(--color-neutral-light);
}

.search-result__type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  min-width: 60px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

/* Skip-to-content link — visually hidden until it gains keyboard focus,
   then slides into view at the top-left of the viewport. WCAG 2.1 AA
   bypass-blocks technique (G1). */
.skip-link {
  position: absolute;
  left: 0;
  top: -48px;
  z-index: 10000;
  background: var(--color-primary, #6B5BA5);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Make focus clearly visible on the main content region when the skip
   link is used — tabindex=-1 makes it focusable only programmatically. */
#main-content:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   Dark Mode — Apple adaptive colors (iOS 18 / macOS Sequoia)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    /* iTribe brand purple, desaturated slightly for dark mode contrast */
    --color-primary: #9E8DD9;
    --color-primary-light: #2A2545;
    --color-primary-dark: #6B5BA5;
    --color-secondary: #B8ACE3;
    --color-secondary-light: #332D4F;
    --color-secondary-dark: #6B5BA5;

    --color-bg: #000000;
    --color-bg-alt: #1C1C1E;
    --color-bg-warm: #1C1C1E;
    --color-white: #1C1C1E;
    --color-text: #F5F5F7;
    --color-text-light: #D1D1D6;
    --color-text-muted: #8E8E93;
    --color-text-secondary: #8E8E93;
    --color-text-primary: #F5F5F7;
    --color-border: #38383A;
    --color-border-light: #2C2C2E;
    --color-neutral-light: #2C2C2E;

    --color-success: #30D158;
    --color-success-light: #1a3a23;
    --color-danger: #FF453A;
    --color-danger-light: #3a1a19;
    --color-warning: #FF9F0A;
    --color-warning-light: #3a2e10;
    --color-info: #0A84FF;
    --color-info-light: #0d2845;

    --shadow-xs: 0 0.5px 1px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 14px 42px rgba(0, 0, 0, 0.5);
  }

  body {
    color-scheme: dark;
  }

  /* Translucent navbar / sidebar in dark mode */
  .navbar {
    background-color: rgba(28, 28, 30, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .sidebar {
    background: rgba(28, 28, 30, 0.88);
    border-right-color: rgba(255, 255, 255, 0.08);
  }

  .sidebar__link.active {
    background: rgba(48, 209, 88, 0.2);
  }

  /* Cards in dark mode */
  .card {
    background-color: var(--color-bg-alt);
    border-color: var(--color-border);
  }

  /* Form inputs */
  .form-control, .form-select, input, textarea, select {
    background-color: #2C2C2E;
    color: var(--color-text);
    border-color: #48484A;
  }

  .form-control:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
  }

  /* Alerts */
  .alert-success {
    background-color: var(--color-success-light);
    color: var(--color-success);
    border-color: rgba(48, 209, 88, 0.2);
  }

  .alert-danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    border-color: rgba(255, 69, 58, 0.2);
  }

  .alert-info {
    background-color: var(--color-info-light);
    color: var(--color-info);
    border-color: rgba(10, 132, 255, 0.2);
  }

  .alert-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
    border-color: rgba(255, 159, 10, 0.2);
  }

  /* Badges */
  .badge.bg-light {
    background-color: #2C2C2E !important;
    color: var(--color-text) !important;
  }

  .badge.bg-secondary {
    background-color: #636366 !important;
  }

  /* Tables */
  .table, table {
    color: var(--color-text);
  }

  .table thead th, table thead th {
    border-bottom-color: var(--color-border);
  }

  .table td, .table th, table td, table th {
    border-color: var(--color-border);
  }

  /* Stat cards / grouped backgrounds */
  .stat-card, .bg-light {
    background-color: var(--color-bg-alt) !important;
  }

  /* Selection */
  ::selection {
    background-color: var(--color-secondary);
    color: #FFFFFF;
  }

  /* Images maintain visibility */
  img {
    opacity: 0.92;
  }

  img:hover {
    opacity: 1;
  }

  /* Footer */
  .footer {
    background-color: #1C1C1E;
    border-top-color: var(--color-border);
  }

  /* Dropdown / post menus */
  .post-menu, .dropdown-menu {
    background-color: #2C2C2E;
    border-color: var(--color-border);
  }
}

/* ───── Sidebar ───── */
.layout-with-sidebar {
  display: flex;
  min-height: calc(100vh - 0px);
}

.sidebar {
  width: 240px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.5rem;
}

.sidebar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar__avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-primary);
}

.sidebar__link--logout {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--color-danger);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.75rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar__link:hover {
  background: var(--color-neutral-light, #f5f5f5);
  color: var(--color-text-primary);
}

.sidebar__link.active {
  background: rgba(107, 91, 165, 0.16);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar__divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 1rem;
}

.layout-with-sidebar .main-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 1000;
    transition: left var(--transition-base);
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .layout-with-sidebar {
    display: block;
  }
}

/* ───── Post / Social Feed cards ───── */
.post-menu {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   RTL (Right-to-Left) Support — Hebrew, Arabic
   ═══════════════════════════════════════════════════ */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Navigation */
[dir="rtl"] .nav-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-toggle {
  order: -1;
}

/* Sidebar */
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--color-separator);
}

[dir="rtl"] .layout-with-sidebar {
  flex-direction: row-reverse;
}

[dir="rtl"] .sidebar__link {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .sidebar__header {
  flex-direction: row-reverse;
  text-align: right;
}

/* Cards and content */
[dir="rtl"] .card__header,
[dir="rtl"] .post-card__header {
  flex-direction: row-reverse;
}

[dir="rtl"] .card__actions,
[dir="rtl"] .post-card__actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .post-card__meta {
  flex-direction: row-reverse;
}

/* Forms */
[dir="rtl"] .form-group label {
  text-align: right;
}

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

/* Buttons with icons */
[dir="rtl"] .btn-icon-left {
  flex-direction: row-reverse;
}

/* Margins and paddings that need mirroring */
[dir="rtl"] .ml-1, [dir="rtl"] .ml-2, [dir="rtl"] .ml-3 {
  margin-left: 0;
}

[dir="rtl"] .mr-1, [dir="rtl"] .mr-2, [dir="rtl"] .mr-3 {
  margin-right: 0;
}

/* Stats and badges inline */
[dir="rtl"] .stat-group,
[dir="rtl"] .badge-group,
[dir="rtl"] .tag-group {
  flex-direction: row-reverse;
}

/* Footer */
[dir="rtl"] .footer__grid {
  direction: rtl;
}

/* Flash messages */
[dir="rtl"] .flash {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .flash__close {
  margin-left: 0;
  margin-right: auto;
}

/* Tables */
[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

/* Lists */
[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

/* Mobile overlay sidebar */
@media (max-width: 768px) {
  [dir="rtl"] .sidebar.open {
    transform: translateX(0);
    left: auto;
    right: 0;
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
}

/* ==========================================================================
   iTribe brand overrides — wordmark, hero card, pill buttons, minimal footer,
   dark-mode toggle, subtle world-map background.
   ========================================================================== */

.brand-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  padding-top: 0.55rem;
}
.brand-logo--center { align-items: center; }
.brand-logo__crown {
  position: absolute;
  top: -0.15rem;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  font-size: 0.9rem;
  color: var(--color-text);
}
.brand-logo--center .brand-logo__crown {
  left: 50%;
}
.brand-logo:not(.brand-logo--center) .brand-logo__crown {
  left: 38%;
}
.brand-logo__name {
  font-family: 'Times New Roman', Georgia, 'SF Pro Display', var(--font-heading);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.brand-logo__i {
  font-style: italic;
  font-weight: 500;
}
.brand-logo__sub {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--color-text);
  margin-top: 0.15rem;
  padding-left: 0.25rem;
}
.brand-logo--center .brand-logo__sub { padding-left: 0; }

/* PNG-asset based logomark used by header + footer.
   Uses the official iTribe Project lockup. Dark mode swaps to the white
   variant via the CSS `content` property on the <img> element. */
.brand-logomark-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logomark-link:hover { text-decoration: none; }
.brand-logomark-link picture { display: inline-flex; }
.brand-logomark {
  display: block;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: -webkit-optimize-contrast;
}
/* Native asset is 677×362 (≈1.87:1). Heights chosen so the logo always
   fits within the smaller end of the requested 250×80 / 300×100 / 400×120
   bounding boxes — nav stays inside ~250×80, footer inside ~300×100. */
.brand-logomark--nav    { height: 42px; max-width: 250px; }
.brand-logomark--footer { height: 64px; max-width: 300px; }
@media (max-width: 768px) {
  .brand-logomark--nav    { height: 36px; }
  .brand-logomark--footer { height: 56px; }
}
@media (max-width: 480px) {
  .brand-logomark--nav    { height: 32px; }
  .brand-logomark--footer { height: 48px; }
}
/* Dark mode: swap the actual image source via CSS. The `content` trick
   replaces the rendered bitmap, which is cleaner than an invert-filter
   that can leave grey edges around antialiased glyphs. */
html.theme-dark .brand-logomark {
  content: url('/images/itribe-logo-white.png');
}

/* Simplified nav link styling to match iTribe */
.nav-link--signin {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.nav-link--signin.active,
.nav-link--signin:hover { color: var(--color-primary); }

/* Donate CTA in the nav — stands out without competing with the brand
   logomark. Pill-shaped, accent-bordered, fills on hover. */
.nav-link--donate {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--color-primary, #b88a3e);
  border-radius: 999px;
  color: var(--color-primary, #b88a3e) !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav-link--donate.active,
.nav-link--donate:hover,
.nav-link--donate:focus {
  background-color: var(--color-primary, #b88a3e);
  color: var(--color-surface, #fff) !important;
  text-decoration: none;
}

.footer__donate {
  font-weight: 600;
}

.navbar .nav-link {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 500;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--transition-fast);
}
.theme-toggle:hover { background: var(--color-primary-light); }

/* Hero: centered card & split layouts used on home */
.hero--itribe {
  min-height: auto;
  background: var(--color-bg);
  color: var(--color-text);
  padding: var(--space-7) var(--space-4);
  position: relative;
  overflow: hidden;
}
.hero--itribe::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 500' opacity='0.5'><path fill='%23DAD4E8' d='M150 120c30-20 80-30 120-10s60 40 110 30 80-40 120-20 50 60 90 70 80-10 110-30 70-20 110 0 50 60 40 90-40 50-80 50-70-20-100-40-70-30-110-10-50 60-100 60-80-40-120-40-80 30-120 20-40-40-70-50-60-30-50-60 20-50 50-60zM100 260c40-20 90-20 130 10s60 50 110 50 80-30 120-20 60 40 100 50 80 10 120 20 60 40 40 70-60 30-100 20-80-30-120-20-70 30-120 20-60-40-100-50-80-20-120-10-40-50-60-80-40-50 0-70 60-10 100-10z'/></svg>");
  background-size: 140% auto;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
  pointer-events: none;
}
.hero--itribe > * { position: relative; }

.hero-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-7) var(--space-6);
  text-align: center;
}
.hero-card__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-4);
}
.hero-card__body {
  color: var(--color-text-light);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-5);
}
.hero-card__note {
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: 500;
  margin: var(--space-5) auto 0;
  max-width: 420px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
  /* Keep the split hero from spawning a horizontal scrollbar when
     browser chrome is narrower than the content — the columns clip
     cleanly instead of pushing the viewport wider. */
  overflow-x: clip;
  min-width: 0;
}
.hero-split > * { min-width: 0; }   /* grid children can shrink */
.hero-split__copy h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-4);
}
.hero-split__copy p {
  color: var(--color-text-light);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-4);
}
.hero-split__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
  max-width: 320px;
}
.hero-split__globe {
  position: relative;
  /* Always a perfect circle — match width to available space but cap at 520
     and force a 1:1 aspect ratio so the globe never distorts into an oval
     on narrow viewports. aspect-ratio supersedes the legacy height hint. */
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  /* Looks-like-a-3D-globe placeholder: layered radial highlights + slow
     rotating conic continents pattern. This is what users see while the
     WebGL canvas is initializing — and what they see permanently if WebGL
     is unavailable. Either way it reads as a planet, not a flat circle. */
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.55), transparent 38%),
    radial-gradient(circle at 70% 70%, rgba(79,61,138,0.22), transparent 55%),
    radial-gradient(circle at 50% 50%, #E8E3F5 0%, #C9BFE8 58%, #6B5BA5 100%);
  box-shadow: 0 30px 70px rgba(79, 61, 138, 0.22),
              inset -22px -22px 50px rgba(45, 30, 80, 0.22),
              inset 18px 18px 38px rgba(255, 255, 255, 0.32);
}

/* Slowly drifting purple "continents" pattern — pure CSS, no GPU. */
.hero-split__globe::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 80px 40px at 38% 32%, rgba(79,61,138,0.32), transparent 60%),
    radial-gradient(ellipse 110px 60px at 62% 48%, rgba(79,61,138,0.28), transparent 60%),
    radial-gradient(ellipse 70px 38px at 44% 68%, rgba(79,61,138,0.30), transparent 60%),
    radial-gradient(ellipse 50px 28px at 28% 56%, rgba(79,61,138,0.22), transparent 60%);
  animation: hero-globe-drift 60s linear infinite;
  opacity: 0.85;
  pointer-events: none;
}
@keyframes hero-globe-drift {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-split__globe::before { animation: none; }
}

.hero-split__globe-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2; /* sit above the CSS placeholder */
}
.hero-split__globe-inner canvas {
  outline: none;
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
}
/* When the live globe canvas is mounted, drop the circular halo + the
   radial-gradient placeholder so the outline ring around the shrunken
   Mapbox canvas disappears. The canvas itself has its own atmosphere. */
.hero-split__globe.is-live {
  box-shadow: none;
  background: transparent;
}
.hero-split__globe.is-live::before { opacity: 0; }

@media (max-width: 768px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-split__actions { max-width: 100%; }
}

/* Landing variant — single-fold hero matching itribe.us. Globe sits
   directly to the left of the sign-up column with no scroll on first
   paint. The body.is-landing lock (added by home.ejs) suppresses page
   overflow and the global footer so the section IS the viewport. */
.hero-split--landing {
  height: calc(100svh - var(--nav-height));
  max-width: 1280px;
  padding: clamp(var(--space-4), 3vw, var(--space-6)) clamp(var(--space-4), 5vw, var(--space-7));
  gap: clamp(var(--space-5), 4vw, var(--space-7));
  /* Globe gets slightly more room than the form so it reads as the
     visual anchor (proportions mirror itribe.us). */
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.hero-split--landing .hero-split__globe {
  /* Cap to whichever of available width / available height is smaller so
     the circle never overflows the locked viewport. */
  width: min(100%, calc(100svh - var(--nav-height) - var(--space-6) * 2));
  max-width: 560px;
}
.hero-split--landing .hero-split__copy { max-width: 460px; }
.hero-split--landing .hero-split__actions {
  margin-top: var(--space-5);
  max-width: 380px;
}
.hero-split--landing .auth-divider { margin: var(--space-3) 0; }

.hero-split__title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
  margin: 0 0 var(--space-3);
}
.hero-split__lead {
  color: var(--color-text-light);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: var(--line-height-relaxed);
  margin: 0;
  max-width: 44ch;
}
.hero-split__note {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin: var(--space-4) 0 0;
  max-width: 44ch;
}

body.is-landing {
  overflow: hidden;
  height: 100svh;
}
body.is-landing .footer { display: none; }
/* Page-in animation translates the main element on mount; with the body
   locked to viewport that produces a brief vertical jitter — drop it. */
body.is-landing .main-content { animation: none; }

@media (max-width: 900px) {
  /* Locked-viewport split breaks down on phones/tablets — release the
     scroll lock and stack globe over copy. */
  body.is-landing { overflow: auto; height: auto; }
  body.is-landing .footer { display: block; }
  .hero-split--landing {
    height: auto;
    grid-template-columns: 1fr;
    padding-top: var(--space-5);
  }
  .hero-split--landing .hero-split__globe {
    width: min(100%, 420px);
    margin: 0 auto;
  }
  .hero-split--landing .hero-split__copy { max-width: 100%; }
  .hero-split--landing .hero-split__actions { max-width: 100%; }
}

/* Pill buttons that match iTribe */
.btn--pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.9rem 1.75rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--font-size-base);
  border: 2px solid var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn--pill:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-1px);
}
.btn--pill-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.9rem 1.75rem;
  background: transparent;
  color: var(--color-primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--font-size-base);
  border: 2px solid var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.btn--pill-outline:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.btn--block { width: 100%; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  margin: var(--space-4) 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.sign-in-prompt {
  color: var(--color-text);
  font-size: var(--font-size-base);
}
.sign-in-prompt a { color: var(--color-primary); text-decoration: none; font-weight: 600; }
.sign-in-prompt a:hover { text-decoration: underline; }

/* Minimal iTribe footer */
.footer--itribe {
  background: var(--color-bg);
  color: var(--color-text);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-6) var(--space-4);
  text-align: center;
}
.footer--itribe .footer__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--container-max);
  margin: 0 auto;
}
.footer--itribe .footer__line {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  margin: 0;
}
.footer--itribe .footer__line a {
  color: var(--color-primary);
  text-decoration: none;
  margin: 0 var(--space-2);
  font-weight: 500;
}
.footer--itribe .footer__line a:hover { text-decoration: underline; }
.footer--itribe .footer__sep { color: var(--color-border); }

/* Dark mode (toggled via .theme-dark on <html>) */
html.theme-dark {
  --color-bg: #0F0E1A;
  --color-bg-alt: #1A1A2E;
  --color-bg-warm: #1A1A2E;
  --color-white: #1A1A2E;
  --color-text: #F0EEF8;
  --color-text-light: #CFC9E0;
  --color-text-muted: #8C8AA0;
  --color-text-secondary: #8C8AA0;
  --color-text-primary: #F0EEF8;
  --color-border: #2B2940;
  --color-border-light: #24223A;
  --color-neutral-light: #1F1E32;
  --color-primary-light: #2B2546;
}
html.theme-dark body { background: var(--color-bg); color: var(--color-text); }
html.theme-dark .hero-card { background: #1F1E32; }

/* Role picker (register) — radio cards */
.role-picker { display: grid; gap: var(--space-3); margin-top: var(--space-2); }
.role-option { display: block; cursor: pointer; position: relative; }
.role-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.role-option__card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.role-option__card strong { color: var(--color-text); font-size: var(--font-size-md); }
.role-option__card span { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.role-option input[type="radio"]:checked + .role-option__card {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.role-option__card:hover { border-color: var(--color-primary); }

/* iTribe form inputs */
.form__group { margin-bottom: var(--space-4); }
.form__label {
  display: block;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}
.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--font-size-md);
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(107, 91, 165, 0.15);
}

/* Consent checkboxes on register page */
.consent-group { display: flex; flex-direction: column; gap: var(--space-3); }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  color: var(--color-text);
}
.consent-check input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}
.consent-check a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.consent-check a:hover { text-decoration: underline; }
