/* ============================================================
   WildGuard Society - Professional Redesign 2025
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

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

/* ---------- CSS Variables ---------- */
:root {
  --primary: #2d6a4f;
  --primary-dark: #1e3a2b;
  --primary-light: #40916c;
  --amber: #E89E54;
  --accent: #E89E54;
  --accent-hover: #D58A45;
  --terracotta: #D47252;
  --flora-green: #2D6A4F;
  --savannah-green: #1E3A2B;
  --charcoal: #121814;
  --dark: #121814;
  --darker: #0b0f0c;
  --light: #f5f5f0;
  --lighter: #ffffff;
  --text: #d4d4d0;

  --max-width: 1200px;
  --header-height: 72px;
  --radius: 8px;
  --radius-lg: 16px;
--shadow: 0 2px 10px rgba(0,0,0,0.1);
--shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;

  --font-body: 'Inter', system-ui, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--darker);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(244, 162, 97, 0.18);
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }

/* Mobile nav UI — checkbox drives a CSS-only hamburger drawer; hidden on desktop */
.menu-hamburger,
.mobile-nav-backdrop,
.mobile-nav-toggle-btn,
.nav-backdrop { display: none; }

/* Hidden checkbox that toggles the mobile drawer via label[for] */
.mobile-nav-toggle {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

/* Lock body scroll while the mobile nav drawer is open */
html.nav-lock, html.nav-lock body { overflow: hidden; }
html:has(#mobile-nav-toggle:checked),
html:has(#mobile-nav-toggle:checked) body { overflow: hidden; }
/* ============================================================
   HEADER ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: rgba(18, 26, 19, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(244, 162, 97, 0.18);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: var(--transition);
}
.site-header.scrolled { 
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(244,162,97,0.2); 
}
.site-header .header-container {
  padding: 1rem 2rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Ensure header children (dropdowns) form their own stacking context
   so they always render above hero typography and slideshow. */
.site-header .user-menu,
.site-header .language-selector,
.site-header .notification-bell-wrap,
.header-actions .user-menu,
.header-actions .language-selector { position: relative; z-index: 2000; }

/* Logo - centered */
.logo { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.logo-img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; border: 2px solid var(--accent); transition: var(--transition); box-shadow: 0 2px 8px rgba(244, 162, 97,0.2); }
.logo:hover .logo-img { transform: rotate(-3deg) scale(1.05); box-shadow: 0 4px 12px rgba(244, 162, 97,0.3); }
.logo-text { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: var(--lighter); white-space: nowrap; 
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Navigation - centered, pill-style */
.desktop-nav { display: flex; align-items: center; gap: 0.35rem; padding: 0.25rem; background: rgba(255,255,255,0.04); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.desktop-nav a {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.1rem;
  color: rgba(255,255,255,0.7); font-size: 0.85rem; font-weight: 500;
  border-radius: 10px; transition: var(--transition); white-space: nowrap;
  position: relative; overflow: hidden;
}
.desktop-nav a::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary), var(--accent)); opacity: 0; transition: opacity 0.3s ease; border-radius: 10px; z-index: -1; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--lighter); }
.desktop-nav a:hover::before, .desktop-nav a.active::before { opacity: 1; }
.desktop-nav a.active i { color: var(--accent); }
.desktop-nav a i { font-size: 0.9em; opacity: 0.85; transition: var(--transition); }
.desktop-nav a:hover i { transform: translateY(-1px); }

/* Auth */
.header-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header-actions .theme-toggle { width: 44px; height: 44px; }
.btn-signin { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; color: var(--lighter); font-size: 0.82rem; font-weight: 500; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(255,255,255,0.03); transition: var(--transition); }
.btn-signin:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); transform: translateY(-1px); }
.btn-signin i { font-size: 1rem; }
.btn-cta { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.2rem; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); color: var(--dark); font-size: 0.82rem; font-weight: 600; border-radius: 10px; transition: var(--transition); box-shadow: 0 2px 8px rgba(244, 162, 97,0.2); }
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(224, 122, 97,0.3); }

/* User Menu */
.user-menu { position: relative; }
.user-menu-toggle { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: var(--lighter); font-size: 0.85rem; cursor: pointer; transition: var(--transition); }
.user-menu-toggle:hover { background: rgba(255,255,255,0.12); }
.user-avatar { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff; font-weight: 700; font-size: 0.95rem; overflow: hidden; border: 2px solid rgba(255,255,255,0.15); box-shadow: 0 2px 6px rgba(200, 100, 50,0.15); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar + i[class*="fa-chevron"] { font-size: 0.7rem; opacity: 0.6; }
.user-dropdown { position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 200px; background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 0.5rem; box-shadow: 0 20px 40px rgba(0,0,0,0.5); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); z-index: 2000; }
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; color: rgba(255,255,255,0.75); font-size: 0.88rem; border-radius: 8px; transition: var(--transition); }
.user-dropdown a:hover { background: rgba(244, 162, 97,0.12); color: var(--lighter); }
.user-dropdown a i { color: var(--accent); width: 20px; text-align: center; font-size: 1rem; }
.dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0.4rem 0; }

/* Notification Bell */
.notification-bell { position: relative; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); font-size: 1rem; cursor: pointer; transition: var(--transition); }
.notification-bell:hover { background: rgba(255,255,255,0.12); color: var(--lighter); }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 0.62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--dark); box-sizing: border-box; }
.notification-panel { position: absolute; top: calc(100% + 0.5rem); right: 0; width: 320px; max-height: 420px; overflow-y: auto; background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); z-index: 2000; }
.notification-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.notification-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); position: sticky; top: 0; background: var(--dark); border-radius: 14px 14px 0 0; }
.notification-header strong { font-size: 0.9rem; color: var(--lighter); }
.notification-mark-read { background: none; border: none; color: var(--accent); font-size: 0.72rem; font-weight: 600; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 6px; transition: var(--transition); }
.notification-mark-read:hover { background: rgba(244, 162, 97,0.12); }
.notification-list { padding: 0.35rem 0; }
.notification-item { display: flex; gap: 0.75rem; padding: 0.7rem 1rem; transition: var(--transition); }
.notification-item:hover { background: rgba(255,255,255,0.03); }
.notification-item.unread { background: rgba(244, 162, 97,0.08); border-left: 3px solid var(--accent); }
.notification-item-icon { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(220, 114, 82,0.15); color: var(--accent); font-size: 0.9rem; }
.notification-item-body { flex: 1; min-width: 0; }
.notification-item-body strong { display: block; font-size: 0.82rem; color: var(--lighter); line-height: 1.35; }
.notification-item-body p { margin: 0.15rem 0 0; font-size: 0.76rem; color: rgba(255,255,255,0.6); line-height: 1.4; }
.notification-item-body time { display: block; margin-top: 0.25rem; font-size: 0.68rem; color: rgba(255,255,255,0.35); }
.notification-empty { padding: 2rem 1.5rem; text-align: center; }
.notification-empty i { font-size: 2rem; color: rgba(255,255,255,0.15); margin-bottom: 0.5rem; }
.notification-empty p { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin: 0; }
.notification-empty span { color: rgba(255,255,255,0.35); font-size: 0.72rem; display: block; margin-top: 0.25rem; }

/* Language Selector - Real Flag Icons */
.language-selector { position: relative; display: flex; align-items: center; gap: 0.35rem; }
.lang-toggle { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; color: var(--lighter); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.lang-toggle:hover { background: rgba(220, 114, 82,0.15); color: var(--lighter); border-color: rgba(200, 100, 50,0.2); }
.lang-toggle .flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; }
.lang-toggle .flag img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }
.lang-toggle .lang-name { display: inline; }
.lang-toggle .chevron { font-size: 0.6rem; transition: transform 0.2s ease; }
.lang-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.lang-dropdown { position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 180px; background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 0.5rem; box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s ease; z-index: 2000; }
.lang-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.65rem 1rem; background: transparent; border: none; border-radius: 8px; color: rgba(255,255,255,0.8); font-size: 0.88rem; font-weight: 500; cursor: pointer; text-align: left; transition: var(--transition); }
.lang-option:hover { background: rgba(244, 162, 97,0.12); color: var(--lighter); }
.lang-option .flag { width: 24px; height: 16px; border-radius: 2px; object-fit: cover; }
.lang-option .flag img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; display: block; }
.lang-option .lang-native { font-weight: 500; }
.lang-option .lang-english { font-size: 0.75rem; opacity: 0.6; }

@media (max-width: 768px) {
  .lang-toggle .lang-name { display: none; }
  .lang-dropdown { right: 0; left: auto; min-width: 160px; }
  .language-selector { padding: 0.15rem; }
  .lang-btn { padding: 0.35rem 0.5rem; font-size: 0.7rem; }
}

/* ============================================================
   MOBILE HEADER — sticky, non-floating bar + hamburger menu
   ============================================================ */
@media (max-width: 768px) {
  .mobile-nav-toggle-btn { display: inline-flex; }

  .site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    transform: none;
    border-radius: 0;
    background: rgba(12, 17, 14, 0.94);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 1620;
  }

  /* Balanced 3-column bar: hamburger · logo (dead centre) · actions */
  .header-container {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .header-container > .mobile-nav-toggle-btn { justify-self: start; }
  .header-container > .logo { justify-self: center; }
  .header-container > .header-actions { justify-self: end; }
  /* The drawer is a fixed overlay — it must not disturb the grid columns */
  .header-container > .desktop-nav { position: fixed; }

  /* Keep the bar controls above the open drawer so the X stays tappable */
  .menu-hamburger,
  .mobile-nav-toggle-btn,
  .logo,
  .header-actions { position: relative; z-index: 1620; }

  .logo { gap: 0.5rem; min-width: 0; flex-shrink: 1; }
  .logo-text { font-size: 1rem; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
  .logo-img { width: 36px; height: 36px; }

  /* Hamburger toggle */
  .mobile-nav-toggle-btn {
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px; min-width: 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--lighter);
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
  }
  .mobile-nav-toggle-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--accent); }
  .mobile-nav-toggle-btn .fa-bars { display: inline-block; }
  .mobile-nav-toggle-btn .fa-times { display: none; }
  #mobile-nav-toggle:checked ~ .site-header .mobile-nav-toggle-btn .fa-bars { display: none; }
  #mobile-nav-toggle:checked ~ .site-header .mobile-nav-toggle-btn .fa-times { display: inline-block; }

  .header-actions { gap: 0.35rem; }
  .theme-toggle { width: 38px; height: 38px; }
  .user-menu-toggle { padding: 0.5rem 0.65rem; font-size: 0.8rem; min-height: 40px; }

  /* Keep the bar airy on mobile: icon-only sign-in, and the language
     picker is relocated into the drawer by main.js (see .mobile-lang-moved) */
  .btn-signin { padding: 0.6rem 0.75rem; font-size: 0; min-height: 40px; }
  .btn-signin i { font-size: 0.95rem; }
  .site-header.mobile-lang-moved .header-actions .language-selector { display: none; }

  /* Header sits in normal flow on mobile — no artificial clearance needed */
  main:not(.portal-main),
  .main-content { padding-top: 0; }
}

/* ============================================================
   MOBILE NAV DRAWER — slides down from the sticky bar
   ============================================================ */
@media (max-width: 768px) {
  .desktop-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1610;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin: 0;
    padding: calc(62px + env(safe-area-inset-top, 0px)) 1rem 1.25rem;
    max-height: 78vh;
    max-height: 82dvh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(14, 20, 16, 0.98), rgba(9, 14, 11, 0.99));
    border: none;
    border-bottom: 1px solid rgba(244, 162, 97, 0.22);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  }
  .desktop-nav a {
    padding: 0.9rem 1rem;
    min-height: 50px;
    font-size: 1.02rem;
    border-radius: 12px;
    white-space: normal;
  }
  .desktop-nav a i { font-size: 1.05em; }
  .desktop-nav a.active { color: var(--lighter); }
  .desktop-nav a.active::before { opacity: 1; }

  /* Language picker sits at the bottom of the drawer on mobile */
  .desktop-nav .language-selector { width: 100%; }
  .desktop-nav .lang-toggle {
    width: 100%;
    justify-content: flex-start;
    min-height: 50px;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.03);
  }
  .desktop-nav .lang-toggle:hover { background: rgba(244, 162, 97, 0.12); }
  .desktop-nav .lang-dropdown {
    position: static;
    min-width: 100%;
    margin-top: 0.35rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.04);
  }
  .desktop-nav .lang-option { font-size: 0.95rem; }

  #mobile-nav-toggle:checked ~ .site-header .desktop-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Dimmed scrim behind the drawer (it is a <label for> the checkbox, so
     tapping it also closes the menu) */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
  }
  #mobile-nav-toggle:checked ~ .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================================ SLIDESHOW ============================================================ */
.page-slideshow { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.page-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 2.5s ease-in-out; }
.page-slide.active { opacity: 1; }
.page-slideshow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.65) 100%); z-index: 1; }

/* ============================================================ HERO ============================================================ */
.hero { position: relative; min-height: calc(100vh - var(--header-height)); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--lighter); padding: 4rem 2rem 2rem; overflow: hidden; }
.hero-content { position: relative; z-index: 2; max-width: 800px; animation: fadeInUp 1.2s ease-out; }
.hero-content h1 { font-family: var(--font-heading); font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700; color: var(--lighter); margin-bottom: 1.2rem; text-shadow: 0 2px 20px rgba(0,0,0,0.5); line-height: 1.15; }
.hero-content p { font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; opacity: 0.88; line-height: 1.75; font-weight: 300; }
.cta-button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 1rem 2.2rem; background: var(--accent); color: var(--dark); font-size: 0.98rem; font-weight: 600; border-radius: var(--radius); transition: var(--transition); box-shadow: 0 2px 10px rgba(232, 158, 84,0.25); }
.cta-button:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(221, 135, 78,0.35); }

/* ============================================================ SECTIONS ============================================================ */
section { padding: 5rem 0; position: relative; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { color: var(--lighter); margin-bottom: 0.8rem; display: inline-block; position: relative; }
.section-header h2::after { content: ''; position: absolute; left: 50%; bottom: -0.6rem; transform: translateX(-50%); width: 48px; height: 3px; background: var(--accent); border-radius: 2px; }
.section-header p { color: rgba(255,255,255,0.65); max-width: 560px; margin: 1.2rem auto 0; font-size: 1.05rem; }
.content-overlay { background: rgba(8, 18, 12, 0.86); backdrop-filter: blur(6px); }

/* ============================================================ CARDS ============================================================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); backdrop-filter: blur(4px); }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(255,255,255,0.18); }
.card-image { aspect-ratio: 16/9; overflow: hidden; background: rgba(255,255,255,0.04); }
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.3s ease; }
.card:hover .card-image img { transform: scale(1.03); }
.card-body { padding: 1.5rem; }
.card-body h3 { color: var(--lighter); margin-bottom: 0.5rem; font-size: 1.15rem; }
.card-body p { color: rgba(255,255,255,0.68); font-size: 0.92rem; line-height: 1.6; }

/* ============================================================ FORMS ============================================================ */
.form-container { max-width: 600px; margin: 0 auto; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg); padding: 2.5rem; backdrop-filter: blur(10px); }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.4rem; color: rgba(255,255,255,0.85); font-size: 0.88rem; font-weight: 500; }
.form-input, .form-textarea { width: 100%; padding: 0.85rem 1rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); color: var(--lighter); font-size: 1rem; transition: var(--transition); }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244, 162, 97,0.12); }
.form-textarea { min-height: 140px; resize: vertical; }

/* Select dropdowns - force visible list on dark backgrounds across all pages */
select,
select.form-input,
select.form-select,
.form-select,
#statusFilter,
#scanStatusFilter,
#emailType,
#conservation-status,
#category,
.filter-select select,
.portal-field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: #141c16 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c9a227' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 12px 8px;
  padding-right: 2.5rem;
  color: #ffffff !important;
}
select option,
.form-select option,
.filter-select select option {
  background-color: #141c16 !important;
  color: #ffffff !important;
  padding: 0.5rem;
}
.btn-submit { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.8rem; background: var(--accent); color: var(--dark); font-size: 0.95rem; font-weight: 600; border: none; border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.btn-submit:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ============================================================ ADMIN PORTAL ============================================================ */
.portal-root { min-height: 100vh; background: var(--darker); color: var(--lighter); }
.portal-root * { box-sizing: border-box; }
.portal-header { position: sticky; top: 0; z-index: 100; background: rgba(10,21,16,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.06); padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.portal-header-logo { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.portal-header-logo img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--accent); }
.portal-header-actions { display: flex; align-items: center; gap: 1rem; }
.portal-header-actions span { font-size: 0.85rem; opacity: 0.7; }
.portal-header-actions button { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #ef4444; padding: 0.45rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: 0.8rem; transition: var(--transition); }
.portal-header-actions button:hover { background: rgba(239,68,68,0.2); }
.portal-layout { display: flex; min-height: calc(100vh - 64px); }
.portal-sidebar { width: 260px; background: rgba(10,21,16,0.9); border-right: 1px solid rgba(255,255,255,0.06); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex-shrink: 0; }
.portal-nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border-radius: 10px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: var(--transition); cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.portal-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--lighter); }
.portal-nav-item.active { background: rgba(244, 162, 97,0.1); color: var(--accent); border: 1px solid rgba(244, 162, 97,0.2); }
.portal-nav-item i { width: 20px; text-align: center; }
.portal-main { flex: 1; padding: 2rem; overflow-y: auto; }
.portal-section h2 { font-family: var(--font-heading); margin-bottom: 1.5rem; font-size: 1.5rem; }
.portal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.portal-stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 1.25rem; text-align: center; }
.portal-stat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.portal-stat-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.25rem; }
.portal-stat-label { font-size: 0.8rem; opacity: 0.6; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.portal-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 1.5rem; }
.portal-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.portal-card-header h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.portal-badge { padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.portal-list-item { padding: 0.75rem; background: rgba(255,255,255,0.02); border-radius: 8px; margin-bottom: 0.5rem; }
.portal-list-title { font-weight: 500; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-list-meta { font-size: 0.78rem; opacity: 0.5; margin-top: 3px; }
.portal-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.2rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; }
.portal-btn-primary { background: linear-gradient(135deg, #2d6a4f, #1e3a2b); color: #fff; }
.portal-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,106,79,0.4); }
.portal-btn-approve { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #22c55e; }
.portal-btn-approve:hover { background: rgba(34,197,94,0.2); }
.portal-btn-reject { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #ef4444; }
.portal-btn-reject:hover { background: rgba(239,68,68,0.2); }
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.5; border-bottom: 1px solid rgba(255,255,255,0.06); }
.portal-table td { padding: 0.85rem 1rem; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.portal-table tr:hover td { background: rgba(255,255,255,0.02); }
.portal-empty { opacity: 0.5; font-size: 0.85rem; text-align: center; padding: 2rem; }
.portal-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.portal-modal-overlay.open { display: flex; }
.portal-modal { background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 2rem; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.portal-modal h3 { margin: 0 0 1.25rem; font-family: var(--font-heading); }
.portal-field { margin-bottom: 1rem; }
.portal-field label { display: block; margin-bottom: 0.4rem; font-size: 0.82rem; font-weight: 500; opacity: 0.8; }
.portal-field input, .portal-field textarea, .portal-field select { width: 100%; padding: 0.7rem 0.9rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: var(--lighter); font-size: 0.9rem; }
.portal-field input:focus, .portal-field textarea:focus ht:focusselect:focus { outline: none; border-color: var(--accent); }
.portal-modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--lighter); font-size: 1.5rem; cursor: pointer; opacity: 0.5; }
.portal-modal-close:hover { opacity: 1; }
@media (max-width: 768px) {
  .portal-sidebar { display: none; position: fixed; inset: 0; z-index: 99; width: 100%; background: var(--darker); padding-top: 5rem; }
  .portal-sidebar.open { display: flex; }
  .portal-main { padding: 1.5rem; }
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ADMIN DASHBOARD (admin/Dashboard.html, manage-animals, upload)
   Layout shell - dark glass, warm amber accents
   ============================================================ */
.admin-app { min-height: 100vh; display: flex; background: var(--darker); color: var(--lighter); }
.admin-app * { box-sizing: border-box; }

.admin-sidebar {
  width: 260px; min-width: 260px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(18, 24, 20, 0.96), rgba(10, 15, 12, 0.98));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 1rem; }
.admin-brand img { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--accent); box-shadow: 0 0 14px rgba(244,162,97,0.25); }
.admin-brand span { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: var(--lighter); }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.admin-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.8rem 0.95rem;
  border: 1px solid transparent; background: none; border-radius: 10px;
  color: rgba(255,255,255,0.65); font-size: 0.88rem; font-weight: 500;
  cursor: pointer; text-align: left; transition: all 0.25s ease; font-family: var(--font-body);
  text-decoration: none;
}
.admin-nav-item i { width: 20px; text-align: center; font-size: 0.95rem; color: rgba(255,255,255,0.4); transition: color 0.25s ease; }
.admin-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--lighter); }
.admin-nav-item:hover i { color: var(--accent); }
.admin-nav-item.active {
  background: var(--accent-soft, rgba(244,162,97,0.14));
  border-color: rgba(244,162,97,0.28);
  color: var(--accent); font-weight: 600;
}
.admin-nav-item.active i { color: var(--accent); }
.admin-nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--terracotta, #E07A5F); color: #fff;
  font-size: 0.68rem; font-weight: 700;
}
.admin-nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0.5rem 0.75rem; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.75rem;
  background: rgba(12, 16, 13, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-topbar h1 { font-size: 1.15rem; font-weight: 600; color: var(--lighter); margin: 0; font-family: var(--font-heading); }
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.admin-content { padding: 2rem 1.75rem; max-width: 1200px; width: 100%; }

/* Scans / tiles inside admin dashboard */
.stat-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 1.25rem; text-align: center; transition: all 0.3s ease; backdrop-filter: blur(8px); }
.stat-card:hover { transform: translateY(-4px); border-color: rgba(244,162,97,0.35); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.stat-card h3 { color: var(--accent); }
.stat-icon { font-size: 1.55rem; margin-bottom: 0.5rem; display: block; }

/* Mobile sidebar drawer */
.mobile-toggle-sidebar { display: none; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: var(--lighter); font-size: 1.15rem; cursor: pointer; padding: 0.5rem 0.7rem; border-radius: 8px; }
@media (max-width: 768px) {
  .admin-app { flex-direction: column; }
  .admin-sidebar {
    width: 100%; min-width: 0; min-height: 0;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 0.75rem 1rem; gap: 0.25rem;
    position: sticky; top: 0; z-index: 500;
  }
  .admin-brand { padding: 0; margin: 0; border: none; }
  .admin-nav { flex-direction: row; overflow-x: auto; flex: 1; }
  .admin-nav-item { flex-shrink: 0; padding: 0.55rem 0.8rem; font-size: 0.8rem; white-space: nowrap; }
  .admin-nav-badge { margin-left: 0.35rem; }
  .admin-logout { margin-top: 0; padding-top: 0; border-top: none; }
  .admin-topbar { padding: 0.7rem 1rem; }
  .admin-content { padding: 1.5rem 1rem; }
  .mobile-toggle-sidebar { display: block; }
  .admin-sidebar:not(.open) .admin-nav { display: none; }
}

/* ============================================================ PASSWORD INPUT WITH TOGGLE ============================================================ */
.password-field { position: relative; }
.password-field .form-input { padding-right: 3rem; }
.password-toggle {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1rem; padding: 0.5rem; transition: var(--transition); z-index: 10;
  min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--accent); }
.password-toggle:focus { outline: none; color: var(--accent); }

/* ============================================================ PASSWORD STRENGTH METER ============================================================ */
.password-strength { margin-top: 0.5rem; }
.strength-bar-container { display: flex; gap: 4px; height: 4px; margin-bottom: 0.5rem; }
.strength-bar { flex: 1; background: rgba(255,255,255,0.1); border-radius: 2px; transition: var(--transition); }
.strength-bar.weak { background: #ef4444; }
.strength-bar.fair { background: #f59e0b; }
.strength-bar.good { background: #3b82f6; }
.strength-bar.strong { background: #22c55e; }
.strength-text { font-size: 0.8rem; font-weight: 500; }
.strength-text.weak { color: #ef4444; }
.strength-text.fair { color: #f59e0b; }
.strength-text.good { color: #3b82f6; }
.strength-text.strong { color: #22c55e; }

/* ============================================================ PASSWORD REQUIREMENTS LIST ============================================================ */
.password-requirements { margin-top: 0.75rem; padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: var(--radius); }
.password-requirements h4 { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin-bottom: 0.5rem; font-family: var(--font-body); font-weight: 600; }
.password-requirements ul { list-style: none; }
.password-requirements li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-bottom: 0.35rem; transition: var(--transition); }
.password-requirements li i { font-size: 0.75rem; width: 16px; text-align: center; }
.password-requirements li.met { color: #22c55e; }
.password-requirements li.met i { color: #22c55e; }
.password-requirements li.unmet i { color: rgba(255,255,255,0.3); }

/* ============================================================ SECURITY BADGES ============================================================ */
.security-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); border-radius: 100px; color: #22c55e; font-size: 0.78rem; font-weight: 500; }
.security-badge i { font-size: 0.75rem; }

/* ============================================================ PAGE BANNER ============================================================ */
.page-banner { text-align: center; padding: 6rem 2rem 4rem; color: var(--lighter); position: relative; }
.page-banner .eyebrow { display: inline-block; padding: 0.3rem 1rem; background: rgba(220, 114, 82,0.15); border: 1px solid rgba(220, 114, 82,0.25); border-radius: 100px; color: var(--accent); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.8rem; }
.page-banner h1 { font-family: var(--font-heading); color: var(--lighter); margin-bottom: 0.8rem; font-size: clamp(2rem, 5vw, 3rem); }
.page-banner .lede { font-size: 1.08rem; max-width: 560px; margin: 0 auto; opacity: 0.82; line-height: 1.7; }

/* Legacy page banner classes used in user/ pages */
.page-eyebrow { display: inline-block; padding: 0.3rem 1rem; background: rgba(220, 114, 82,0.15); border: 1px solid rgba(220, 114, 82,0.25); border-radius: 100px; color: var(--accent); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.8rem; }
.page-title { font-family: var(--font-heading); color: var(--lighter); margin-bottom: 0.8rem; font-size: clamp(2rem, 5vw, 3rem); }

/* ============================================================ FOOTER ============================================================ */
.site-footer { background: rgba(6, 12, 8, 0.95); border-top: 1px solid rgba(255,255,255,0.04); padding: 3rem 0 1.2rem; }
.footer-content { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-brand h3 { font-family: var(--font-heading); color: var(--lighter); font-size: 1.3rem; margin-bottom: 0.75rem; }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.9rem; line-height: 1.7; }
.footer-links h4, .footer-contact h4 { color: var(--lighter); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.9rem; opacity: 0.8; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.45rem; }
.footer-links a, .footer-contact a { color: rgba(255,255,255,0.55); font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover, .footer-contact a:hover { color: var(--accent); }
.footer-contact p { color: rgba(255,255,255,0.55); font-size: 0.9rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); font-size: 0.85rem; transition: var(--transition); }
.footer-social a:hover { background: var(--accent); color: var(--dark); transform: translateY(-2px); }
.footer-bottom { max-width: var(--max-width); margin: 0 auto; padding: 1.2rem 2rem 0; border-top: 1px solid rgba(255,255,255,0.04); text-align: center; }
.footer-bottom p { color: rgba(255,255,255,0.35); font-size: 0.82rem; }

@media (max-width: 768px) { .footer-content { grid-template-columns: 1fr; gap: 2rem; } }

/* Legacy footer classes */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.footer-logo-img { width: 32px; height: 32px; border-radius: 50%; }
.footer-logo-text { font-family: var(--font-heading); color: var(--lighter); font-weight: 700; }
.footer-tagline { color: rgba(255,255,255,0.55); font-size: 0.9rem; }
.footer-heading { color: var(--lighter); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.9rem; opacity: 0.8; }
.footer-list { list-style: none; }
.footer-list li { margin-bottom: 0.45rem; }
.copyright { color: rgba(255,255,255,0.35); font-size: 0.82rem; text-align: center; }
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-links a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); font-size: 0.85rem; transition: var(--transition); }
.social-links a:hover { background: var(--accent); color: var(--dark); transform: translateY(-2px); }

@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ============================================================ ANIMATIONS ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.8s ease-out forwards; }

/* ============================================================
   ACCESSIBILITY - Visible focus rings (keyboard navigation)
   ============================================================ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .admin-nav-item:focus-visible {
  outline: 3px solid rgba(244, 162, 97, 0.65);
  outline-offset: 2px;
  border-radius: 8px;
}
.admin-nav-item:focus-visible { background: rgba(255,255,255,0.06); }

/* Skip link (WCAG 2.4.1 Bypass Blocks) - visually hidden until focused */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  background: var(--primary, #1b5e40);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* ============================================================
   MICRO-INTERACTIONS - glassmorphism depth & gentle lift
   ============================================================ */
.card, .feature-card, .form-container, .admin-form-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.card:hover, .feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(244,162,97,0.12); }
.feature-icon { background: var(--accent-soft, rgba(244,162,97,0.14)); color: var(--accent); }
.feature-card:hover .feature-icon { transform: scale(1.08); }

/* Vibrant interactive accents */
.cta-button { background: linear-gradient(135deg, var(--accent) 0%, var(--terracotta) 100%); color: #1a1408; box-shadow: 0 2px 10px rgba(232, 158, 84,0.25); }
.cta-button:hover { box-shadow: 0 4px 15px rgba(221, 135, 78,0.4); }
.cta-outline { background: transparent !important; border: 2px solid var(--accent) !important; color: var(--accent) !important; }
.cta-outline:hover { background: rgba(244,162,97,0.1) !important; }

/* ============================================================
   FIELD NOTES - live activity ticker
   ============================================================ */
.field-notes { overflow: hidden; position: relative; padding: 1.1rem 0; }
.field-notes-track { display: flex; gap: 1rem; width: max-content; animation: fieldNotesScroll 42s linear infinite; }
.field-notes:hover .field-notes-track { animation-play-state: paused; }
.field-note {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.2rem; border-radius: 999px; white-space: nowrap;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8); font-size: 0.85rem; font-weight: 500;
}
.field-note i { color: var(--accent); }
.field-note .note-loc { color: var(--terracotta); font-weight: 600; }
.field-note .note-time { color: rgba(255,255,255,0.4); font-size: 0.75rem; }
.field-notes::before, .field-notes::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 2; pointer-events: none;
}
.field-notes::before { left: 0; background: linear-gradient(to right, var(--darker), transparent); }
.field-notes::after { right: 0; background: linear-gradient(to left, var(--darker), transparent); }
@keyframes fieldNotesScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .field-notes-track { animation: none; flex-wrap: wrap; width: auto; }
}

/* ============================================================
   CUSTOM ICONS - hand-drawn sprite loader (js/icons.js)
   ============================================================ */
.wg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
@keyframes wg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.wg-icon-spin { animation: wg-spin 1s linear infinite; }

/* ============================================================ UTILITIES ============================================================ */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.8rem; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; }
.btn-primary { background: var(--accent); color: var(--dark); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--lighter); border: 1px solid rgba(255,255,255,0.15); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
.btn-ghost { background: transparent; color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.15); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--lighter); }
.text-danger { color: #ef4444 !important; }

.feature-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg); padding: 2rem; text-align: center; transition: var(--transition); }
.feature-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.16); box-shadow: var(--shadow); }
.feature-icon { width: 56px; height: 56px; margin: 0 auto 1.2rem; display: flex; align-items: center; justify-content: center; background: rgba(244, 162, 97,0.1); border-radius: 50%; color: var(--accent); font-size: 1.4rem; }
.feature-card h3 { color: var(--lighter); margin-bottom: 0.6rem; font-size: 1.1rem; }
.feature-card p { color: rgba(255,255,255,0.65); font-size: 0.92rem; }

/* ============================================================
   PROFILE, HISTORY & FAVOURITES SPECIFIC STYLES
   ============================================================ */

/* --- Profile Layout --- */
.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
}

/* Profile Card */
.profile-card {
  padding: 2rem;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.avatar-edit-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

.profile-info {
  margin-bottom: 1.5rem;
}

.profile-name {
  color: var(--lighter);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.profile-email {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.profile-role {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.profile-bio {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Profile Stats */
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1.5rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  color: var(--lighter);
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.stat-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}

/* Profile Actions */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Settings Card */
.settings-card {
  padding: 2rem;
}

.settings-card .card-header {
  margin-bottom: 1.5rem;
}

.settings-card .card-title {
  color: var(--lighter);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.settings-card .card-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Toggle Switches */
.toggle-row {
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toggle-hint {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--lighter);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.form-group.toggle-group {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
}

.form-group.toggle-group .form-label {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* --- History Layout --- */
.history-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .history-layout { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.1);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lighter);
  font-size: 0.85rem;
  transform: translateX(-50%);
}

.timeline-date {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-title {
  color: var(--lighter);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.timeline-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Summary Stats */
.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.summary-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
}

.summary-value {
  display: block;
  color: var(--lighter);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.summary-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}

/* Quick Links */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  transition: var(--transition);
}

.quick-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: var(--lighter);
}

.quick-link i { color: var(--accent); }

/* --- Content Sections --- */
.main-content { padding-top: var(--header-height); min-height: 100vh; }
.content-section { padding: 3rem 0; }

/* Favourites */
.favourite-card .card-body { padding: 1rem; text-align: center; }
.favourite-card .card-body h3 { font-size: 1rem; }
.favourite-card .card-body p { font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* --- Connectivity (Online/Offline) --- */
.connectivity-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7a1f1f, #a33c3c);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.connectivity-banner.visible { transform: translateY(0); }
.connectivity-banner-icon i { color: #ffdada; }
@media (max-width: 768px) {
  .connectivity-banner { font-size: 0.78rem; padding: 0.5rem 0.75rem; text-align: center; }
}

/* ============================================================
   MOBILE POLISH — compact vertical rhythm so pages stay short
   (desktop layout is untouched; these only apply ≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  section { padding: 1.5rem 0; }
  .section { padding: 1.5rem 0; }
  .section--sm { padding: 1.25rem 0; }
  .section-header { margin-bottom: 1.25rem; }
  .section-header h2 { font-size: 1.35rem; margin-bottom: 0.4rem; }
  .section-header p {
    font-size: 0.88rem;
    margin-top: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .page-banner { padding: 2.5rem 1.25rem 1.5rem; }
  .page-banner h1 { font-size: 1.7rem; }
  .page-banner .lede { font-size: 0.95rem; }

  /* Short, snug hero */
  .hero { min-height: auto; padding: 3rem 1.25rem 2rem; }
  .hero-content h1 { font-size: 1.9rem; margin-bottom: 0.8rem; }
  .hero-content p { font-size: 0.95rem; line-height: 1.55; margin-bottom: 1.1rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; align-items: stretch; }
  .hero-actions .cta-button { width: 100%; justify-content: center; padding: 0.75rem 0.5rem; font-size: 0.9rem; }

  /* Tidy 2-up card grids, flatter images, tight margins */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
  .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Balance odd-count grids — the trailing orphan card now spans the full row */
  .card-grid > *:last-child:nth-child(odd),
  .grid-2 > *:last-child:nth-child(odd),
  .grid-3 > *:last-child:nth-child(odd),
  .grid-4 > *:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .card-image { aspect-ratio: 16 / 9; }
  .card-body { padding: 0.6rem 0.75rem 0.75rem; }
  .card-body h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }
  .card-body p {
    font-size: 0.8rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Compress the paper badges so they never fight the card titles */
  .badge { font-size: 0.6rem; padding: 0.42rem 0.7rem 0.2rem 0.85rem; letter-spacing: 0.5px; }

  .stat-card { padding: 0.75rem 0.25rem; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: 0.68rem; letter-spacing: 0.5px; }

  .form-container { padding: 1.1rem; }
  .form-group { margin-bottom: 0.9rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Balanced 2-col footer — brand on top, links + contact below */
  .site-footer { padding: 2rem 0 1rem; }
  .footer-content { grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1rem; }
  .footer-brand p { font-size: 0.85rem; }

  /* Narrower fade edges on the field-notes marquee so more is readable */
  .field-notes::before, .field-notes::after { width: 24px; }

  /* Keep the theme button a comfortable 40px touch target */
  .theme-toggle { width: 40px; height: 40px; min-width: 40px; }
}

/* Smaller phones: keep the story in the cards — clamp instead of hiding */
@media (max-width: 560px) {
  .card-body h3 { font-size: 0.9rem; }
  .card-body p { -webkit-line-clamp: 2; }
  .section-header p { -webkit-line-clamp: 2; }
}

@media (max-width: 480px) {
  section { padding: 1.1rem 0; }
  .section-header { margin-bottom: 1rem; }
  .hero { padding: 2.25rem 1rem 1.5rem; }
  .hero-content h1 { font-size: 1.65rem; }
  .hero-content p { font-size: 0.9rem; }
  .section-header h2 { font-size: 1.25rem; }
  .page-banner { padding: 2rem 1rem 1.25rem; }
  .card-body { padding: 0.5rem 0.6rem 0.6rem; }
  .container { padding: 0 0.9rem; }

  /* Keep the top bar to a single row: hide the user email label */
  .user-menu-toggle span { display: none; }
}

/* ============================================================
   WildGuard Branded Dialog (replaces native confirm()/alert())
   ============================================================ */
#wg-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}
.wg-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 8, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}
.wg-dialog-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background:
    linear-gradient(165deg, rgba(45, 106, 79, 0.28), rgba(11, 20, 15, 0.96) 55%),
    rgba(15, 24, 19, 0.98);
  border: 1px solid rgba(244, 162, 97, 0.35);
  border-radius: 18px;
  padding: 2rem 2rem 1.6rem;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(244, 162, 97, 0.12), 0 0 60px rgba(45, 138, 94, 0.18);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}
#wg-dialog-root.open { pointer-events: auto; }
#wg-dialog-root.open .wg-dialog-overlay { opacity: 1; }
#wg-dialog-root.open .wg-dialog-card { opacity: 1; transform: translateY(0) scale(1); }

.wg-dialog-card::before {
  content: '';
  position: absolute;
  top: -2px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  box-shadow: 0 0 18px rgba(244, 162, 97, 0.55);
}
.wg-dialog-logo {
  width: 66px; height: 66px;
  margin: 0 auto 0.9rem;
  border-radius: 16px;
  padding: 0.4rem;
  background: linear-gradient(135deg, rgba(45, 138, 94, 0.35), rgba(244, 162, 97, 0.2));
  border: 1px solid rgba(244, 162, 97, 0.45);
  box-shadow: 0 8px 24px rgba(244, 162, 97, 0.25);
}
.wg-dialog-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.wg-dialog-icon {
  width: 58px; height: 58px;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(244, 162, 97, 0.22), rgba(45, 138, 94, 0.22));
  border: 1px solid rgba(244, 162, 97, 0.4);
  color: var(--accent);
  box-shadow: 0 8px 24px rgba(244, 162, 97, 0.18);
}
.wg-dialog-card.danger .wg-dialog-icon {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.18), rgba(127, 29, 29, 0.2));
  box-shadow: 0 8px 24px rgba(248, 113, 113, 0.2);
}
.wg-dialog-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.55rem;
}
.wg-dialog-message {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.6rem;
}
.wg-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.wg-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.2px;
}
.wg-dialog-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.wg-dialog-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.wg-dialog-btn-confirm {
  background: linear-gradient(135deg, var(--accent) 0%, var(--terracotta) 100%);
  color: #1a1408;
  box-shadow: 0 6px 22px rgba(244, 162, 97, 0.35);
}
.wg-dialog-btn-confirm:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--terracotta) 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(244, 162, 97, 0.45);
}
.wg-dialog-card.danger .wg-dialog-btn-confirm {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.32);
}
.wg-dialog-card.danger .wg-dialog-btn-confirm:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.42);
}
.wg-dialog-sub {
  margin-top: 1.3rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.wg-dialog-sub i { color: var(--accent); }
