/* ==============================================================================
   BHARTIYA JOBS — MASTER PRODUCTION STYLESHEET
   Indian Flag (Tiranga) Palette, High-Contrast Light/Night Themes,
   Mobile-First Precision Down to 320px, Zero Layout Shift (CLS), Accessible
   Zero External Dependencies | 100% Self-Contained Vanilla Stack
   ============================================================================== */

:root {
  /* ==========================================================================
     LIGHT THEME VARIABLES (Executive Indian SaaS)
     Silky Cool Frost Background, Pure White Cards, Rich Saffron & Ashoka Navy
     ========================================================================== */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-input: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #ff671f;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  
  /* Indian National Palette */
  --primary: #ff671f;          /* Official Indian National Saffron */
  --primary-hover: #e65100;
  --primary-light: #fff7ed;
  --primary-glow: rgba(255, 103, 31, 0.25);
  
  --accent-green: #046a38;     /* Official Indian Forest Green */
  --accent-green-light: #ecfdf5;
  --accent-navy: #0a192f;      /* Deep Ashoka Navy Blue */
  --accent-navy-light: #eff6ff;
  --accent-red: #dc2626;
  --accent-red-light: #fef2f2;
  
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 6px 16px -2px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 12px 24px -4px rgba(255, 103, 31, 0.15), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  
  --modal-overlay: rgba(15, 23, 42, 0.7);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --badge-bg: #fff7ed;
  --badge-text: #c2410c;
  --highlight-bg: #f8fafc;
  --table-stripe: #f8fafc;
  --canvas-opacity: 0.65;
}

[data-theme="dark"] {
  /* ==========================================================================
     DARK / NIGHT THEME VARIABLES (Cyber Obsidian Slate)
     Deep Navy Obsidian Background, Glowing Saffron, Pure Crisp Text
     Guaranteed 100% Logo Visibility & No Black-on-Dark Elements
     ========================================================================== */
  --bg-body: #080c14;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-input: #0b1120;
  
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --border-focus: #ff7a18;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --primary: #ff7a18;          /* Radiant Glowing Saffron */
  --primary-hover: #ffa044;
  --primary-light: #1e293b;
  --primary-glow: rgba(255, 122, 24, 0.35);
  
  --accent-green: #10b981;
  --accent-green-light: #064e3b;
  --accent-navy: #38bdf8;
  --accent-navy-light: #1e3a8a;
  --accent-red: #f87171;
  --accent-red-light: #7f1d1d;
  
  --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  --card-shadow-hover: 0 12px 28px -2px rgba(255, 122, 24, 0.22);
  
  --modal-overlay: rgba(0, 0, 0, 0.85);
  --nav-bg: rgba(11, 17, 30, 0.94);
  --badge-bg: rgba(255, 122, 24, 0.16);
  --badge-text: #fdba74;
  --highlight-bg: #141f33;
  --table-stripe: #111a2c;
  --canvas-opacity: 0.45;
}

/* ==============================================================================
   DUAL-MODE LOGO SWITCHER (CSS Level + JS Fallback)
   ============================================================================== */
[data-theme="dark"] .brand-logo-img {
  content: url('/logo-dark.svg');
}

/* ==============================================================================
   BASE RESET, BOX MODEL & ACCESSIBLE TYPOGRAPHY
   ============================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* 3D Interactive Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: var(--canvas-opacity);
}

.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Headings & Text */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.65rem, 4.5vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.85rem); margin-top: 2rem; }
h3 { font-size: clamp(1.1rem, 2.4vw, 1.4rem); margin-top: 1.5rem; }
p { margin-bottom: 1rem; color: var(--text-muted); word-break: break-word; overflow-wrap: break-word; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ==============================================================================
   HEADER & NAVIGATION
   Top Tricolor Accent Line, High-Contrast Brand, Responsive Height
   ============================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.25s ease, background 0.25s ease;
}

/* Indian National Flag Ribbon at Top of Header */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #FF671F 0%, #FFA044 30%, #FFFFFF 50%, #10B981 70%, #046A38 100%);
  z-index: 101;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 44px;
  width: auto;
  max-width: 220px;
  display: block;
  aspect-ratio: 440 / 80;
  object-fit: contain;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

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

/* Language Dropdown */
.lang-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 1.8rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.lang-icon-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* Theme Switcher Toggle */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hamburger Button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile Nav Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1.25rem;
  z-index: 99;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  display: flex;
}

.mobile-drawer .nav-link {
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
}

/* ==============================================================================
   HERO SECTION
   ============================================================================== */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 103, 31, 0.25);
  box-shadow: 0 2px 6px rgba(255, 103, 31, 0.08);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.2;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #FF671F 0%, #1E3A8A 50%, #046A38 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-title .gradient-text {
  background: linear-gradient(135deg, #FF7A18 0%, #38BDF8 50%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 720px;
  margin: 0 auto 2.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.75rem;
}

.cat-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.cat-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.cat-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* ==============================================================================
   TOOLS GRID & CARDS (HOMEPAGE)
   ============================================================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--card-shadow-hover);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.cat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  letter-spacing: 0.04em;
}

.tool-name {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tool-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tool-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 44px;
}

.tool-cta-btn:hover {
  background: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tool-cta-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.tool-cta-btn:hover svg {
  transform: translateX(3px);
}

/* ==============================================================================
   SINGLE TOOL PAGE LAYOUT & WORKSPACE
   Zero Layout Shift (CLS) Architecture, Proper Alignment, Clean Grids
   ============================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  opacity: 0.5;
}

.tool-hero-header {
  margin-bottom: 2rem;
}

.tool-hero-header h1 {
  margin-bottom: 0.5rem;
}

.tool-hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 820px;
}

/* Tool Main Workspace Grid */
.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  margin-bottom: 3.5rem;
  align-items: start;
}

.tool-form-card, .tool-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.card-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-heading svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

/* Form Controls — 16px font prevents iOS zoom shift */
.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  flex-wrap: wrap;
  gap: 0.25rem;
}

.form-label .label-hint {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-dim);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 16px; /* Crucial: Prevents iOS auto-zoom */
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-range-wrapper {
  margin-top: 0.5rem;
  width: 100%;
}

.form-range {
  width: 100%;
  max-width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-subtle);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: block;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

/* ==============================================================================
   PREMIUM SAAS BUTTONS (MOBILE-FIRST, PROPORTIONAL, TACTILE)
   ============================================================================== */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

/* Primary Action Buttons (Calculate, Generate, Check) */
.btn-primary, .btn-primary-calc {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF671F 0%, #E65100 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 3px 10px rgba(255, 103, 31, 0.28);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary svg, .btn-primary-calc svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary:hover, .btn-primary-calc:hover {
  background: linear-gradient(135deg, #FF7722 0%, #D84315 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(255, 103, 31, 0.38);
  color: #ffffff !important;
}

.btn-primary:active, .btn-primary-calc:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(255, 103, 31, 0.25);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary-calc {
  background: linear-gradient(135deg, #FF7A18 0%, #EA580C 100%);
  box-shadow: 0 3px 12px rgba(255, 122, 24, 0.3);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary-calc:hover {
  background: linear-gradient(135deg, #FFA044 0%, #FF671F 100%);
  box-shadow: 0 5px 18px rgba(255, 122, 24, 0.4);
}

/* Secondary Action Buttons (Reset) */
.btn-secondary, .btn-secondary-reset {
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary svg, .btn-secondary-reset svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-secondary:hover, .btn-secondary-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary:active, .btn-secondary-reset:active {
  transform: scale(0.98);
}

/* Tactile Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Result Action Toolbar (Copy Result & Print Summary) */
.result-toolbar {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.tool-btn-action {
  flex: 1 1 140px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Copy Button Specifics */
.btn-copy-result, #bf-copy-btn, #gap-copy-btn, #noc-copy-btn, #nd-copy-btn, #sl-copy-btn {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
}

.btn-copy-result:hover, #bf-copy-btn:hover, #gap-copy-btn:hover, #noc-copy-btn:hover, #nd-copy-btn:hover, #sl-copy-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(255, 103, 31, 0.15);
}

/* Print Button Specifics (High Prominence) */
.btn-print-result, #bf-print-btn, #gap-print-btn, #noc-print-btn, #nd-print-btn, #sl-print-btn {
  background: linear-gradient(135deg, #0A192F 0%, #1E3A8A 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 3px 10px rgba(10, 25, 47, 0.22);
}

.btn-print-result:hover, #bf-print-btn:hover, #gap-print-btn:hover, #noc-print-btn:hover, #nd-print-btn:hover, #sl-print-btn:hover {
  background: linear-gradient(135deg, #0F172A 0%, #2563EB 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.32);
  color: #ffffff !important;
}

[data-theme="dark"] .btn-print-result,
[data-theme="dark"] #bf-print-btn,
[data-theme="dark"] #gap-print-btn,
[data-theme="dark"] #noc-print-btn,
[data-theme="dark"] #nd-print-btn,
[data-theme="dark"] #sl-print-btn {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%) !important;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.32);
}

/* ==============================================================================
   CALCULATION RESULT CONTAINER
   ============================================================================== */
.result-banner {
  background: var(--primary-light);
  border: 1px solid rgba(255, 103, 31, 0.25);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.result-banner-label {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--badge-text);
  margin-bottom: 0.35rem;
}

.result-banner-value {
  font-size: clamp(1.6rem, 4.5vw, 2.35rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  word-break: break-word;
}

/* Stats Metric Grid */
.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  background: var(--bg-surface-elevated);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  word-break: break-word;
}

.stat-item-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.stat-item-value {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* Distribution / Progress Bar */
.calc-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--border-subtle);
  overflow: hidden;
  display: flex;
  margin: 1.25rem 0;
}

.calc-bar-invested {
  background: var(--primary);
  height: 100%;
}

.calc-bar-returns {
  background: var(--accent-green);
  height: 100%;
}

/* Eligibility Result Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
}

.status-badge.eligible {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.not-eligible {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.conditional {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Action Toolbar (Copy, Print, Share) */
.result-toolbar {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.tool-btn-action {
  flex: 1 1 120px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn-action:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.tool-btn-action svg {
  width: 16px;
  height: 16px;
}

/* ==============================================================================
   CERTIFICATE GENERATOR UI & PRINTABLE DOCUMENT
   Full Mobile Responsiveness, Zero Overlap, Clean Typography
   ============================================================================== */
.certificate-preview-box {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 5px double #0a192f;
  border-radius: 8px;
  padding: clamp(1.2rem, 3.5vw, 2.5rem);
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  font-family: 'Times New Roman', Times, serif;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.cert-header {
  text-align: center;
  border-bottom: 2px solid #0a192f;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  word-break: break-word;
}

.cert-emblem {
  width: 50px;
  height: 50px;
  margin: 0 auto 0.5rem;
  display: block;
}

.cert-org-name {
  font-size: clamp(1.2rem, 3.8vw, 1.65rem);
  font-weight: bold;
  text-transform: uppercase;
  color: #0a192f;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.cert-org-sub {
  font-size: clamp(0.85rem, 2.4vw, 0.95rem);
  color: #475569;
}

.cert-org-affil {
  font-size: clamp(0.78rem, 2.2vw, 0.85rem);
  color: #475569;
  margin-top: 0.25rem;
}

.cert-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #334155;
  font-style: italic;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cert-title {
  text-align: center;
  font-size: clamp(1.1rem, 3.5vw, 1.45rem);
  font-weight: bold;
  text-decoration: underline;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  letter-spacing: 0.06em;
  color: #0f172a;
  word-break: break-word;
}

.cert-body {
  font-size: clamp(0.92rem, 2.5vw, 1.05rem);
  line-height: 1.85;
  text-align: justify;
  margin-bottom: 2.5rem;
  color: #1e293b;
  word-break: normal;
  overflow-wrap: break-word;
}

.cert-fill {
  font-weight: bold;
  text-decoration: underline;
  padding: 0 3px;
  color: #0f172a;
}

.cert-footer-signatures {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cert-sig-block {
  text-align: center;
  min-width: 130px;
}

.cert-sig-line {
  border-top: 1px dashed #475569;
  margin-top: 1.5rem;
  padding-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: bold;
  color: #334155;
}

.cert-seal-box {
  width: 80px;
  height: 80px;
  border: 1px dashed #94a3b8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  margin: 0 auto;
}

/* ==============================================================================
   LONG SEO ARTICLE SECTION & TABLES
   Zero Horizontal Layout Shift, Smooth Scrolling for Wide Tables
   ============================================================================== */
.seo-article-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  margin-bottom: 3.5rem;
  box-shadow: var(--card-shadow);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.seo-article-section h2 {
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-top: 2.2rem;
}

.seo-article-section h3 {
  margin-top: 1.5rem;
  color: var(--primary);
}

.seo-article-section ul, .seo-article-section ol {
  margin-left: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.seo-article-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Guaranteed Horizontal Scroll for Data Tables on Mobile */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  display: block;
}

.styled-table {
  width: 100%;
  min-width: 460px; /* Ensures columns stay legible on mobile */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.styled-table th {
  background: var(--bg-surface-elevated);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.styled-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.styled-table tr:nth-child(even) {
  background: var(--table-stripe);
}

/* Callout Alert */
.callout-box {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
  border-left: 4px solid;
  background: var(--bg-surface-elevated);
}

.callout-box.info {
  border-color: var(--primary);
}

.callout-box.warning {
  border-color: #f59e0b;
}

.callout-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

/* ==============================================================================
   FAQ ACCORDION SECTION
   No Layout Shift, Touch Friendly Toggles
   ============================================================================== */
.faq-section {
  margin-bottom: 3.5rem;
  width: 100%;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: var(--primary);
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.25s ease;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Related Tools Section */
.related-tools-section {
  margin-bottom: 3.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1.25rem;
}

/* Legal & Disclaimer Box */
.disclaimer-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 3.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ==============================================================================
   FOOTER
   Indian Tricolor Ribbon, Responsive Multi-Column, Copyright
   ============================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF671F 0%, #FFA044 30%, #FFFFFF 50%, #10B981 70%, #046A38 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color 0.2s;
  display: inline-block;
  padding: 0.2rem 0;
}

.footer-links a:hover {
  color: var(--primary);
}

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

/* ==============================================================================
   MOBILE RESPONSIVENESS & BREAKPOINTS (320px - 920px)
   Guarantees zero horizontal overflow, no text overlap, touch targets >= 44px
   ============================================================================== */

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

@media (max-width: 768px) {
  /* Sleek, Proportional Mobile Buttons (Side-by-Side & Compact) */
  .form-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: stretch;
    width: 100%;
    margin-top: 1.25rem;
  }
  .btn-primary, .btn-primary-calc {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(255, 103, 31, 0.22);
  }
  .btn-primary svg, .btn-primary-calc svg {
    width: 15px;
    height: 15px;
  }
  .btn-secondary, .btn-secondary-reset {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0.55rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    gap: 0.35rem;
  }
  .btn-secondary svg, .btn-secondary-reset svg {
    width: 14px;
    height: 14px;
  }
  .result-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.25rem;
  }
  .tool-btn-action {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    gap: 0.35rem;
  }
  .tool-btn-action svg {
    width: 15px;
    height: 15px;
  }

  .header-inner {
    height: 64px;
  }
  .brand-logo-img {
    height: 36px;
    max-width: 150px;
  }
  .nav-desktop {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .header-actions {
    gap: 0.45rem;
  }
  .lang-select {
    padding: 0.35rem 1.4rem 0.35rem 0.55rem;
    font-size: 0.8rem;
    max-width: 90px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .result-stats-grid {
    grid-template-columns: 1fr;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .tool-form-card, .tool-result-card, .seo-article-section {
    padding: 1.25rem 1rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .cert-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .cert-footer-signatures {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  .hero {
    padding: 2rem 0 1.5rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-desc {
    font-size: 0.95rem;
  }
  .category-tabs {
    gap: 0.4rem;
    margin-bottom: 1.75rem;
  }
  .cat-tab-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
  }
  .tool-card {
    padding: 1.25rem 1rem;
  }
  .tool-form-card, .tool-result-card, .seo-article-section {
    padding: 1rem 0.85rem;
    border-radius: 14px;
  }
  .card-heading {
    font-size: 1.15rem;
    margin-bottom: 1.15rem;
  }
  .form-actions {
    display: flex;
    flex-direction: row;
    gap: 0.45rem;
  }
  .btn-primary, .btn-primary-calc {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  .btn-secondary, .btn-secondary-reset {
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
  }
  .result-banner {
    padding: 1.15rem 0.85rem;
  }
  .result-banner-value {
    font-size: 1.75rem;
  }
  .stat-item-value {
    font-size: 1.05rem;
  }
  .result-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .tool-btn-action {
    min-height: 38px;
    padding: 0.45rem 0.5rem;
    font-size: 0.82rem;
  }
  .certificate-preview-box {
    padding: 1.25rem 0.85rem;
  }
  .cert-org-name {
    font-size: 1.25rem;
  }
  .cert-title {
    font-size: 1.15rem;
  }
  .cert-body {
    font-size: 0.92rem;
    line-height: 1.75;
  }
  .faq-question {
    padding: 1rem;
    font-size: 0.95rem;
  }
  .faq-answer {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
  }
}

/* 320px Strict Minimal Viewport Guard */
@media (max-width: 359px) {
  .form-actions {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
  }
  .btn-primary, .btn-primary-calc {
    min-height: 38px;
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
  }
  .btn-secondary, .btn-secondary-reset {
    min-height: 38px;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
  }
  .result-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }
  .tool-btn-action {
    min-height: 36px;
    padding: 0.35rem 0.4rem;
    font-size: 0.76rem;
  }
  .tool-btn-action svg {
    width: 13px;
    height: 13px;
  }

  .container {
    padding: 0 0.5rem;
  }
  .header-inner {
    height: 58px;
    gap: 0.25rem;
  }
  .brand-logo-img {
    height: 30px;
    max-width: 120px;
  }
  .lang-select {
    max-width: 72px;
    padding: 0.3rem 1.1rem 0.3rem 0.4rem;
    font-size: 0.72rem;
  }
  .theme-toggle-btn, .mobile-menu-btn {
    width: 32px;
    height: 32px;
  }
  .theme-toggle-btn svg, .mobile-menu-btn svg {
    width: 16px;
    height: 16px;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .result-banner-value {
    font-size: 1.5rem;
  }
  .stat-item {
    padding: 0.75rem 0.6rem;
  }
}

/* ==============================================================================
   CLEAN PRINT CSS
   Prints purely the document/calculation results without page furniture
   ============================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  #bg-canvas, .site-header, .site-footer, .breadcrumb, .tool-hero-header,
  .tool-form-card, .result-toolbar, .seo-article-section, .faq-section,
  .related-tools-section, .disclaimer-card, .mobile-drawer, .cat-tab-btn,
  .tool-cta-btn {
    display: none !important;
  }
  .app-wrapper, .container, .tool-workspace, .tool-result-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }
  .certificate-preview-box {
    box-shadow: none !important;
    border: 3px double #000000 !important;
    page-break-inside: avoid;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 2cm !important;
  }
  .cert-org-name, .cert-title {
    color: #000000 !important;
  }
}
