/* ==========================================================================
   CALCOLATRICESCIENTIFICAONLINE - STYLESHEET
   Design System: Pure Black OLED Theme, Fluid Typography & Responsive Layout
   ========================================================================== */

:root {
  /* Color Palette - Pure Black Theme (Default) */
  --bg-primary: #000000;
  --bg-secondary: #070709;
  --bg-card: #0d0d10;
  --bg-card-hover: #16161c;
  --bg-input: #08080a;
  --bg-screen: #000000;

  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.24);
  --border-focus: #6366f1;

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-accent: #818cf8;

  /* Vibrant Accents */
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  /* Calculator Key Button Specifics */
  --key-num-bg: #141418;
  --key-num-hover: #22222a;
  --key-num-text: #ffffff;

  --key-fn-bg: #0c0c10;
  --key-fn-hover: #1c1c24;
  --key-fn-text: #d4d4d8;

  --key-op-bg: #191924;
  --key-op-hover: #28283a;
  --key-op-text: #a5b4fc;

  --key-equals-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --key-equals-hover: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  --key-equals-shadow: rgba(99, 102, 241, 0.35);

  --key-danger-bg: rgba(244, 63, 94, 0.15);
  --key-danger-hover: rgba(244, 63, 94, 0.28);
  --key-danger-text: #fda4af;

  /* Shadows and Blurs */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.85);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.95);
  --shadow-glow: 0 0 25px rgba(255, 255, 255, 0.03);
  --backdrop-blur: blur(20px);

  /* Dimensions & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-calc: 'JetBrains Mono', monospace;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-input: #ffffff;
  --bg-screen: #f1f5f9;

  --border-color: rgba(148, 163, 184, 0.25);
  --border-highlight: rgba(99, 102, 241, 0.4);
  --border-focus: #4f46e5;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #4f46e5;

  --key-num-bg: rgba(255, 255, 255, 0.95);
  --key-num-hover: #e2e8f0;
  --key-num-text: #0f172a;

  --key-fn-bg: rgba(241, 245, 249, 0.9);
  --key-fn-hover: #e2e8f0;
  --key-fn-text: #334155;

  --key-op-bg: rgba(99, 102, 241, 0.1);
  --key-op-hover: rgba(99, 102, 241, 0.2);
  --key-op-text: #4f46e5;

  --key-equals-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --key-equals-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  --key-equals-shadow: rgba(79, 70, 229, 0.3);

  --key-danger-bg: rgba(239, 68, 68, 0.1);
  --key-danger-hover: rgba(239, 68, 68, 0.2);
  --key-danger-text: #dc2626;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Light Theme Specific Calculator Adaptations */
body.light-theme .calc-component {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
}

body.light-theme .calc-screen-panel {
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme #calc-display,
body.light-theme .calc-display {
  color: #000000 !important;
  text-shadow: none !important;
}

body.light-theme .calc-expression {
  color: #334155 !important;
}

body.light-theme .key-num {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 700;
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .key-num:hover {
  background: #e2e8f0 !important;
  color: #000000 !important;
  border-color: rgba(148, 163, 184, 0.6) !important;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(35, 35, 55, 0.28) 0%, transparent 60%),
    radial-gradient(circle at 85% 90%, rgba(20, 20, 30, 0.35) 0%, transparent 60%);
  background-attachment: fixed;
}

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

a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

body.light-theme .site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

body.light-theme .brand-logo {
  color: #0f172a;
}

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

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.brand-text strong {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

body.light-theme .nav-link {
  color: #475569;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

body.light-theme .nav-link:hover {
  color: #0f172a;
  background: rgba(99, 102, 241, 0.08);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--border-highlight);
  font-weight: 600;
}

body.light-theme .nav-link.active {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

body.light-theme .icon-btn {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.4);
  color: #334155;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

body.light-theme .icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #6366f1;
}

/* Explicit theme toggle button styling with high contrast */
#theme-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #151620;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #facc15;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#theme-toggle-btn:hover {
  border-color: #f59e0b;
  background: #20212f;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

#theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}

#moon-icon {
  color: #facc15;
  fill: rgba(250, 204, 21, 0.2);
}

#sun-icon {
  color: #f59e0b;
  fill: rgba(245, 158, 11, 0.25);
}

body.light-theme #theme-toggle-btn {
  background: #ffffff;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  color: #4f46e5;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

body.light-theme #theme-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #4f46e5;
  transform: translateY(-2px);
}

body.light-theme #sun-icon {
  color: #f59e0b;
  fill: rgba(245, 158, 11, 0.25);
}

.mobile-only {
  display: none;
}

/* ==========================================================================
   LAYOUT WRAPPER & SECTIONS
   ========================================================================== */
.main-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-section {
  padding-top: 3.5rem;
  margin-bottom: 5rem;
}

.section-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-bottom: 1rem;
}

.main-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.subtitle,
.section-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 2.2rem;
}

/* ==========================================================================
   SCIENTIFIC CALCULATOR COMPONENT
   ========================================================================== */
.calculator-layout-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.calculator-layout-container .subtitle {
  margin-left: auto;
  margin-right: auto;
}

.calc-component {
  width: 100%;
  max-width: 480px;
  background: #09090c;
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 20px rgba(255, 255, 255, 0.02);
  position: relative;
  transition: border-color var(--transition-normal);
}

.calc-component:hover {
  border-color: var(--border-highlight);
}

/* Screen Display */
.calc-screen-panel {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem 1rem;
  margin-bottom: 0.85rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.98);
}

.screen-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  min-height: 28px;
}

.meta-indicators {
  display: flex;
  gap: 0.4rem;
}

.indicator-badge {
  font-family: var(--font-calc);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
}

.indicator-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.screen-tools {
  display: flex;
  gap: 0.5rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.screen-expression-box {
  min-height: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  margin-bottom: 0.35rem;
  scrollbar-width: thin;
}

.calc-expression {
  font-family: var(--font-calc);
  font-size: 1.05rem;
  font-weight: 600;
  color: #d4d4d8;
  direction: ltr;
}

body.light-theme .calc-expression {
  color: #000000 !important;
  font-weight: 700 !important;
}

.screen-primary-box {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

#calc-display,
.calc-display {
  font-family: var(--font-calc);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.15;
  display: inline-block;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.45), 0 0 2px #ffffff;
}

body.light-theme #calc-display,
body.light-theme .calc-display {
  color: #000000 !important;
  text-shadow: none !important;
}

/* Mode & Memory Controls Row */
.calc-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.mode-toggles,
.memory-toggles {
  display: flex;
  gap: 0.35rem;
}

.mode-btn,
.mem-btn {
  font-family: var(--font-calc);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--key-fn-bg);
  border: 1px solid var(--border-color);
  color: var(--key-fn-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover,
.mem-btn:hover {
  background: var(--key-fn-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.mode-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-indigo);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

/* Keypad Grid (5 columns) */
.calc-keypad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
}

.key-btn {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
}

.key-btn:active {
  transform: scale(0.94);
}

/* Button Classes - Numeric Keys */
body:not(.light-theme) .key-num,
body.dark-theme .key-num {
  background: #171720;
  color: #ffffff !important;
  font-family: var(--font-calc);
  font-size: 1.35rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

body:not(.light-theme) .key-num:hover,
body.dark-theme .key-num:hover {
  background: #252533;
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff !important;
}

body.light-theme .key-num {
  background: #ffffff !important;
  color: #000000 !important;
  font-family: var(--font-calc);
  font-size: 1.35rem;
  font-weight: 800 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .key-num:hover {
  background: #f1f5f9 !important;
  color: #000000 !important;
  border-color: #94a3b8 !important;
}

.key-fn {
  background: var(--key-fn-bg);
  color: var(--key-fn-text);
  font-size: 0.95rem;
  font-family: var(--font-calc);
}

.key-fn:hover {
  background: var(--key-fn-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.key-op {
  background: var(--key-op-bg);
  color: var(--key-op-text);
  font-size: 1.3rem;
  font-family: var(--font-calc);
}

.key-op:hover {
  background: var(--key-op-hover);
  border-color: var(--accent-indigo);
}

.key-action {
  background: var(--key-fn-bg);
  color: var(--text-primary);
}

.key-action:hover {
  background: var(--key-fn-hover);
}

.key-danger {
  background: var(--key-danger-bg);
  color: var(--key-danger-text);
  font-weight: 700;
  font-family: var(--font-calc);
}

.key-danger:hover {
  background: var(--key-danger-hover);
  border-color: rgba(244, 63, 94, 0.4);
}

.key-zero {
  grid-column: span 2;
}

.key-equals {
  grid-column: span 2;
  background: var(--key-equals-bg);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 16px var(--key-equals-shadow);
}

.key-equals:hover {
  background: var(--key-equals-hover);
  box-shadow: 0 6px 20px var(--key-equals-shadow);
  transform: translateY(-1px);
}

.shortcut-tip {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   MODAL / HISTORY DRAWER
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
}

.modal-title-wrap h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: right;
  transition: all var(--transition-fast);
}

.history-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  transform: translateX(-2px);
}

.history-expr {
  font-family: var(--font-calc);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.history-res {
  font-family: var(--font-calc);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.history-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: left;
}

.empty-history {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.content-container {
  max-width: 1140px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   ABOUT US SECTION (CHI SIAMO)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 3rem;
  align-items: start;
}

.about-text-column h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}

.about-text-column p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.4rem;
  line-height: 1.7;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-calc);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-indigo);
  margin-bottom: 0.2rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.values-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.value-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.val-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.highlight-info-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.card-header-styled {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: #ef4444;
}

.dot.yellow {
  background: #f59e0b;
}

.dot.green {
  background: #10b981;
}

.window-title {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-calc);
  color: var(--text-muted);
}

.card-body-content {
  padding: 1.8rem;
}

.card-body-content h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.card-body-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.engine-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.engine-features li {
  position: relative;
  padding-left: 1.2rem;
}

.engine-features li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

.citation-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-indigo);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.citation-box p {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.citation-box cite {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

/* ==========================================================================
   CONTACT US SECTION (CONTATTACI)
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 2.5rem;
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.contact-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-details h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.contact-details p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-details .subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.25rem;
}

.faq-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.faq-summary-box h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.faq-item {
  border-top: 1px solid var(--border-color);
  padding: 0.65rem 0;
  cursor: pointer;
}

.faq-item summary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.faq-item summary:hover {
  color: var(--accent-cyan);
}

.faq-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  padding-left: 0.5rem;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
}

.form-card h3 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.form-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
}

.styled-form {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.required {
  color: var(--accent-rose);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--accent-rose);
  margin-top: 0.2rem;
}

.has-error .field-error {
  display: block;
}

.has-error input,
.has-error select,
.has-error textarea {
  border-color: var(--accent-rose);
}

.form-checkbox-group {
  margin: 0.4rem 0;
  text-align: left;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.checkbox-container input {
  margin-top: 0.2rem;
  cursor: pointer;
  accent-color: var(--accent-indigo);
}

.link-inline {
  color: var(--accent-indigo);
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-submit {
  width: 100%;
}

.success-banner {
  margin-top: 1.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  color: var(--text-primary);
  animation: modalSlideUp 0.3s ease;
}

.banner-icon {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.success-banner h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 0.3rem;
}

.success-banner p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   PRIVACY POLICY SECTION (INFORMATIVA PRIVACY)
   ========================================================================== */
.privacy-document-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.doc-header {
  padding: 1.2rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.doc-version {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-tag {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.doc-body {
  padding: 2.5rem;
}

.doc-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.8rem 0 0.85rem;
  color: var(--text-primary);
}

.doc-body h3:first-child {
  margin-top: 0;
}

.doc-body p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.privacy-highlight-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-cyan);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.doc-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.doc-body ul li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.doc-body ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-indigo);
  font-weight: bold;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #040406;
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem 2rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.brand-col .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  white-space: nowrap;
}

.brand-col .footer-logo strong {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.footer-mission {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  max-width: 340px;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--text-accent);
  text-decoration: none;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.footer-bottom-bar {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-legal-links a {
  color: var(--text-muted);
}

/* ==========================================================================
   FORMULAS SECTION (FORMULE UTILI)
   ========================================================================== */
.formula-category-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.formula-tab-btn {
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.formula-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.formula-tab-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

body.light-theme .formula-tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
}

.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.4rem;
  margin-bottom: 2rem;
}

.formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
}

.formula-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.formula-card-top {
  margin-bottom: 1rem;
}

.formula-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.formula-badge.trig { color: var(--accent-cyan); border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.1); }
.formula-badge.geom { color: var(--accent-emerald); border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.1); }
.formula-badge.alg  { color: var(--accent-violet); border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.1); }
.formula-badge.phys { color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }

.formula-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.formula-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.9rem;
}

.formula-math-box {
  background: #040406;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-calc);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.light-theme .formula-math-box {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.3);
  color: #000000;
}

.formula-actions {
  display: flex;
  gap: 0.6rem;
}

.btn-formula-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-formula-action:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
  color: #ffffff;
}

body.light-theme .btn-formula-action {
  background: #ffffff;
  color: #0f172a;
}

body.light-theme .btn-formula-action:hover {
  background: #e2e8f0;
  color: #000000;
}

/* ==========================================================================
   ENHANCED GUIDE SECTION (GUIDA ALL'USO)
   ========================================================================== */
.guide-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.guide-item[open] {
  border-color: var(--border-highlight);
}

.guide-summary {
  padding: 1.2rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.guide-summary:hover {
  color: var(--accent-cyan);
}

.guide-content {
  padding: 0 1.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.guide-content p {
  margin-bottom: 0.8rem;
}

.guide-steps-list {
  margin: 0.8rem 0;
  padding-left: 1.4rem;
}

.guide-steps-list li {
  margin-bottom: 0.5rem;
}

.guide-example-pill {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-calc);
  font-size: 0.85rem;
  color: var(--accent-indigo);
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.shortcuts-table th,
.shortcuts-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.shortcuts-table th {
  color: var(--text-primary);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}

.shortcuts-table code {
  font-family: var(--font-calc);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s, transform 0.25s;
}

@keyframes toastIn {
  from {
    transform: translateY(15px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 992px) {

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 1120px) {
  .mobile-only {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.mobile-open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .nav-link {
    width: 100%;
    padding: 0.65rem 1rem;
  }
}

@media (max-width: 768px) {

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

  .calc-keypad-grid {
    gap: 0.4rem;
  }

  .key-btn {
    height: 48px;
    font-size: 0.95rem;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .calc-component {
    padding: 1rem;
  }

  .calc-keypad-grid {
    gap: 0.35rem;
  }

  .key-btn {
    height: 44px;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
  }

  .calc-display {
    font-size: 1.8rem;
  }

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

/* Utility classes */
.hidden {
  display: none !important;
}

/* ==========================================================================
   SEO ENHANCEMENTS: KEYWORD PILLS, COMPARISON TABLE & FAQ
   ========================================================================== */
.hero-badges-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.2rem auto 1.8rem;
  max-width: 850px;
}

.hero-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
  transition: all var(--transition-fast);
}

body.light-theme .hero-pill-tag {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #4338ca;
}

.hero-pill-tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-indigo);
  transform: translateY(-2px);
}

.hero-pill-tag .pill-icon {
  color: var(--accent-cyan);
}

/* SEO Cards Grid */
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.seo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.seo-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.seo-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

.seo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.seo-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.seo-card-points {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seo-card-points li {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seo-card-points li strong {
  color: var(--text-primary);
}

/* Comparison Table Section */
.comparison-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  background: rgba(255, 255, 255, 0.03);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

body.light-theme .comparison-table th {
  background: rgba(99, 102, 241, 0.05);
}

.comparison-table th.col-feature {
  width: 40%;
}

.comparison-table th.col-us {
  width: 30%;
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  border-left: 2px solid var(--accent-indigo);
}

.comparison-table th.col-google {
  width: 30%;
  color: var(--text-secondary);
}

.comparison-table td.col-us {
  background: rgba(99, 102, 241, 0.03);
  border-left: 2px solid var(--accent-indigo);
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

body.light-theme .comparison-table tr:hover td {
  background-color: rgba(99, 102, 241, 0.02);
}

.check-green {
  color: var(--accent-emerald);
  font-weight: bold;
  font-size: 1.1rem;
  margin-right: 0.4rem;
}

.cross-muted {
  color: var(--accent-rose);
  font-weight: bold;
  font-size: 1.1rem;
  margin-right: 0.4rem;
}

.subtext-comp {
  display: block;
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* FAQ Styling */
.faq-grid-rich {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.faq-rich-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-rich-item[open] {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-sm);
}

.faq-rich-summary {
  padding: 1.2rem 1.5rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-rich-summary::-webkit-details-marker {
  display: none;
}

.faq-rich-icon {
  color: var(--accent-indigo);
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.faq-rich-item[open] .faq-rich-icon {
  transform: rotate(180deg);
}

.faq-rich-body {
  padding: 0 1.5rem 1.4rem;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-rich-body p {
  margin-bottom: 0.8rem;
}

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

.faq-rich-body strong {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .comparison-wrapper {
    overflow-x: auto;
  }
  .comparison-table {
    min-width: 600px;
  }
  .hero-pill-tag {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
  }
}

/* ==========================================================================
   EDITORIAL LONG-FORM SEO CONTENT SECTION
   ========================================================================== */
.section-editorial {
  padding: 5rem 0;
  position: relative;
}

.editorial-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

body.light-theme .editorial-article-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.editorial-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.editorial-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1rem;
  flex-wrap: wrap;
}

.editorial-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.editorial-meta-item strong {
  color: var(--text-primary);
}

.editorial-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.editorial-body p {
  margin-bottom: 1.5rem;
}

.editorial-body h3 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.8rem;
  margin-bottom: 1.2rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.editorial-body h3::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--accent-indigo);
  border-radius: 4px;
}

.editorial-body h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.editorial-body ul,
.editorial-body ol {
  margin-bottom: 1.8rem;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.editorial-body li {
  color: var(--text-secondary);
}

.editorial-body li strong {
  color: var(--text-primary);
}

.editorial-callout-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-indigo);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem 1.8rem;
  margin: 2.2rem 0;
}

body.light-theme .editorial-callout-box {
  background: rgba(99, 102, 241, 0.06);
}

.editorial-callout-box h4 {
  margin-top: 0;
  color: var(--text-primary);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editorial-callout-box p {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

.editorial-grid-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2.2rem 0;
}

.highlight-mini-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

body.light-theme .highlight-mini-card {
  background: #f8fafc;
}

.highlight-mini-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.highlight-mini-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .editorial-article-card {
    padding: 2rem 1.5rem;
  }
  .editorial-body h3 {
    font-size: 1.3rem;
  }
}