/* WealthMeld Global Design System */
/* Fonts: Outfit/Manrope (headings) + Inter (body) */

/* ========================================
   CSS CUSTOM PROPERTIES - LIGHT MODE (DEFAULT)
   ======================================== */
:root {
  /* Color Palette */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F6F9FF;
  --bg-tertiary: #EEF3FF;
  --bg-elevated: #E4ECFF;
  --bg-card: rgba(255, 255, 255, 0.8);

  --accent-primary: #2563EB;
  --accent-primary-light: #3B82F6;
  --accent-primary-dark: #1D4ED8;
  --accent-secondary: #D97706;
  --accent-secondary-light: #F59E0B;
  --accent-success: #059669;
  --accent-warning: #D97706;
  --accent-error: #DC2626;
  --accent-purple: #7C3AED;
  --accent-cyan: #0891B2;

  --glow-primary: rgba(37, 99, 235, 0.2);
  --glow-secondary: rgba(217, 119, 6, 0.15);
  --glow-success: rgba(5, 150, 105, 0.15);

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-muted: #9CA3AF;
  --text-invert: #F9FAFB;

  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(37, 99, 235, 0.4);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 14px 26px -10px rgba(15, 23, 42, 0.18), 0 8px 12px -8px rgba(37, 99, 235, 0.12);
  --shadow-xl: 0 22px 36px -16px rgba(15, 23, 42, 0.22), 0 14px 18px -14px rgba(37, 99, 235, 0.14);
  --shadow-glow: 0 0 40px var(--glow-primary);

  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   DARK MODE
   ======================================== */
[data-theme="dark"] {
  --bg-primary: #030712;
  --bg-secondary: #0A101D;
  --bg-tertiary: #121B2C;
  --bg-elevated: #1A2740;
  --bg-card: rgba(31, 41, 55, 0.4);

  --accent-primary: #3B82F6;
  --accent-primary-light: #60A5FA;
  --accent-primary-dark: #2563EB;
  --accent-secondary: #F59E0B;
  --accent-secondary-light: #FBBF24;

  --glow-primary: rgba(59, 130, 246, 0.4);
  --glow-secondary: rgba(245, 158, 11, 0.3);

  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  --text-muted: #4B5563;
  --text-invert: #111827;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(59, 130, 246, 0.5);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 10% -10%, rgba(59, 130, 246, 0.1), transparent 30%),
                    radial-gradient(circle at 90% -15%, rgba(124, 58, 237, 0.08), transparent 35%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-width: 320px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-light);
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: transparent;
  z-index: 100000;
  transition: all var(--transition-base);
  padding: 8px 1rem 0;
}

.navbar.scrolled {
  padding-top: 6px;
}

.navbar-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 0 1.1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  box-shadow: 0 12px 36px -24px rgba(15, 23, 42, 0.35);
  position: relative;
}

.navbar-container::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.34), transparent);
  opacity: 0.7;
}

[data-theme="dark"] .navbar-container {
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.86), rgba(10, 16, 29, 0.72));
  border-color: rgba(96, 165, 250, 0.2);
  box-shadow: 0 18px 48px -28px rgba(2, 6, 23, 0.8);
}

[data-theme="dark"] .navbar-container::after {
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.44), transparent);
}

.navbar.scrolled .navbar-container {
  box-shadow: 0 16px 38px -24px rgba(15, 23, 42, 0.45);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.navbar-logo svg,
.navbar-logo .brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.navbar-logo span {
  letter-spacing: -0.02em;
}

.logo-dot {
  color: #38BDF8;
  font-weight: 800;
  margin-left: 1px;
  font-size: 1.2em;
}


.navbar-logo .brand-mark {
  border-radius: 10px;
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.6);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .navbar-nav {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.navbar-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

[data-theme="dark"] .navbar-nav {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.navbar-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  line-height: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  box-shadow: none !important;
}

.navbar-link:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1) !important;
}

.navbar-link[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16) !important;
}

.dropdown {
  position: relative;
}

.dropdown::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: 100%;
  height: 14px;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}
.dropdown-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.dropdown-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-toggle svg,
.dropdown.open .dropdown-toggle svg,
.dropdown:focus-within .dropdown-toggle svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, -8px) scale(0.98);
  width: min(620px, 84vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 255, 0.92));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 1.15rem;
  padding: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  box-shadow: 0 24px 60px -26px rgba(15, 23, 42, 0.38);
  z-index: 1100;
}

@media (max-width: 980px) {
  .dropdown-menu {
    width: min(540px, 88vw);
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .dropdown-menu {
  background: linear-gradient(155deg, rgba(10, 16, 29, 0.96), rgba(12, 21, 39, 0.92));
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 26px 64px -28px rgba(2, 6, 23, 0.9);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.78rem 0.86rem;
  border-radius: 0.8rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .dropdown-item {
  background: rgba(15, 23, 42, 0.52);
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 999px;
  color: var(--accent-primary-light);
  background: rgba(59, 130, 246, 0.13);
  flex-shrink: 0;
}

.dropdown-item::after {
  content: "\2192";
  margin-left: auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
  color: var(--accent-primary-light);
}

.dropdown-item:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.26);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.dropdown-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.dropdown-item:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.theme-toggle .sun {
  display: none;
}

.theme-toggle .moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

/* ========================================
   CURRENCY SELECTOR
   ======================================== */
.global-currency {
  display: flex;
  align-items: center;
}

.global-currency select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  min-width: 140px;
}

.global-currency select:hover {
  border-color: var(--border-default);
  background: var(--bg-tertiary);
}

.global-currency select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--glow-primary);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.mobile-menu {
  position: fixed;
  top: 68px;
  right: 0;
  left: auto !important;
  width: min(360px, 92vw);
  height: calc(100vh - 68px);
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-base), visibility var(--transition-base);
  overflow-y: auto;
  z-index: 99999;
  visibility: hidden;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu a {
  display: block;
  padding: 0.85rem 0.65rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-subtle);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  top: 68px;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: 99998;
  visibility: hidden;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: 0.8rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: white;
  box-shadow: 0 8px 24px var(--glow-primary);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px var(--glow-primary);
  color: white;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-default);
}

.btn-outline:hover {
  background: var(--bg-elevated);
}

/* ========================================
   CARDS
   ======================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 0% 0%, rgba(59, 130, 246, 0.09), transparent 46%);
}

[data-theme="dark"] .glass-card {
  background: linear-gradient(145deg, rgba(18, 27, 44, 0.86), rgba(10, 16, 29, 0.82));
  border-color: rgba(96, 165, 250, 0.17);
}

.glass-card:hover {
  border-color: rgba(96, 165, 250, 0.34);
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}

/* ========================================
   PAGE HERO (About, Contact, Privacy, Terms, Disclaimer)
   ======================================== */
.about-hero {
  padding-top: 140px;
  padding-bottom: var(--space-10);
  text-align: center;
}
.about-hero .container {
  max-width: 820px;
}
.about-hero h1 {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-2);
}
.about-hero .subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* ========================================
   PRIVACY / TERMS / DISCLAIMER CONTENT
   ======================================== */
.privacy-content {
  padding: clamp(1.8rem, 4vw, 3rem);
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.privacy-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.privacy-content h2:first-child {
  margin-top: 0;
}
.privacy-content p {
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: var(--space-4);
}
.privacy-content ul {
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}
.privacy-content ul li {
  margin-bottom: var(--space-2);
}
.privacy-content strong {
  color: var(--text-primary);
  font-weight: 600;
}
.privacy-content a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy-content a:hover {
  color: var(--accent-primary-light);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--glow-primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.input-prefix {
  position: relative;
}

.input-prefix span {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-weight: 600;
  pointer-events: none;
}

.input-prefix .form-input {
  padding-left: var(--space-10);
}

.form-range {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
}

.toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
}

.toggle-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   CALCULATOR LAYOUT
   ======================================== */
.calculator-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.calculator-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

@media (max-width: 1023px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

.calculator-form {
  padding: var(--space-8);
}

.calculator-results {
  padding: var(--space-8);
}

.results-panel {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}

.result-value {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: var(--text-5xl);
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-secondary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: var(--space-4) 0;
}

.result-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.stat-box {
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--transition-fast);
}

.stat-box:hover {
  transform: translateY(-2px);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.chart-container {
  width: 100%;
  height: 300px;
  margin: var(--space-6) 0;
}
@media (max-width: 540px) {
  .chart-container { height: 240px; }
}

/* ========================================
   DATA TABLES (Amortization, etc.)
   ======================================== */
.data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-4) 0;
}
.data-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table th {
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}
.data-table td { color: var(--text-secondary); }
.data-table tbody tr:nth-child(even) { background: var(--bg-secondary); }
.data-table tbody tr:hover { background: var(--bg-elevated); }

/* ========================================
   INFO CARDS GRID (Calculator educational cards)
   ======================================== */
@media (max-width: 900px) {
  #calc-info-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-4) !important;
  }
}
@media (max-width: 540px) {
  .info-card { padding: var(--space-4) !important; }
  .info-card-title { font-size: var(--text-lg) !important; }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: transparent;
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
  position: relative;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  border-radius: 28px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(59, 130, 246, 0.2), transparent 45%),
    radial-gradient(120% 160% at 100% 0%, rgba(14, 165, 233, 0.14), transparent 42%),
    linear-gradient(180deg, #060A16, #040713 72%);
  box-shadow: 0 30px 70px -34px rgba(2, 6, 23, 0.85);
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: 0;
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: rgba(148, 163, 184, 0.82);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-2);
}

.footer-col a {
  font-size: var(--text-sm);
  color: rgba(226, 232, 240, 0.88);
  transition: all var(--transition-fast);
}

.footer-col a:hover {
  color: #ffffff;
  padding-left: 0.3rem;
}

.footer .navbar-logo {
  color: #F8FAFC;
}

.footer .navbar-logo .brand-mark {
  box-shadow: 0 10px 22px -14px rgba(59, 130, 246, 0.9);
}

.footer .footer-col:first-child p {
  color: rgba(148, 163, 184, 0.95) !important;
  font-size: var(--text-base) !important;
  line-height: 1.6 !important;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.6rem, 3vw, 2.4rem);
  border-top: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.6), rgba(30, 41, 59, 0.25));
  font-size: var(--text-sm);
  color: rgba(148, 163, 184, 0.9);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}

.footer-bottom p:last-child {
  color: rgba(226, 232, 240, 0.72);
}

[data-theme="light"] .footer-container {
  border-color: rgba(99, 102, 241, 0.16);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(59, 130, 246, 0.16), transparent 46%),
    radial-gradient(120% 160% at 100% 0%, rgba(14, 165, 233, 0.12), transparent 44%),
    linear-gradient(180deg, #F8FBFF, #EEF4FF 76%);
  box-shadow: 0 28px 58px -34px rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .footer-col h4 {
  color: rgba(71, 85, 105, 0.85);
}

[data-theme="light"] .footer-col a {
  color: rgba(30, 41, 59, 0.88);
}

[data-theme="light"] .footer-col a:hover {
  color: #0F172A;
}

[data-theme="light"] .footer .navbar-logo {
  color: #0F172A;
}

[data-theme="light"] .footer .footer-col:first-child p {
  color: rgba(71, 85, 105, 0.95) !important;
}

[data-theme="light"] .footer-bottom {
  border-top-color: rgba(99, 102, 241, 0.14);
  background: linear-gradient(90deg, rgba(230, 238, 255, 0.9), rgba(246, 250, 255, 0.82));
  color: rgba(51, 65, 85, 0.9);
}

[data-theme="light"] .footer-bottom p:last-child {
  color: rgba(71, 85, 105, 0.88);
}

@media (max-width: 768px) {
  .footer-container {
    border-radius: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes morphFloat {
  0%, 100% { transform: translate(0, 0) scale(1); border-radius: 50%; }
  33% { transform: translate(25px, -35px) scale(1.06); border-radius: 45% 55% 60% 40%; }
  66% { transform: translate(-18px, 18px) scale(0.96); border-radius: 60% 40% 45% 55%; }
}

@keyframes panelFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes gridPan {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 12px currentColor; }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes progressShimmer {
  0% { left: -60%; }
  100% { left: 160%; }
}

@keyframes dividerFlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.reveal-hidden {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ========================================
   COOKIE CONSENT BANNER
   ======================================== */
.cookie-consent {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 520px;
  width: calc(100% - 2rem);
  padding: 1.1rem 1.3rem;
  background: linear-gradient(155deg, rgba(8, 14, 26, 0.97), rgba(12, 21, 39, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 1.2rem;
  box-shadow: 0 20px 50px -20px rgba(2, 6, 23, 0.85);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-size: var(--text-sm);
  color: rgba(226, 232, 240, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cookie-consent.visible {
  opacity: 1;
  pointer-events: auto;
}
.cookie-consent p {
  flex: 1;
  min-width: 200px;
  line-height: 1.5;
  margin: 0;
  color: inherit;
}
.cookie-consent a {
  color: #60A5FA;
  text-decoration: underline;
}
.cookie-consent .btn-accept {
  padding: 0.55rem 1.2rem;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  border: none;
  border-radius: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.cookie-consent .btn-accept:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

[data-theme="light"] .cookie-consent {
  background: linear-gradient(155deg, rgba(248, 251, 255, 0.97), rgba(238, 244, 255, 0.95));
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow: 0 18px 46px -20px rgba(15, 23, 42, 0.3);
  color: rgba(30, 41, 59, 0.92);
}
[data-theme="light"] .cookie-consent a {
  color: #2563EB;
}

/* ========================================
   SHARE BUTTONS
   ======================================== */
.share-section {
  margin-top: var(--space-12);
  text-align: center;
}
.share-section h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.6rem 1.1rem;
  border-radius: 0.7rem;
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-decoration: none;
}
.share-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.share-btn.copied {
  background: var(--accent-success);
  color: #fff;
  border-color: var(--accent-success);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ========================================
   RESPONSIVE — TABLET (max 1024px)
   ======================================== */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }
  .calculator-container { padding: 0 1rem; }
  .calculator-form,
  .calculator-results { padding: var(--space-5); }
  .calculator-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .about-hero { padding-top: 110px; padding-bottom: var(--space-6); }
  .about-hero h1 { font-size: var(--text-4xl); }
  .privacy-content { padding: var(--space-5); }
  .faq-section { padding: 0 var(--space-3); }
  .hero-blob { display: none; }
  .hero-grid { opacity: 0.15; }
}

/* ========================================
   RESPONSIVE — MOBILE (max 768px)
   ======================================== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }

  .navbar { padding: 6px 0.75rem 0; height: 64px; }
  .navbar-container { border-radius: 14px; padding: 0 0.7rem; min-height: 52px; }
  .navbar-nav { display: none; }
  .global-currency { display: none; }
  .navbar-actions { gap: var(--space-2); }
  .navbar-logo { font-size: var(--text-lg); }
  .navbar-logo .brand-mark { width: 28px; height: 28px; }
  .logo-dot { font-size: 1em; }
  .mobile-toggle { display: flex; }
  .theme-toggle { width: 36px; height: 36px; }

  .container { padding: 0 1rem; }
  .calculator-container { padding: 0 0.75rem; }
  .calculator-form,
  .calculator-results { padding: var(--space-4); }
  .calculator-layout { margin-top: var(--space-4); grid-template-columns: 1fr; }

  .result-value { font-size: var(--text-4xl); }
  .result-label { font-size: var(--text-xs); }

  .about-hero { padding-top: 90px; padding-bottom: var(--space-4); }
  .about-hero h1 { font-size: var(--text-2xl); }
  .about-hero .subtitle { font-size: var(--text-sm); }

  .privacy-content { padding: var(--space-4); border-radius: var(--radius-lg); }
  .privacy-content h2 { font-size: var(--text-xl); margin-top: var(--space-6); }

  .faq-section { margin-top: var(--space-12); max-width: 100%; padding: 0 var(--space-2); }
  .faq-title { font-size: var(--text-2xl); }
  .faq-question { font-size: var(--text-sm); padding: var(--space-4) 0; }

  .footer-container { border-radius: 20px; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }

  .cookie-consent {
    bottom: 0.75rem;
    max-width: calc(100% - 1.5rem);
    border-radius: 1rem;
  }
  .cookie-consent p { font-size: var(--text-xs); }

  .data-table-wrapper { margin: 0 -0.5rem; }
  .data-table th, .data-table td { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }

  .contact-layout { padding: 0; }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }

  .mobile-menu { top: 64px; height: calc(100vh - 64px); width: min(300px, 90vw); }
  .mobile-menu-overlay { top: 64px; }

  .dropdown-menu { width: min(420px, 90vw); left: 0; transform: translate(-10%, -8px) scale(0.98); }
  .dropdown:hover .dropdown-menu,
  .dropdown.open .dropdown-menu { transform: translate(-10%, 0) scale(1); }
}

/* ========================================
   RESPONSIVE — SMALL MOBILE (max 540px)
   ======================================== */
@media (max-width: 540px) {
  .result-value { font-size: var(--text-3xl); }
  .btn { width: 100%; justify-content: center; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .stat-box { padding: var(--space-3); }
  .stat-value { font-size: var(--text-lg); }

  .about-hero { padding-top: 80px; }
  .about-hero h1 { font-size: var(--text-xl); }

  .calculator-container { padding: 0 0.5rem; }
  .calculator-form,
  .calculator-results { padding: var(--space-3); }
  .form-group { margin-bottom: var(--space-4); }
  .form-input { height: 44px; font-size: var(--text-sm); }

  .privacy-content { padding: var(--space-3); }
  .privacy-content h2 { font-size: var(--text-lg); }

  .footer-container { border-radius: 16px; }
  .footer-grid { gap: var(--space-6); padding: var(--space-4); }
  .footer-bottom { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }

  .cookie-consent { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-consent .btn-accept { width: 100%; }

  .dropdown-menu { width: min(320px, 88vw); }
}

/* ========================================
   FAQ SECTION (ACCORDION)
   ======================================== */
.faq-section {
  margin-top: var(--space-20);
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-4);
}

.faq-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  text-align: center;
  margin-bottom: var(--space-10);
  color: var(--text-primary);
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.04);
}

[data-theme="dark"] .faq-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  border-color: rgba(96, 165, 250, 0.25);
}

.faq-question {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--accent-primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
}

.faq-answer p {
  margin-bottom: var(--space-4);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-item.active {
  border-color: var(--accent-primary);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-bottom: var(--space-6);
}

.faq-icon {
  transition: transform var(--transition-base);
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: var(--space-4);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--accent-primary);
}


/* Social Links & Community Section */
.social-links .social-icon {
  color: var(--text-secondary);
  transition: color 0.2s ease, transform 0.2s ease;
}
.social-links .social-icon:hover {
  color: var(--accent-primary);
  transform: translateY(-2px);
}
.social-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
}
