/* ==============================================================================
   INSTAFLOW YOUTUBE DOWNLOADER - MODERN ULTRA-SLEEK DESIGN SYSTEM (VANILLA CSS)
   ============================================================================== */

:root {
  --bg-main: #07090e;
  --bg-card: rgba(15, 20, 32, 0.82);
  --bg-card-hover: rgba(22, 30, 48, 0.92);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --glow-primary: rgba(139, 92, 246, 0.4);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Complete Cross-Browser Scrollbar Hiding (Mobile + Desktop) */
html, body, * {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE & Edge */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Ambient Backdrop Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
}

.glow-3 {
  width: 450px;
  height: 450px;
  bottom: 10%;
  left: 20%;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
}

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

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==============================================================================
   STICKY NAVBAR
   ============================================================================== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.logo-icon.small {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.logo-accent {
  color: var(--accent-pink);
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Engine Status Pill */
.status-pill {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-pill:hover {
  background: rgba(16, 185, 129, 0.18);
  transform: translateY(-1px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.online {
  animation: pulseDot 1.8s infinite;
}

.status-dot.offline {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-tg {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-cyan);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
  transition: all var(--transition-fast);
}

.btn-tg:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* ==============================================================================
   HERO SECTION
   ============================================================================== */
.hero-section {
  position: relative;
  z-index: 10;
  padding: 60px 20px 40px;
}

.hero-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 22px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -1px;
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Downloader Card */
.downloader-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* Format Filter Tabs */
.format-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab-btn.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

/* Input Form */
.input-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.url-input {
  width: 100%;
  background: rgba(7, 10, 18, 0.7);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 105px 16px 48px;
  font-family: inherit;
  font-size: 0.96rem;
  color: #fff;
  outline: none;
  transition: all var(--transition-fast);
}

.url-input:focus {
  border-color: var(--border-focus);
  background: rgba(7, 10, 18, 0.95);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-paste {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-clear {
  position: absolute;
  right: 80px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear:hover {
  color: #fff;
}

.btn-submit {
  background: var(--grad-primary);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 28px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px var(--glow-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.6);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Quick Samples */
.quick-samples {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.sample-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ==============================================================================
   RESULTS SHOWCASE CONTAINER
   ============================================================================== */
.result-container {
  margin-top: 32px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.media-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 340px 1fr;
  text-align: left;
}

/* Preview Stage */
.preview-stage {
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  border-right: 1px solid var(--border-light);
}

.video-preview-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-preview-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.audio-preview-box {
  width: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.audio-poster {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-light);
}

.audio-preview-box audio {
  width: 100%;
  height: 38px;
}

/* Media Details Column */
.media-details {
  padding: 26px 24px;
}

.media-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge-quality {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.media-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #fff;
  word-break: break-word;
}

.media-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.author-avatar-box {
  display: flex;
  align-items: center;
}

.verified-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  background: #0284c7;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

/* Formats Grid */
.formats-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.format-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all var(--transition-fast);
}

.format-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.format-card.recommended {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
}

.card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quality-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: #fff;
}

.badge-1080 { background: linear-gradient(135deg, #a855f7, #ec4899); }
.badge-720 { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.badge-480 { background: rgba(255, 255, 255, 0.15); color: #cbd5e1; }
.badge-360 { background: rgba(255, 255, 255, 0.08); color: #94a3b8; }
.badge-audio { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.badge-m4a { background: linear-gradient(135deg, #10b981, #06b6d4); }
.badge-thumb { background: rgba(255, 255, 255, 0.15); color: #fff; }

.format-meta {
  display: flex;
  flex-direction: column;
}

.format-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.format-spec {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.btn-download-format {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-download-format:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-download-format.primary {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 4px 15px var(--glow-primary);
}

.btn-download-format.primary:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

.btn-download-format.audio-btn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.btn-download-format.audio-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* ==============================================================================
   FEATURES SECTION
   ============================================================================== */
.features-section,
.how-section,
.faq-section {
  padding: 80px 20px;
  position: relative;
  z-index: 10;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-tag {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  display: inline-block;
  margin-bottom: 10px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.icon-cyan { background: rgba(6, 182, 212, 0.12); color: #38bdf8; }
.icon-purple { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.icon-pink { background: rgba(236, 72, 153, 0.12); color: #f472b6; }
.icon-emerald { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.icon-amber { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.icon-rose { background: rgba(244, 63, 94, 0.12); color: #fb7185; }

.feature-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==============================================================================
   HOW IT WORKS SECTION
   ============================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  position: relative;
  transition: all var(--transition-fast);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.step-number {
  font-size: 2.8rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.08);
  line-height: 1;
  margin-bottom: 14px;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==============================================================================
   TELEGRAM BANNER
   ============================================================================== */
.tg-banner-section {
  padding: 40px 20px 80px;
  position: relative;
  z-index: 10;
}

.tg-banner-card {
  max-width: 1000px;
  margin: 0 auto;
  background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 40%),
              var(--bg-card);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.banner-pill {
  display: inline-block;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.banner-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.banner-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 26px;
  line-height: 1.6;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--grad-cyan);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px 30px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
  transition: all var(--transition-fast);
}

.banner-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ==============================================================================
   FAQ ACCORDION
   ============================================================================== */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 20px 22px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.faq-arrow {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-arrow {
  transform: rotate(180deg);
  color: #fff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-bottom: 20px;
}

/* ==============================================================================
   FOOTER
   ============================================================================== */
.footer {
  border-top: 1px solid var(--border-light);
  background: #04060a;
  padding: 40px 20px;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 600px;
}

.footer-bottom {
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 18px;
}

/* ==============================================================================
   ENGINE SETTINGS MODAL
   ============================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: #fff;
}

.modal-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.api-text-input {
  width: 100%;
  background: rgba(7, 10, 18, 0.8);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  color: #fff;
  outline: none;
  margin-bottom: 14px;
  transition: border-color var(--transition-fast);
}

.api-text-input:focus {
  border-color: var(--border-focus);
}

.ping-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.ping-dot.success { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.ping-dot.error { background: var(--accent-rose); box-shadow: 0 0 8px var(--accent-rose); }

.ping-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-ping {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-ping:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-save-settings {
  flex: 1.2;
  background: var(--grad-primary);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 20px var(--glow-primary);
  transition: all var(--transition-fast);
}

.btn-save-settings:hover {
  filter: brightness(1.1);
}

/* ==============================================================================
   TINY ERROR HANDLING MESSAGES & MICRO-FEEDBACK
   ============================================================================== */
.input-error-tiny {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 5px 12px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: var(--radius-sm);
  color: #fecdd3;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.input-error-tiny.hidden {
  display: none !important;
}

/* ==============================================================================
   TOAST NOTIFICATION (TINY, CRISP & REFINED)
   ============================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: all var(--transition-smooth);
  pointer-events: none;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(16px);
  max-width: 90vw;
  white-space: nowrap;
}

.toast.visible, .toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==============================================================================
   RESPONSIVE BREAKPOINTS (MOBILE & TABLET)
   ============================================================================== */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.4rem;
  }
  .features-grid,
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .media-card {
    grid-template-columns: 1fr;
  }
  .preview-stage {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2rem;
  }
  .input-form {
    flex-direction: column;
  }
  .btn-submit {
    height: 52px;
    padding: 0 20px;
  }
  .format-grid {
    grid-template-columns: 1fr;
  }
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .tg-banner-card {
    padding: 30px 20px;
  }
  .banner-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 40px 14px 20px;
  }
  .downloader-card {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
  }
  .url-input {
    padding: 14px 85px 14px 42px;
    font-size: 0.88rem;
  }
  .btn-paste span {
    display: none;
  }
  .btn-paste {
    padding: 6px 8px;
  }
  .status-text {
    display: none;
  }
  .status-pill {
    padding: 6px 8px;
  }
}
