/* ================================================================
   style.css — EZ Stitch PES↔DST Converter
   Design inspired by DST Viewer: engineering grid, glassmorphism,
   Outfit font, fullscreen no-scroll canvas experience.
   Brand: #C11F2F
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --accent:       #C11F2F;
  --accent-dark:  #a01925;
  --accent-light: rgba(193,31,47,0.08);
  --navy:         #1e3a5f;
  --bg:           #f0f2f5;
  --surface:      rgba(255,255,255,0.96);
  --glass:        rgba(255,255,255,0.92);
  --border:       rgba(0,0,0,0.09);
  --text:         #2c3e50;
  --muted:        #7f8c8d;
  --success:      #10b981;
  --warn:         #f59e0b;
  --shadow:       0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
  --radius:       14px;
  --nav-h:        58px;
  --font:         'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: var(--nav-h);
  /* Engineering grid — from DST Viewer */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Converter screen — clean soft gradient, no grid */
body.on-converter {
  background-image: none;
  background: linear-gradient(135deg, #eef1f7 0%, #f5f0f6 50%, #edf4f1 100%);
}


/* ── Sticky Nav ───────────────────────────────────────────────── */
#sticky-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img { height: 34px; }

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

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  font-family: var(--font);
  white-space: nowrap;
}

.nav-btn-primary  { background: var(--accent); color: white; box-shadow: 0 2px 8px rgba(193,31,47,0.28); }
.nav-btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.nav-btn-ghost    { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.nav-btn-ghost:hover { background: rgba(255,255,255,0.8); color: var(--text); }

.nav-btn-accent   { background: var(--navy); color: white; }
.nav-btn-accent:hover { background: #16304f; transform: translateY(-1px); }

.nav-btn input[type="file"] { display: none; }

.nav-filename {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255,255,255,0.8);
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Screen Landing ───────────────────────────────────────────── */
#screen-landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px 16px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(193,31,47,0.25);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}

.swap-icon {
  color: var(--accent);
  display: inline-block;
  animation: pulse-swap 2.5s ease-in-out infinite;
}
@keyframes pulse-swap {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18) rotate(5deg); }
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 18px;
  line-height: 1.6;
}

.hero-upload-b.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.hero-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: white;
  padding: 16px 36px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 8px 24px rgba(193,31,47,0.36);
  margin-bottom: 8px;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}
.hero-upload-btn::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  animation: shine 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes shine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

.hero-upload-btn:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(193,31,47,0.38); }
.hero-upload-btn input { display: none; }

.hero-hint { font-size: 0.82rem; color: var(--muted); }

/* ── Format Cards ─────────────────────────────────────────────── */
.format-cards-container {
  position: relative;
  margin-bottom: 14px;
}
.format-glow {
  position: absolute;
  width: 45%; height: 80%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.12;
  top: 50%; transform: translateY(-50%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}
.glow-pes { left: 2%; }
.glow-dst { right: 2%; background: radial-gradient(circle, var(--navy) 0%, transparent 60%); opacity: 0.08; }

.format-cards {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 20px;
  align-items: stretch;
}

.format-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.format-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.format-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.format-icon svg { display: block; }

.format-card-header h2 { font-size: 1.25rem; font-weight: 800; }
.format-subtitle { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.format-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.format-features li { 
  font-size: 0.88rem; 
  padding: 3px 0; 
  display: flex;
  align-items: center;
  gap: 8px;
}
.feat-icon { flex-shrink: 0; }
.feat-icon.ok { color: var(--success); }
.feat-icon.warn { color: var(--warn); }
.feature-warn { color: #92400e; }

.format-conversion-note {
  background: rgba(248,250,252,0.9);
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  font-size: 0.84rem;
  display: none; /* collapsed by default */
  margin-top: 6px;
}
.format-conversion-note.open { display: block; }
.conversion-notes { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.conversion-notes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.conversion-notes .feat-icon { margin-top: 2px; }
.note-warn { color: #92400e; }
.note-ok   { color: #065f46; }

.card-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.card-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(193,31,47,0.28);
  font-family: var(--font);
}
.card-upload-btn:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(193,31,47,0.30); }
.card-upload-btn input { display: none; }

.card-upload-btn.btn-navy { background: var(--navy); box-shadow: 0 4px 12px rgba(30,58,95,0.25); }
.card-upload-btn.btn-navy:hover { background: #16304f; box-shadow: 0 6px 14px rgba(30,58,95,0.30); }

.format-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: 10px;
  transition: all 0.2s;
  border: 1px solid rgba(193,31,47,0.2);
}
.format-card-link:hover { background: rgba(193,31,47,0.12); }
.format-card-link.link-navy { color: var(--navy); background: rgba(30,58,95,0.06); border-color: rgba(30,58,95,0.15); }
.format-card-link.link-navy:hover { background: rgba(30,58,95,0.1); }

/* Arrow between cards */
.card-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}
.arrow-circle {
  width: 42px; height: 42px;
  background: var(--glass);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  box-shadow: var(--shadow);
}

/* Trust row */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.80rem;
  font-weight: 500;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

/* Lead Gen */
.lead-gen-banner {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.lead-gen-banner.compact-lead-gen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 18px 24px;
  gap: 20px;
}
.compact-lead-text h3 { margin-bottom: 4px; font-size: 1.15rem; }
.compact-lead-text p { margin-bottom: 0; font-size: 0.88rem; }

.lead-gen-banner h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 8px; }
.lead-gen-banner p { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; max-width: 600px; margin-inline: auto; line-height: 1.5; }
.lead-gen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(30,58,95,0.28);
  flex-shrink: 0;
}
.lead-gen-btn:hover { background: #16304f; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,58,95,0.35); }

/* Fullscreen Button */
.fullscreen-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.fullscreen-action-btn:hover { background: rgba(0,0,0,0.08); color: black; transform: translateY(-1px); }

/* drag over highlight */
#screen-landing.drag-over .hero-upload-btn {
  box-shadow: 0 0 0 3px var(--accent), 0 10px 26px rgba(193,31,47,0.4);
  transform: translateY(-2px) scale(1.02);
}

/* ── Screen Converter ─────────────────────────────────────────── */
#screen-converter {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px 32px;
}

/* File info bar */
#file-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  gap: 12px;
  flex-wrap: wrap;
}

.file-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}
.file-info-left svg { color: var(--muted); flex-shrink: 0; }

.file-meta-badge {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(193,31,47,0.22);
}

.file-info-right { display: flex; align-items: center; gap: 8px; }

/* Convert-another link */
.convert-another-link {
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px 10px;
  border-radius: 8px;
}
.convert-another-link:hover { color: var(--text); background: rgba(0,0,0,0.04); }

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: var(--font);
}
.action-chip:hover { background: #f1f5f9; }

.action-chip.accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(193,31,47,0.3);
}
.action-chip.accent:hover { 
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(193,31,47,0.4);
}

.action-chip.lead-chip {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  box-shadow: 0 3px 10px rgba(30,58,95,0.25);
}
.action-chip.lead-chip:hover { background: #16304f; transform: translateY(-1px); }

/* Download pulse on first appear */
@keyframes pulse-once {
  0%   { box-shadow: 0 0 0 0 rgba(193,31,47,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(193,31,47,0); }
  100% { box-shadow: 0 3px 10px rgba(193,31,47,0.25); }
}
.action-chip.accent.pulse { animation: pulse-once 0.8s ease-out forwards; }

#error-banner {
  background: rgba(254,242,242,0.95);
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Dual panels */
.dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.format-badge {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid var(--border);
}
.format-badge.accent {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(193,31,47,0.22);
}

/* Canvas container */
.canvas-container {
  position: relative;
  background: rgba(248,250,252,0.7);
  border-radius: 11px;
  aspect-ratio: 4/3;
  overflow: hidden;
  border: 1px solid var(--border);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  z-index: 5;
}

.canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 10;
}
.canvas-container.loaded canvas { opacity: 1; }
.canvas-container.loaded .empty-state { display: none; }
.canvas-2d { position: absolute; inset: 0; }

/* View toggle */
.view-toggle {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: 8px;
  display: flex;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  z-index: 20;
}
.view-toggle label {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  color: var(--muted);
  transition: all 0.18s;
  font-family: var(--font);
  user-select: none;
}
.view-toggle label:has(input:checked) {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 4px rgba(193,31,47,0.28);
}
.view-toggle input { display: none; }

/* Zoom hint overlay inside canvas */
.zoom-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.9);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
  z-index: 15;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s;
}
.canvas-container.loaded .zoom-hint { opacity: 1; }

/* Canvas stats */
.canvas-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.stat-item { font-weight: 500; }
.stat-value { font-weight: 700; color: var(--text); margin-left: 3px; }

/* Color panel */
.color-panel {
  background: var(--glass);
  backdrop-filter: blur(10px);
  padding: 22px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.color-panel h3 { font-size: 1.05rem; margin-bottom: 6px; }
.panel-sub { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.color-panel p { color: var(--muted); font-size: 0.87rem; margin-bottom: 16px; }

.swatch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 8px; /* space for scrollbar */
}
.swatch-list::-webkit-scrollbar { width: 10px; }
.swatch-list::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 8px; }
.swatch-list::-webkit-scrollbar-thumb {
  background: var(--navy);
  border-radius: 8px;
  border: 2px solid #f1f5f9;
}
.swatch-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.color-stop {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(248,250,252,0.9);
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  transition: all 0.18s;
}
.color-stop:hover { border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }

.swatch-preview {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14), inset 0 2px 4px rgba(0,0,0,0.15); /* 3D spool effect */
  flex-shrink: 0;
}
.stop-label { font-weight: 600; font-size: 0.84rem; min-width: 62px; }
.color-stop input[type="color"] {
  width: 26px; height: 26px;
  padding: 0; border: none; border-radius: 5px;
  cursor: pointer; background: transparent;
}
.color-stop input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-stop input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border); border-radius: 4px; }
.color-stop select {
  font-family: var(--font);
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  flex-grow: 1;
  outline: none;
  font-size: 0.82rem;
  cursor: pointer;
}
.color-stop select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(193,31,47,0.1); }
.thread-name {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
}

/* ── Loading Overlay ──────────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(240,242,245,0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s, visibility 0.3s;
}
#loading-overlay.hidden { opacity: 0; visibility: hidden; display: flex !important; }

.loading-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 44px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-width: 380px;
}
.loading-steps {
  list-style: none;
  text-align: left;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.loading-step.active { color: var(--accent); font-weight: 700; }
.loading-step.done   { color: var(--success); }
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.loading-step.active .step-dot { background: var(--accent); }
.loading-step.done   .step-dot { background: var(--success); }

.spinner {
  width: 46px; height: 46px;
  border: 3.5px solid #f1f5f9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
.spinner-sm {
  width: 26px; height: 26px;
  border: 2.5px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-text { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
#loading-subtext { font-size: 0.86rem; color: var(--muted); line-height: 1.6; }

/* ── Comparison Modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.50);
  backdrop-filter: blur(8px);
  z-index: 8888;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}
.modal-header h3 { font-size: 1.15rem; font-weight: 700; }
.modal-header-actions { display: flex; gap: 9px; align-items: center; }

.modal-btn-secondary {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text);
  transition: all 0.18s;
  font-family: var(--font);
}
.modal-btn-secondary:hover { background: #f1f5f9; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.modal-close:hover { background: #fef2f2; color: var(--accent); border-color: rgba(193,31,47,0.3); }

.integrity-banner {
  margin: 16px 24px 0;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
}
.integrity-banner.good { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.integrity-banner.warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.integrity-banner.bad  { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.report-table th, .report-table td {
  padding: 11px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.report-table th {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fafc;
}
.report-table td:first-child { font-weight: 600; }
.status-ok   { color: var(--success); font-weight: 600; }
.status-warn { color: var(--warn);    font-weight: 600; }

.issue-list {
  margin: 16px 24px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 18px;
}
.issue-list h4 { font-size: 0.95rem; font-weight: 700; color: #78350f; margin-bottom: 14px; }
.issue-item { background: white; border-radius: 9px; padding: 14px; margin-bottom: 10px; border: 1px solid #fde68a; }
.issue-item:last-child { margin-bottom: 0; }
.issue-title { font-weight: 700; font-size: 0.88rem; color: #92400e; margin-bottom: 5px; }
.issue-desc  { font-size: 0.84rem; color: #78350f; line-height: 1.6; }
.issue-verdict {
  margin-top: 8px; font-size: 0.8rem; font-weight: 600;
  padding: 4px 11px; border-radius: 99px; display: inline-block;
}
.verdict-safe    { background: #f0fdf4; color: #166534; }
.verdict-caution { background: #fffbeb; color: #92400e; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 0 0 var(--radius) var(--radius);
}
.modal-cta { color: var(--accent); font-size: 0.87rem; font-weight: 600; text-decoration: none; }
.modal-cta:hover { text-decoration: underline; }

/* ── Download Intercept Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.50);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.download-modal-content {
  max-width: 650px;
  background: white;
  border-radius: var(--radius);
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.download-modal-content .modal-header h3 { color: #b45309; } /* Darker amber for warning */

.download-modal-body {
  padding: 24px;
}
.download-disclaimer {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 16px;
  border-radius: 8px;
  color: #78350f;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}
.download-disclaimer strong {
  display: block;
  margin-top: 8px;
  color: #92400e;
}

.test-links {
  margin-bottom: 24px;
}
.test-links h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
}
.link-row {
  display: flex;
  gap: 12px;
}
.link-row a {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.link-row a:hover {
  border-color: var(--navy);
  background: #f8fafc;
  transform: translateY(-1px);
}

.premium-upsell {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #1e3a5f 0%, #152d4a 100%);
  padding: 20px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 8px 24px rgba(30,58,95,0.25);
}
.upsell-icon { font-size: 2rem; }
.upsell-text h4 { margin-bottom: 4px; font-size: 1.05rem; }
.upsell-text p { font-size: 0.85rem; opacity: 0.9; line-height: 1.4; }
.upsell-btn {
  background: var(--accent);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.2s;
}
.upsell-btn:hover {
  background: #e02436;
  box-shadow: 0 4px 12px rgba(193,31,47,0.3);
  transform: translateY(-1px);
}

.download-footer {
  display: flex;
  justify-content: flex-end;
  background: white;
  padding: 16px 24px;
}
.btn-primary {
  background: var(--text);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  background: black;
  transform: translateY(-1px);
}

/* ── Utilities ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .format-cards { grid-template-columns: 1fr; }
  .card-arrow { flex-direction: row; padding-top: 0; }
  .dual-panel { grid-template-columns: 1fr; }
  .nav-actions .nav-btn-ghost { display: none; }
  .hero-title { font-size: 1.9rem; }
  .mobile-overlay-container:not(.dismissed) { display: flex; z-index: 10000; }
}

/* Mobile Overlay Base */
.mobile-overlay-container { display: none; }
.mobile-modal {
  max-width: 90%;
  padding: 30px 24px;
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-lg);
}
