/* ─── SynergyPix Stylesheet v4.54 ───────────────────────────────────────────── */

:root {
  --primary: #1a4fa0;
  --primary-dark: #0f3070;
  --primary-light: #3a6fc0;
  --accent: #2563eb;
  --power: #7c3aed;
  --pro: #059669;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  /* overflow: hidden removed — mobile nav drawer needs to escape the header bounds */
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
}

.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo-link img { height: 80px; width: auto; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tier-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.badge-free  { background: #e0e7ff; color: #3730a3; }
.badge-power { background: #fef3c7; color: #92400e; }
.badge-pro   { background: #d1fae5; color: #065f46; }

.btn-header {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-header:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

/* ─── Main Content ───────────────────────────────────────────────────────────── */
main { flex: 1; padding: 32px 24px; }

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

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Usage Counter ──────────────────────────────────────────────────────────── */
.usage-counter {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: none;
}

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ─── Drop Zone ──────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: #eff6ff;
}
.drop-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}
.drop-zone h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.drop-zone p {
  font-size: 13px;
  color: var(--text-muted);
}
.drop-zone input[type="file"] { display: none; }

/* ─── Image Analysis ─────────────────────────────────────────────────────────── */
.image-analysis {
  display: none;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 13px;
}
.analysis-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 12px;
}
.analysis-grid span:nth-child(odd) { color: var(--text-muted); font-weight: 500; }
.complexity-simple  { color: var(--success); font-weight: 600; }
.complexity-moderate { color: var(--warning); font-weight: 600; }
.complexity-complex { color: var(--error); font-weight: 600; }

/* ─── Preview ────────────────────────────────────────────────────────────────── */
.preview-section { display: none; }
.preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}

/* ─── Controls ───────────────────────────────────────────────────────────────── */
.controls-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.control-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.control-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.control-group select:focus { outline: none; border-color: var(--primary); }
.control-group select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-power {
  background: var(--power);
  color: white;
}
.btn-power:hover:not(:disabled) { background: #6d28d9; }

.btn-pro {
  background: var(--pro);
  color: white;
}
.btn-pro:hover:not(:disabled) { background: #047857; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: #eff6ff; }

.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-full { width: 100%; }

/* ─── Progress Bar ───────────────────────────────────────────────────────────── */
.progress-wrap { display: none; margin-top: 12px; }
.progress-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%) scaleX(0.5); }
  50%  { transform: translateX(0%) scaleX(0.5); }
  100% { transform: translateX(200%) scaleX(0.5); }
}

/* ─── Status Message ─────────────────────────────────────────────────────────── */
.status-msg {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}
.status-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ─── Output Section ─────────────────────────────────────────────────────────── */
.output-section { display: none; }
.svg-preview {
  min-height: 200px;
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.svg-preview svg {
  max-width: 100%;
  height: auto;
}
.format-preview {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px;
}

/* ─── What to Expect Section ─────────────────────────────────────────────────── */
.expect-section {
  margin-top: 48px;
  margin-bottom: 8px;
}
.expect-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.expect-section .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

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

.expect-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.expect-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.expect-icon-source  { background: #eff6ff; color: var(--primary); }
.expect-icon-best    { background: #fef9c3; color: #854d0e; }
.expect-icon-quality { background: #f0fdf4; color: var(--pro); }
.expect-icon-plan    { background: #f5f3ff; color: var(--power); }

.expect-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.expect-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Pricing Section ────────────────────────────────────────────────────────── */
.pricing-section { margin-top: 48px; }
.pricing-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.pricing-section .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-md);
}
.pricing-card.featured-power {
  border-color: var(--power);
  box-shadow: 0 0 0 2px #a78bfa, var(--shadow-md);
}
.pricing-card.featured-pro {
  border-color: var(--pro);
  box-shadow: 0 0 0 2px #34d399, var(--shadow-md);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.plan-badge-power { background: var(--power); color: white; }
.plan-badge-pro   { background: var(--pro); color: white; }

.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.plan-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.plan-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 36px;
}
.plan-features {
  list-style: none;
  margin-bottom: 20px;
}
.plan-features li {
  font-size: 13px;
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}
.plan-features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.plan-features li.unavailable { color: var(--text-light); }
.plan-features li.unavailable::before { content: '\2014'; color: var(--text-light); }

.plan-microcopy {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ─── FAQ Section ────────────────────────────────────────────────────────────── */
.faq-section {
  margin-top: 48px;
  margin-bottom: 16px;
}
.faq-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 24px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.faq-item summary {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '\2212';
}
.faq-item summary:hover { background: var(--bg); }

.faq-item p {
  padding: 0 18px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ─── Upgrade Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.modal-message {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo img { height: 48px; width: auto; opacity: 0.85; }
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--primary); }

/* ─── Hamburger Button ───────────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  z-index: 110;
  position: relative;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}
/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ─── Mobile Nav Drawer ──────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 105;
  padding: 8px 0 16px;
  /* Hidden by default — shown with .open class */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.mobile-nav.open {
  max-height: 480px;
}
.mob-nav-item {
  display: block;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.mob-nav-item:last-child { border-bottom: none; }
.mob-nav-item:hover, .mob-nav-item:active { background: var(--bg); }
.mob-nav-item.mob-signup {
  color: var(--primary);
  font-weight: 600;
}
.mob-nav-item.mob-logout {
  color: var(--error);
}

/* ─── Responsive: Tablet (max 768px) ────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { height: 72px; }
  .logo-link img { height: 56px; }

  .hero h1 { font-size: 1.65rem; }

  .expect-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  main { padding: 24px 16px; }
}

/* ─── Responsive: Mobile (max 640px) ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Switch to hamburger nav */
  .nav-hamburger  { display: flex; }
  .header-right   { display: none !important; }
  .mobile-nav     { display: block; }

  .header-inner {
    height: 64px;
    padding: 0 16px;
    /* Establishes the containing block for the absolutely-positioned mobile-nav */
    position: relative;
    overflow: visible;
  }
  .site-header {
    /* Allow mobile nav drawer to render below the sticky header */
    overflow: visible;
  }
  .logo-link img { height: 44px; }

  .hero h1 { font-size: 1.5rem; }
  .hero p  { font-size: 0.95rem; }

  .drop-zone { padding: 32px 16px; }
  .drop-zone-icon { font-size: 32px; }

  .controls-row { flex-direction: column; }
  .control-group { min-width: unset; }

  .card { padding: 16px; }

  .expect-grid { gap: 12px; grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; gap: 16px; }

  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { justify-content: center; }

  .modal-box { padding: 24px 16px; }
  .faq-item summary { padding: 12px 14px; font-size: 13px; }
}

/* ─── Responsive: Mobile (max 480px) ────────────────────────────────────────── */
@media (max-width: 480px) {
  .tier-badge { display: none; }
}

/* --- Before/After Slider Modal --- */
.ba-modal-box {
  max-width: 680px;
  width: 100%;
  padding: 28px 28px 24px;
}

.ba-slider-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

.ba-after,
.ba-before {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.ba-after { z-index: 1; }

.ba-before {
  z-index: 2;
  width: 50%;
  overflow: hidden;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: col-resize;
  touch-action: none;
}

.ba-handle-line {
  flex: 1;
  width: 2px;
  background: white;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.ba-handle-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-shrink: 0;
  color: var(--primary);
}

.ba-handle:focus { outline: none; }
.ba-handle:focus-visible .ba-handle-circle {
  box-shadow: 0 0 0 3px var(--primary), 0 2px 8px rgba(0,0,0,0.25);
}

.ba-label {
  position: absolute;
  bottom: 10px;
  z-index: 4;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}
.ba-label-before {
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: white;
}
.ba-label-after {
  right: 10px;
  background: rgba(26,79,160,0.85);
  color: white;
}

@media (max-width: 480px) {
  .ba-modal-box { padding: 20px 14px 18px; }
  .ba-slider-wrap { max-height: 300px; }
  .ba-handle-circle { width: 34px; height: 34px; }
}


/* Plan cancellation note */
.plan-cancel-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 8px 0 12px;
  text-align: left;
}

/* Manage Subscription header button (Pro users only) */
.btn-manage-sub {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.btn-manage-sub:hover {
  background: var(--primary);
  color: #fff;
}
.btn-manage-sub:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
