/**
 * Bostam SMM Platform — Global Design System & Layout
 * Feature: UI-01
 * Path: assets/css/global.css
 */

/* ==========================================================================
   1. CSS Reset & Global Tokens
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  font: inherit;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

:root {
  /* Colors - Backgrounds */
  --color-bg: #FAF8F5;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F5F2EB;
  --color-surface-hover: #EBE6DA;
  
  /* Colors - Brand Primary */
  --color-brand-green: #0D3B2E;
  --color-brand-green-hover: #164E3D;
  --color-brand-green-dark: #0A2920;
  
  /* Colors - Accent */
  --color-accent-orange: #E8590C;
  --color-accent-orange-hover: #F06524;
  --color-accent-orange-light: #FF7A1A;
  
  /* Colors - Neutrals & Text */
  --color-text-main: #2C2824;
  --color-text-muted: #6B655B;
  --color-text-inverse: #FFFFFF;
  --color-border: #E5DFD5;
  --color-border-dark: #C9C2B5;
  --color-border-focus: #E8590C;
  
  /* Colors - Feedback */
  --color-error-bg: #FFF5F5;
  --color-error-border: #FFC9C9;
  --color-error-text: #C92A2A;
  --color-success-bg: #EBFBEE;
  --color-success-border: #B2F2BB;
  --color-success-text: #2B8A3E;
  --color-warning-bg: #FFF9DB;
  --color-warning-border: #FFEC99;
  --color-warning-text: #E67700;
  --color-info-bg: #E7F5FF;
  --color-info-border: #A5D8FF;
  --color-info-text: #1971C2;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-h3: 1.5rem;
  --font-size-h2: 2rem;
  --font-size-h1: 2.5rem;
  --font-size-display: 3rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Layout & Mobile Dimensions */
  --container-max: 1200px;
  --header-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Semantic & Legacy Color Aliases for Cross-Component Reliability */
  --color-primary: var(--color-brand-green);
  --color-primary-hover: var(--color-brand-green-hover);
  --color-brand: var(--color-brand-green);
  --color-brand-hover: var(--color-brand-green-hover);
  --color-accent: var(--color-accent-orange);
  --color-accent-hover: var(--color-accent-orange-hover);
  --color-text: var(--color-text-main);
  --color-text-light: var(--color-text-muted);
  --color-background: var(--color-bg);
  --color-success: var(--color-success-text);
  --color-warning: var(--color-warning-text);
  --color-error: var(--color-error-text);
  --color-info: var(--color-info-text);
}

/* ==========================================================================
   2. Base Typography & Body
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 80px;
  overflow-x: hidden;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-brand-green);
  margin-bottom: var(--space-sm);
}

.hero-title { font-size: var(--font-size-display); }
h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-xl); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-brand-green);
}

.text-small { font-size: var(--font-size-sm); }
.text-caption { font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* Focus Utilities */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   3. Global Layout Shell
   ========================================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* ==========================================================================
   Header Component: Floating Static Navbar (Matching Reference Design)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  padding: 0 0.5rem;
  background: transparent;
  border-bottom: none;
  height: auto;
  pointer-events: none;
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .site-header {
    top: 14px;
    padding: 0 0.85rem;
  }
}

@media (min-width: 768px) {
  .site-header {
    padding: 0 var(--space-md);
  }
}

.site-header > * {
  pointer-events: auto;
}

.site-header .container,
.site-header .floating-nav-container,
.site-header .navbar-container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  background: rgba(254, 252, 248, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(220, 210, 195, 0.45);
  box-shadow: 0 10px 30px -5px rgba(13, 59, 46, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  pointer-events: auto;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .site-header .container,
  .site-header .floating-nav-container,
  .site-header .navbar-container {
    padding: 0.45rem 0.65rem 0.45rem 1.25rem;
    gap: 1rem;
    min-height: 54px;
  }
}

/* ==========================================================================
   Header Component: Authenticated App Topbar Global Support
   ========================================================================== */
body.dashboard-page .site-header,
.dashboard-app > .site-header,
.dashboard-layout .site-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: none !important;
  pointer-events: auto !important;
}

@media (min-width: 480px) {
  body.dashboard-page .site-header,
  .dashboard-app > .site-header,
  .dashboard-layout .site-header {
    top: 0 !important;
    padding-top: 0 !important;
  }
}

@media (min-width: 768px) {
  body.dashboard-page .site-header,
  .dashboard-app > .site-header,
  .dashboard-layout .site-header {
    top: 0 !important;
    padding-top: 0 !important;
  }
}

body.dashboard-page .site-header,
.dashboard-topbar,
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-brand-green);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-logo:hover {
  color: var(--color-accent-orange);
}

.brand-logo img,
.brand-logo svg {
  display: block;
  flex-shrink: 0;
}

/* Floating Navigation Links */
.nav-desktop {
  display: none;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }
}

.nav-desktop a {
  color: var(--color-text-main);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav-desktop a:hover,
.nav-desktop a.active,
.nav-desktop a.nav-link-active {
  color: var(--color-accent-orange);
}

/* Navbar Actions (Right Side) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-util-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(226, 218, 205, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .nav-util-btn {
    display: none !important;
  }
}

.nav-util-btn:hover {
  background: rgba(226, 218, 205, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.nav-login-link {
  color: var(--color-brand-green);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.nav-login-link:hover {
  color: var(--color-accent-orange);
  background: rgba(13, 59, 46, 0.05);
}

.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem 0.5rem 1.4rem;
  background: var(--color-accent-orange);
  color: #FFFFFF !important;
  border: none;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(232, 89, 12, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.nav-cta-btn:hover {
  background: #D94E06;
  box-shadow: 0 6px 18px rgba(232, 89, 12, 0.35);
  transform: translateY(-1px);
  color: #FFFFFF !important;
}

.nav-cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF !important;
  font-size: 0.8rem;
  line-height: 1;
}

/* Mobile Nav Toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFFFFF;
  cursor: pointer;
  color: var(--color-brand-green);
  padding: 0;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  color: var(--color-accent-orange);
}

@media (max-width: 480px) {
  .nav-actions {
    gap: 0.625rem;
  }
  .brand-logo {
    font-size: 1.125rem;
    gap: 0.4rem;
  }
  .brand-logo svg,
  .brand-logo img {
    width: 22px;
    height: 22px;
  }
  .nav-cta-btn {
    padding: 0.42rem 0.75rem 0.42rem 0.85rem;
    font-size: 0.775rem;
    gap: 0.35rem;
  }
  .nav-cta-arrow {
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
  }
  .mobile-menu-toggle {
    width: 34px;
    height: 34px;
  }
  .mobile-menu-toggle svg {
    width: 18px;
    height: 18px;
  }
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Mobile Navigation Drawer */
.nav-mobile {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  left: 0.5rem;
  right: 0.5rem;
  max-width: 1120px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 16px 40px rgba(13, 59, 46, 0.12);
  pointer-events: auto;
}

@media (min-width: 768px) {
  .nav-mobile {
    top: calc(100% + 10px);
    left: var(--space-md);
    right: var(--space-md);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
  }
}

.nav-mobile.is-open {
  display: flex;
  gap: 0.5rem;
}

.nav-mobile a {
  color: var(--color-text-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--color-accent-orange);
}

.nav-mobile a:last-of-type {
  border-bottom: none;
}

.main-content {
  flex: 1;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

/* ==========================================================================
   Footer Component (Matching Reference Design)
   ========================================================================== */
.site-footer {
  background-color: #FAF8F5;
  color: var(--color-text-main);
  border-top: 1px solid var(--color-border);
  padding-top: 3.5rem;
  padding-bottom: 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    gap: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
  }
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.footer-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.footer-brand-logo span {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-brand-green);
  letter-spacing: -0.01em;
}

.footer-description {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 320px;
  margin: 0;
}

/* Social Media Icon Buttons */
.footer-social-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.footer-social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 89, 12, 0.25);
}

.footer-social-link img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.footer-social-link.is-yt { background-color: #FF0000; }
.footer-social-link.is-fb { background-color: #1877F2; }
.footer-social-link.is-ig { 
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); 
}
.footer-social-link.is-tt { background-color: #000000; }
.footer-social-link.is-x { background-color: #000000; }
.footer-social-link.is-wa { background-color: #25D366; }

/* Start for Free CTA button */
.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.35rem;
  background-color: var(--color-accent-orange);
  color: #FFFFFF !important;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  align-self: flex-start;
  box-shadow: 0 4px 14px rgba(232, 89, 12, 0.25);
  transition: all 0.2s ease;
}

.footer-cta-btn:hover {
  background-color: #D94E06;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 89, 12, 0.35);
}

.footer-cta-btn .cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.footer-cta-btn:hover .cta-arrow {
  transform: translateX(3px);
}

/* Link Columns */
.footer-col h4 {
  color: var(--color-brand-green);
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 1.15rem;
  letter-spacing: -0.01em;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col ul li a {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-col ul li a:hover {
  color: var(--color-accent-orange);
}

.footer-badge-soon {
  background-color: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: var(--space-xl);
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.footer-follow-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .footer-follow-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-follow-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-follow-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-brand-green);
}

.footer-mini-socials {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.footer-mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}

.footer-mini-btn img {
  display: block;
  width: 14px;
  height: 14px;
  filter: brightness(0) opacity(0.65);
  transition: all 0.2s ease;
}

.footer-mini-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent-orange);
  color: var(--color-accent-orange);
  box-shadow: 0 2px 8px rgba(232, 89, 12, 0.15);
}

.footer-mini-btn:hover img {
  filter: brightness(0) saturate(100%) invert(43%) sepia(85%) saturate(1912%) hue-rotate(359deg) brightness(97%) contrast(92%);
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.8;
  line-height: 1.5;
  margin: 0.75rem 0 1.25rem;
}

.footer-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  font-size: 0.75rem;
  color: var(--color-text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.footer-trust-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #2B8A3E;
  color: #2B8A3E;
  font-size: 0.6875rem;
  font-weight: 800;
}

.footer-trust-verified {
  color: #2B8A3E;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   4. Component System: Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
  min-height: 44px; /* Accessible mobile touch target */
  -webkit-tap-highlight-color: transparent;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-sm);
  min-height: 38px;
}

.btn-primary {
  background-color: var(--color-accent-orange);
  color: var(--color-surface);
}

.btn-primary:hover {
  background-color: var(--color-accent-orange-hover);
  color: var(--color-surface);
}

.btn-secondary {
  background-color: var(--color-brand-green);
  color: var(--color-surface);
}

.btn-secondary:hover {
  background-color: var(--color-brand-green-hover);
  color: var(--color-surface);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-brand-green);
  color: var(--color-brand-green);
}

.btn-outline:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-brand-green);
}

.btn:disabled, .btn[disabled], .btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   5. Component System: Forms
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem; /* Minimum 16px to prevent iOS Safari auto-zoom on mobile */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.15);
}

.form-input::placeholder,
.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-input:disabled,
.form-control:disabled {
  background-color: var(--color-surface-subtle);
  cursor: not-allowed;
}

.form-help {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  color: var(--color-error-text);
  font-size: var(--font-size-xs);
  margin-top: var(--space-xs);
  display: none;
}
.form-group.has-error .form-input {
  border-color: var(--color-error-border);
}
.form-group.has-error .form-error {
  display: block;
}

/* ==========================================================================
   6. Component System: Cards & Surfaces
   ========================================================================== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.surface-panel {
  background: var(--color-surface-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

/* ==========================================================================
   7. Component System: Feedback / Status
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success-text); border: 1px solid var(--color-success-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border: 1px solid var(--color-warning-border); }
.badge-error { background: var(--color-error-bg); color: var(--color-error-text); border: 1px solid var(--color-error-border); }
.badge-info { background: var(--color-info-bg); color: var(--color-info-text); border: 1px solid var(--color-info-border); }
.badge-pending { background: var(--color-surface-subtle); color: var(--color-text-muted); border: 1px solid var(--color-border); }

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.alert-error { background: var(--color-error-bg); color: var(--color-error-text); border: 1px solid var(--color-error-border); }
.alert-success { background: var(--color-success-bg); color: var(--color-success-text); border: 1px solid var(--color-success-border); }
.alert-info { background: var(--color-info-bg); color: var(--color-info-text); border: 1px solid var(--color-info-border); }
.alert:empty { display: none !important; }

/* ==========================================================================
   8. Component System: Modals & Bottom Sheets (Mobile-First)
   ========================================================================== */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

.modal,
.modal-backdrop,
.modal-overlay,
dialog.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 59, 46, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-end; /* Mobile default: bottom sheet */
  justify-content: center;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

dialog.modal::backdrop {
  background: rgba(13, 59, 46, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal.is-open,
.modal-backdrop.is-open,
.modal-overlay.is-open,
dialog.modal[open],
dialog.modal:not([style*="display: none"])[open] {
  display: flex;
}

.modal-dialog,
.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; /* Bottom sheet radius */
  width: 100%;
  max-width: 100%;
  box-shadow: 0 -8px 30px rgba(13, 59, 46, 0.15);
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--space-md) + var(--safe-bottom));
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 10;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-brand-green);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-xs);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
  color: var(--color-accent-orange);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: var(--color-surface);
}

@media (min-width: 768px) {
  .modal-backdrop,
  .modal-overlay,
  dialog.modal {
    align-items: center; /* Center on tablets & desktops */
    padding: var(--space-md);
  }

  .modal-dialog,
  .modal-content {
    border-radius: var(--radius-lg);
    max-width: 500px;
    padding-bottom: 0;
    animation: modalFadeIn 0.2s ease-out;
  }

  @keyframes modalFadeIn {
    from {
      transform: scale(0.96);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
}

/* ==========================================================================
   9. Loading / Empty States
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border-dark);
}

.empty-state svg {
  margin: 0 auto var(--space-md);
  color: var(--color-text-muted);
  width: 48px;
  height: 48px;
}

.loader {
  border: 3px solid var(--color-surface-subtle);
  border-top: 3px solid var(--color-accent-orange);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   10. Layout Utilities & Breakpoints
   ========================================================================== */
.grid {
  display: grid;
  gap: var(--space-md);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-only { display: block; }
.desktop-only { display: none; }

/* Breakpoint 1: Larger smartphones */
@media (min-width: 480px) {
  /* Handled in component styles */
}

/* Breakpoint 2: Tablets */
@media (min-width: 768px) {
  .hero-title {
    font-size: 4rem;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Breakpoint 3: Laptops / Desktop Nav */
@media (min-width: 1024px) {
  .mobile-menu-toggle { display: none; }
  .nav-mobile { display: none !important; }
  .nav-desktop { display: flex; }
  
  .mobile-only { display: none; }
  .desktop-only { display: block; }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 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;
  }
}

/* Mobile Scrolling & Container Utilities */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-md);
}

.overflow-touch {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.overflow-touch::-webkit-scrollbar {
  display: none;
}

/* Global utility for strict state isolation */
.hidden {
  display: none !important;
}

/* ==============================================================================
 * NAVBAR UTILITY DROPDOWNS (LANGUAGE & PREFERENCES)
 * ============================================================================== */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  min-width: 190px;
  background: #FFFFFF;
  border: 1px solid rgba(13, 59, 46, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(13, 59, 46, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: navDropdownFade 0.15s ease-out;
}

.nav-dropdown-menu[hidden] {
  display: none !important;
}

@keyframes navDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.35rem 0.65rem 0.2rem;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
  background: rgba(226, 218, 205, 0.35);
  color: var(--color-brand-green);
}

.nav-dropdown-item.active {
  background: rgba(13, 59, 46, 0.06);
  color: var(--color-brand-green);
  font-weight: 700;
}

.lang-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-label {
  flex: 1;
}

.lang-check {
  color: var(--color-accent-orange);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nav-dropdown-item.active .lang-check {
  opacity: 1;
}

/* Preferences Dropdown */
.pref-dropdown-menu {
  min-width: 250px;
  padding: 0.75rem 0.85rem;
}

.pref-dropdown-section {
  padding: 0.35rem 0;
}

.pref-section-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-brand-green);
  margin-bottom: 0.4rem;
}

.pref-options-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pref-option-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.pref-option-item:hover {
  background: rgba(226, 218, 205, 0.35);
}

.pref-option-item.active {
  background: rgba(13, 59, 46, 0.05);
  border-color: rgba(13, 59, 46, 0.12);
  color: var(--color-brand-green);
  font-weight: 700;
}

.pref-radio-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.pref-option-item.active .pref-radio-indicator {
  border-color: var(--color-accent-orange);
  background: var(--color-accent-orange);
  box-shadow: inset 0 0 0 2.5px #FFFFFF;
}

.pref-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 0.5rem 0;
}

.pref-pills-row {
  display: flex;
  gap: 0.4rem;
}

.pref-lang-pill {
  flex: 1;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(13, 59, 46, 0.12);
  background: transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.pref-lang-pill:hover {
  background: rgba(226, 218, 205, 0.4);
}

.pref-lang-pill.active {
  background: var(--color-brand-green);
  border-color: var(--color-brand-green);
  color: #FFFFFF;
}

/* Mobile Drawer Language & Currency Switcher */
.mobile-nav-controls {
  padding: 0.75rem 0.25rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-control-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-brand-green);
}

.mobile-pill-switch {
  display: inline-flex;
  background: rgba(226, 218, 205, 0.45);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.mobile-switch-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-main);
  transition: all 0.15s ease;
}

.mobile-switch-btn.active {
  background: var(--color-brand-green);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Navigation Avatar Component (Global Nav Auth State)
   ========================================================================== */
.user-avatar-pill {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-brand-green, #0D3B2E);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(13, 59, 46, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.user-avatar-pill:hover .user-avatar-circle {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(13, 59, 46, 0.28);
}
