/**
 * REWARDS - Official Design System & Theme Stylesheet
 * PT Panorama Rasa Sejahtera
 * Primary Brand Color: #294167 (PANORAMA NAVY BLUE)
 * Standard Design Tokens:
 * - Primary: #294167
 * - Primary Dark: #1A2C48
 * - Secondary: #42658B
 * - Background: #F7F9FC
 * - Surface: #FFFFFF
 * - Accent Gold: #E6BC79
 * - Text: #17263C
 * - Card Radius: 18px (16px - 20px)
 * - Button Height: 44px - 48px
 * - Input Height: 48px
 */

/* ==========================================================================
   1. CSS DESIGN TOKENS (LIGHT & DARK THEMES) - WCAG AAA COMPLIANT
   ========================================================================== */

:root,
[data-theme="light"] {
  /* Official Brand Palette */
  --color-primary: #294167;
  --color-primary-dark: #1A2C48;
  --color-secondary: #42658B;
  --color-primary-soft: #EEF3F8;
  --color-accent-gold: #E6BC79;
  --color-accent-gold-text: #8B5E09; /* High-contrast golden text for light mode */
  --color-accent-gold-bg: rgba(230, 188, 121, 0.18);
  --color-accent-coral: #D95338;
  --color-neutral-gray: #5A6A80;

  /* Surfaces & Backgrounds */
  --color-background: #F7F9FC;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F1F5F9;
  --color-surface-elevated: #FFFFFF;
  --color-border: #E2E8F0;
  --color-border-subtle: rgba(41, 65, 103, 0.08);

  /* High Contrast Typography */
  --color-text-primary: #17263C;   /* Deep Slate Navy - Crisp, readable */
  --color-text-secondary: #334155; /* Slate 700 - Subheadings, labels */
  --color-text-muted: #5A6A80;     /* Slate 600 - Muted secondary (5.2:1 ratio) */
  --color-text-inverse: #FFFFFF;

  /* Semantic Feedback */
  --color-success: #059669;
  --color-success-soft: #D1FAE5;
  --color-warning: #D97706;
  --color-warning-soft: #FEF3C7;
  --color-danger: #DC2626;
  --color-danger-soft: #FEE2E2;

  /* Geometry & Dimension Standards */
  --radius-card: 18px;
  --radius-button: 14px;
  --radius-input: 14px;
  --height-button: 46px;
  --height-input: 48px;

  /* Refined, Minimal Micro-Shadows */
  --shadow-xs: 0 1px 2px rgba(23, 38, 60, 0.04);
  --shadow-sm: 0 1px 3px rgba(23, 38, 60, 0.06), 0 1px 2px rgba(23, 38, 60, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(23, 38, 60, 0.08), 0 2px 4px rgba(23, 38, 60, 0.03);
  --shadow-lg: 0 12px 28px -4px rgba(23, 38, 60, 0.12), 0 4px 8px rgba(23, 38, 60, 0.04);
  --shadow-card: 0 2px 6px rgba(23, 38, 60, 0.04), 0 1px 2px rgba(23, 38, 60, 0.03);

  /* Navigation & Chrome */
  --color-nav-bg: rgba(255, 255, 255, 0.94);
  --color-nav-border: #E2E8F0;
  --sidebar-bg: #FFFFFF;

  color-scheme: light;
}

[data-theme="dark"] {
  /* Official Brand Palette in Dark Context */
  --color-primary: #557EAF;
  --color-primary-dark: #1A2C48;
  --color-secondary: #7FA3CC;
  --color-primary-soft: #1E293B;
  --color-accent-gold: #E6BC79;
  --color-accent-gold-text: #F3D49B;
  --color-accent-gold-bg: rgba(230, 188, 121, 0.16);
  --color-accent-coral: #EF927B;
  --color-neutral-gray: #94A3B8;

  /* Surfaces & Backgrounds */
  --color-background: #0F172A;
  --color-surface: #1E293B;
  --color-surface-subtle: #162032;
  --color-surface-elevated: #26354D;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-subtle: rgba(255, 255, 255, 0.06);

  /* Typography */
  --color-text-primary: #F8FAFC;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;
  --color-text-inverse: #0F172A;

  /* Semantic Feedback */
  --color-success: #34D399;
  --color-success-soft: rgba(52, 211, 153, 0.18);
  --color-warning: #FBBF24;
  --color-warning-soft: rgba(251, 191, 36, 0.18);
  --color-danger: #F87171;
  --color-danger-soft: rgba(248, 113, 113, 0.18);

  /* Geometry Standards */
  --radius-card: 18px;
  --radius-button: 14px;
  --radius-input: 14px;
  --height-button: 46px;
  --height-input: 48px;

  /* Subtle Dark Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px -3px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 32px -4px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 4px 14px -2px rgba(0, 0, 0, 0.4);

  /* Navigation & Chrome */
  --color-nav-bg: rgba(30, 41, 59, 0.94);
  --color-nav-border: rgba(255, 255, 255, 0.1);
  --sidebar-bg: #162032;

  color-scheme: dark;
}

/* ==========================================================================
   2. GLOBAL BASE & RESET
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

/* Standard Utility Color Classes */
.text-muted {
  color: var(--color-text-muted) !important;
}

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

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

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

[data-theme="dark"] .text-accent-gold {
  color: var(--color-accent-gold) !important;
}

.bg-surface {
  background-color: var(--color-surface) !important;
}

.bg-surface-subtle {
  background-color: var(--color-surface-subtle) !important;
}

.border-theme {
  border-color: var(--color-border) !important;
}

/* Form Inputs: 48px height, 16px font-size to prevent iOS Safari auto-zoom */
input, select, textarea {
  font-family: inherit;
  font-size: 16px !important;
  color: var(--color-text-primary) !important;
  background-color: var(--color-surface) !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 65, 103, 0.12);
}

[data-theme="dark"] input:focus, 
[data-theme="dark"] select:focus, 
[data-theme="dark"] textarea:focus {
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(230, 188, 121, 0.18);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-muted) !important;
  opacity: 0.75;
}

.form-control-48 {
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 1rem;
}

/* Custom Scrollbar Concealment */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   3. RESPONSIVE APP SHELL & ADAPTIVE NAVIGATION
   ========================================================================== */

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background: var(--color-background);
  position: relative;
}

/* Desktop Sidebar (1024px and above) */
.desktop-sidebar {
  display: none;
  width: 270px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.02);
}

/* Tablet Nav Rail (768px - 1023px) */
.tablet-nav-rail {
  display: none;
  width: 80px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0.5rem;
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.02);
}

/* Main Workspace */
.app-main-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-background);
}

.workspace-content {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 1rem calc(80px + env(safe-area-inset-bottom, 0px)) 1rem;
}

@media (min-width: 640px) {
  .workspace-content {
    padding: 1.25rem 1.5rem calc(84px + env(safe-area-inset-bottom, 0px)) 1.5rem;
  }
}

@media (min-width: 768px) {
  .tablet-nav-rail {
    display: flex;
  }
  .bottom-nav {
    display: none !important;
  }
  .workspace-content {
    padding: 1.75rem 2rem 3rem 2rem;
  }
}

@media (min-width: 1024px) {
  .tablet-nav-rail {
    display: none !important;
  }
  .desktop-sidebar {
    display: flex;
  }
  .bottom-nav {
    display: none !important;
  }
  .workspace-content {
    padding: 2rem 2.5rem 3.5rem 2.5rem;
  }
}

/* Optional Mobile Frame Simulator */
body.simulator-active .app-shell {
  background: radial-gradient(circle at 50% 20%, rgba(41, 65, 103, 0.08) 0%, transparent 70%),
              var(--color-background);
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

body.simulator-active .desktop-sidebar,
body.simulator-active .tablet-nav-rail {
  display: none !important;
}

body.simulator-active .bottom-nav {
  display: flex !important;
}

body.simulator-active .app-main-workspace {
  max-width: 420px;
  height: 92vh;
  max-height: 890px;
  border-radius: 40px;
  border: 8px solid var(--color-primary-dark);
  box-shadow: 0 24px 70px -10px rgba(26, 44, 72, 0.35);
  overflow: hidden;
  position: relative;
}

body.simulator-active .workspace-content {
  padding: 1rem 1rem calc(76px + env(safe-area-inset-bottom, 0px)) 1rem;
}

/* ==========================================================================
   4. NAVIGATION ITEMS & SIDEBAR BUTTONS
   ========================================================================== */

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.sidebar-nav-btn:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

[data-theme="dark"] .sidebar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent-gold);
}

.sidebar-nav-btn.active {
  background: var(--color-primary);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(41, 65, 103, 0.2);
}

[data-theme="dark"] .sidebar-nav-btn.active {
  background: #1A2C48;
  color: var(--color-accent-gold) !important;
  border: 1px solid rgba(230, 188, 121, 0.3);
}

.rail-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rail-nav-btn:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.rail-nav-btn.active {
  background: var(--color-primary);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(41, 65, 103, 0.2);
}

[data-theme="dark"] .rail-nav-btn.active {
  background: #1A2C48;
  color: var(--color-accent-gold) !important;
  border: 1px solid rgba(230, 188, 121, 0.3);
}

/* Mobile Bottom Navigation Bar (5 Items) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--color-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-nav-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  height: 52px;
  color: var(--color-neutral-gray);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
}

.nav-item.active {
  color: var(--color-primary);
}

[data-theme="dark"] .nav-item.active {
  color: var(--color-accent-gold);
}

.nav-item .nav-icon {
  font-size: 1.15rem;
  transition: transform 0.15s ease;
}

.nav-item.active .nav-icon {
  transform: translateY(-1px);
}

.nav-item .nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Center Elevated Scan Button */
.nav-scan-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--color-surface);
  box-shadow: 0 4px 12px rgba(41, 65, 103, 0.3);
  margin-top: -18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

[data-theme="dark"] .nav-scan-button {
  background: var(--color-accent-gold);
  color: #1A2C48;
  border-color: var(--color-surface);
  box-shadow: 0 4px 12px rgba(230, 188, 121, 0.3);
}

.nav-scan-button:active {
  transform: scale(0.95);
}

/* ==========================================================================
   5. COMPONENT SYSTEM: CARDS, BUTTONS & BADGES
   ========================================================================== */

/* Cards (Standardized 18px radius) */
.panorama-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.panorama-card-interactive {
  cursor: pointer;
}

.panorama-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(41, 65, 103, 0.2);
}

[data-theme="dark"] .panorama-card-interactive:hover {
  border-color: rgba(230, 188, 121, 0.25);
}

/* Main Membership Focal Card */
.membership-overview-card {
  background: linear-gradient(135deg, #294167 0%, #1A2C48 75%, #121E31 100%);
  color: #FFFFFF;
  border-radius: var(--radius-card);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(41, 65, 103, 0.28),
              0 0 0 1px rgba(230, 188, 121, 0.25);
}

.membership-overview-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 188, 121, 0.22) 0%, transparent 70%);
  pointer-events-none;
}

/* Tier Digital Cards */
.tier-card-basic {
  background: linear-gradient(135deg, #374151 0%, #1F2937 60%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F9FAFB;
}

.tier-card-silver {
  background: linear-gradient(135deg, #4B5563 0%, #9CA3AF 50%, #374151 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.tier-card-gold {
  background: linear-gradient(135deg, #294167 0%, #1A2C48 50%, #0F172A 100%);
  border: 1px solid rgba(230, 188, 121, 0.45);
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(26, 44, 72, 0.3), 0 0 20px rgba(230, 188, 121, 0.15);
}

.tier-card-platinum {
  background: linear-gradient(135deg, #0B111E 0%, #1A2C48 40%, #090D15 100%);
  border: 1px solid rgba(230, 188, 121, 0.6);
  color: #FFFFFF;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(230, 188, 121, 0.22);
}

/* 3D Flip Card */
.perspective-1000 {
  perspective: 1000px;
}
.transform-style-3d {
  transform-style: preserve-3d;
}
.backface-hidden {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.rotate-y-180 {
  transform: rotateY(180deg);
}

/* Subtle Gold Sheen */
.gold-foil-sheen {
  background-image: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.1) 35%,
    rgba(230, 188, 121, 0.25) 45%,
    rgba(255, 255, 255, 0.12) 55%,
    transparent 65%
  );
  background-size: 250% 100%;
  animation: foilShimmer 7s infinite ease-in-out;
}

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

/* Buttons (Standardized 44px - 48px height) */
.btn-primary {
  height: var(--height-button);
  min-height: 44px;
  background-color: var(--color-primary);
  color: #FFFFFF !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-button);
  padding: 0 1.25rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(41, 65, 103, 0.18);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 65, 103, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-gold {
  height: var(--height-button);
  min-height: 44px;
  background: linear-gradient(135deg, #E6BC79 0%, #D8A95C 100%);
  color: #1A2C48 !important;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-button);
  padding: 0 1.25rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230, 188, 121, 0.25);
}

.btn-gold:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230, 188, 121, 0.35);
}

.btn-secondary {
  height: var(--height-button);
  min-height: 44px;
  background: var(--color-primary-soft);
  color: var(--color-primary) !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-button);
  padding: 0 1.25rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary) !important;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(41, 65, 103, 0.1);
}

/* Compact button variants */
.btn-sm {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 0.85rem !important;
  font-size: 0.75rem !important;
  border-radius: 10px !important;
}

/* Search Pill Input (48px standard) */
.search-pill {
  height: 48px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-pill:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 65, 103, 0.1);
}

[data-theme="dark"] .search-pill:focus-within {
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(230, 188, 121, 0.15);
}

/* Badges */
.badge-gold {
  background: rgba(230, 188, 121, 0.18);
  color: var(--color-accent-gold-text) !important;
  border: 1px solid rgba(230, 188, 121, 0.4);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

[data-theme="dark"] .badge-gold {
  color: #F3D49B !important;
  background: rgba(230, 188, 121, 0.15);
  border-color: rgba(230, 188, 121, 0.35);
}

.badge-coral {
  background: rgba(217, 83, 56, 0.14);
  color: #B9381E !important;
  border: 1px solid rgba(217, 83, 56, 0.35);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

[data-theme="dark"] .badge-coral {
  color: #FFA590 !important;
}

.badge-navy {
  background: var(--color-primary-soft);
  color: var(--color-primary) !important;
  border: 1px solid rgba(41, 65, 103, 0.2);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

[data-theme="dark"] .badge-navy {
  background: rgba(85, 126, 175, 0.2);
  color: #ADC8E6 !important;
  border-color: rgba(85, 126, 175, 0.35);
}

/* App View Containers */
.app-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   6. MODALS & POPUPS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.2s ease;
  position: relative;
}

.modal-backdrop.open .modal-panel {
  transform: translateY(0) scale(1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}

.panorama-toast {
  pointer-events: auto;
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideToastIn 0.25s ease;
}

@keyframes slideToastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   7. AUTHENTICATION & LOGIN PAGE
   ========================================================================== */

.auth-view-screen {
  position: fixed;
  inset: 0;
  background: var(--color-background);
  z-index: 90;
  overflow-y: auto;
  display: flex;
}

.auth-split-wrapper {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.auth-banner-side {
  display: none;
  flex: 1.1;
  background: linear-gradient(135deg, #1A2C48 0%, #294167 65%, #111D30 100%);
  position: relative;
  overflow: hidden;
  padding: 3rem;
  color: #FFFFFF;
  flex-direction: column;
  justify-content: space-between;
}

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--color-surface);
}

@media (min-width: 1024px) {
  .auth-banner-side {
    display: flex;
  }
  .auth-form-side {
    max-width: 540px;
    padding: 3rem 3.5rem;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.03);
  }
}

/* ==========================================================================
   8. SPLASH SCREEN & ANIMATIONS
   ========================================================================== */

.splash-anim-bounce {
  animation: splashBounce 1.4s infinite;
}

.splash-anim-pulse {
  animation: splashPulse 1.6s infinite ease-in-out;
}

.splash-anim-spin {
  animation: splashSpin 1.8s infinite linear;
}

.splash-anim-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.1) 100%);
  background-size: 200% 100%;
  animation: splashShimmer 1.8s infinite;
}

@keyframes splashBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

@keyframes splashSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* ==========================================================================
   9. ACCESSIBILITY & PREFERENCES
   ========================================================================== */

@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;
  }
}
