/* ==========================================================================
   ANC (Aseem and Consulting Pvt Ltd) - High-End Adaptive Theme System
   Light & Dark Mode: Apple Precision & Futuristic Tech Architecture
   ========================================================================== */

/* 1. Theme Color Variables */
:root {
  /* Default: Light Mode (Apple Clean Luxe) */
  --bg-page: #fbfbfd;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-elevated: #ffffff;
  --bg-nav: rgba(251, 251, 253, 0.8);
  
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(6, 182, 212, 0.4);
  --border-hover: rgba(59, 130, 246, 0.35);

  --text-title: #111827;
  --text-body: #4b5563;
  --text-muted: #6b7280;
  --text-accent: #0284c7;

  --accent-cyan: #06b6d4;
  --accent-blue: #2563eb;
  --accent-emerald: #10b981;

  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 20px 40px -10px rgba(6, 182, 212, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --aurora-gradient: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(6, 182, 212, 0.12), rgba(37, 99, 235, 0.06) 45%, transparent 75%);
  --badge-bg: rgba(6, 182, 212, 0.08);
  --badge-border: rgba(6, 182, 212, 0.2);
  --input-bg: #f3f4f6;
  --btn-primary-bg: #111827;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1f2937;
  --btn-sec-bg: #ffffff;
  --btn-sec-text: #1f2937;
  --btn-sec-border: rgba(0, 0, 0, 0.12);
}

/* 2. Dark Mode Override */
html.dark {
  --bg-page: #05070d;
  --bg-surface: #0b0f19;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-elevated: #0f172a;
  --bg-nav: rgba(5, 7, 13, 0.8);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.4);
  --border-hover: rgba(56, 189, 248, 0.35);

  --text-title: #f8fafc;
  --text-body: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
  --card-shadow-hover: 0 25px 50px -12px rgba(6, 182, 212, 0.18), 0 0 20px rgba(6, 182, 212, 0.1);
  --aurora-gradient: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(6, 182, 212, 0.22), rgba(37, 99, 235, 0.12) 45%, transparent 75%);
  --badge-bg: rgba(255, 255, 255, 0.05);
  --badge-border: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(255, 255, 255, 0.04);
  --btn-primary-bg: #ffffff;
  --btn-primary-text: #05070d;
  --btn-primary-hover: #f1f5f9;
  --btn-sec-bg: rgba(255, 255, 255, 0.05);
  --btn-sec-text: #e2e8f0;
  --btn-sec-border: rgba(255, 255, 255, 0.12);
}

/* Reset & Smooth Transitions */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, .floating-nav, .bento-card, .theme-toggle-btn, .btn-futuristic, .btn-futuristic-secondary {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', system-ui, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-title);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 6.5rem;
}

body {
  background-color: var(--bg-page);
  overflow-x: hidden;
  line-height: 1.55;
}

/* Ambient Top Aurora */
.aurora-bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1400px;
  height: 750px;
  background: var(--aurora-gradient);
  pointer-events: none;
  z-index: 0;
}

/* Floating Apple Navbar */
.floating-nav {
  background: var(--bg-nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--card-shadow);
  gap: 1rem 1.75rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.nav-brand img,
.footer-brand img {
  height: auto;
  width: auto;
}

.nav-brand img {
  height: 2.35rem;
  max-width: 168px;
}

@media (min-width: 640px) {
  .nav-brand img {
    height: 2.75rem;
    max-width: 200px;
  }
}

/* Theme-aware logos: do not set display on all imgs or Tailwind
   hidden/dark:block gets overridden and both marks stack. */
.logo-on-light { display: block; }
.logo-on-dark { display: none; }
html.dark .logo-on-light { display: none; }
html.dark .logo-on-dark { display: block; }

.site-footer {
  padding-top: 4.25rem;
  padding-bottom: 3.25rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-logo-link {
  display: block;
  overflow: hidden;
  max-width: 248px;
  max-height: 3.5rem;
  line-height: 0;
}

.footer-brand img {
  height: 2.85rem;
  max-width: 220px;
}

@media (min-width: 640px) {
  .footer-brand img {
    height: 3.25rem;
    max-width: 248px;
  }
}

@media (min-width: 768px) {
  .footer-brand {
    align-items: flex-start;
  }
}

.floating-nav:hover {
  border-color: var(--border-active);
}

/* Futuristic Bento Card with Spotlight */
.bento-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

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

.bento-card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, -150px);
  left: var(--mouse-x, -150px);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.16), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover::before {
  opacity: 1;
}

/* Typography Gradient */
.hero-gradient-text {
  background: linear-gradient(180deg, var(--text-title) 20%, var(--text-body) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cyan-gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .cyan-gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-futuristic {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-size: 0.925rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.btn-futuristic:hover {
  background: var(--btn-primary-hover);
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-futuristic-secondary {
  background: var(--btn-sec-bg);
  color: var(--btn-sec-text);
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-size: 0.925rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: 1px solid var(--btn-sec-border);
  cursor: pointer;
}

.btn-futuristic-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--text-accent);
  transform: scale(1.03);
}

/* Minimalist Tag */
.badge-minimal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--text-muted);
}

/* Inputs */
.minimal-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  padding: 0.85rem 1.1rem;
  color: var(--text-title);
  font-size: 0.9rem;
  outline: none;
}

.minimal-input:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-title);
  cursor: pointer;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Pipeline Simulator Styles */
.pipeline-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pipeline-node.active-pulse {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.25);
}

.pipeline-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #10b981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Modal Overlay */
.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.legal-modal-card {
  background: var(--bg-surface);
  color: var(--text-title);
  border: 1px solid var(--border-subtle);
  border-radius: 1.5rem;
  box-shadow: var(--card-shadow-hover);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.legal-modal-backdrop.active .legal-modal-card {
  transform: scale(1);
}

.legal-tab-btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 9999px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.legal-tab-btn.active {
  background: var(--bg-card-elevated);
  color: var(--accent-cyan);
  border-color: var(--border-active);
  box-shadow: var(--card-shadow);
}

/* Official IRD PAN verification links */
.ird-pan-link,
.ocr-reg-link {
  color: var(--text-accent);
  font-weight: 600;
  text-decoration: none;
}
.ird-pan-link:hover,
.ocr-reg-link:hover {
  text-decoration: underline;
  color: var(--accent-cyan);
}

/* Toast */
.toast-futuristic {
  padding: 0.85rem 1.5rem;
  border-radius: 9999px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent-cyan);
  color: var(--text-title);
  font-size: 0.875rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 0 20px rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
