/* ============================================================
   AFZ SEO Cost Calculator — Styles v1.0.0
   © 2026 Aflah Zaman — https://aflahzaman.com
   
   ARCHITECTURE: Fully self-contained.
   - Owns its complete design system (colors, spacing, typography)
   - Does NOT inherit theme tokens
   - Dark mode is a one-way listener: when the host theme adds
     .dark or html.dark (or .dark-mode), our internal tokens flip.
     Nothing about the theme styles bleeds into our UI.
   ============================================================ */

/* ─── Reset (scoped) ─────────────────────────────────────────── */
.afz-seo-cost-calc-wrapper,
.afz-seo-cost-calc-wrapper *,
.afz-seo-cost-calc-wrapper *::before,
.afz-seo-cost-calc-wrapper *::after {
  box-sizing: border-box;
}

.afz-seo-cost-calc-wrapper button { margin: 0; }

/* ─── Design Tokens — Light Mode (Default) ──────────────────── */
.afz-seo-cost-calc-wrapper {
  /* Surfaces */
  --afz-bg:           #ffffff;
  --afz-surface:      #f8fafc;
  --afz-surface-alt:  #f1f5f9;
  --afz-border:       #e2e8f0;
  --afz-border-soft:  #f1f5f9;

  /* Text */
  --afz-text:         #0f172a;
  --afz-text-soft:    #334155;
  --afz-muted:        #64748b;
  --afz-subtle:       #94a3b8;

  /* Accents */
  --afz-accent:       #4f46e5;
  --afz-accent-soft:  rgba(79, 70, 229, 0.08);
  --afz-accent-text:  #ffffff;
  --afz-green:        #059669;
  --afz-green-soft:   rgba(5, 150, 105, 0.10);

  /* Buttons (primary action) */
  --afz-btn-bg:       #0f172a;
  --afz-btn-text:     #ffffff;

  /* Shadows */
  --afz-shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.04);
  --afz-shadow-md:    0 4px 16px rgba(15, 23, 42, 0.06);

  /* Layout */
  --afz-radius:       16px;
  --afz-radius-sm:    10px;
  --afz-radius-xs:    6px;
  --afz-font:         -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;

  /* Wrapper layout */
  font-family: var(--afz-font);
  color: var(--afz-text);
  max-width: 620px;
  margin: 0 auto;
  padding: 4px;
}

/* ─── Dark Mode — Listener Only ──────────────────────────────── */
/* Triggered when host theme/site adds the .dark class anywhere   */
/* up the tree. We flip OUR tokens — we don't read theme tokens.  */
html.dark .afz-seo-cost-calc-wrapper,
.dark .afz-seo-cost-calc-wrapper,
body.dark .afz-seo-cost-calc-wrapper,
.dark-mode .afz-seo-cost-calc-wrapper,
[data-theme="dark"] .afz-seo-cost-calc-wrapper {
  --afz-bg:          #0a0a0a;
  --afz-surface:     #141414;
  --afz-surface-alt: #1f1f1f;
  --afz-border:      #262626;
  --afz-border-soft: #1a1a1a;
  --afz-text:        #f8fafc;
  --afz-text-soft:   #cbd5e1;
  --afz-muted:       #94a3b8;
  --afz-subtle:      #64748b;
  --afz-accent-soft: rgba(99, 102, 241, 0.18);
  --afz-green-soft:  rgba(16, 185, 129, 0.18);
  --afz-btn-bg:      #ffffff;
  --afz-btn-text:    #0a0a0a;
  --afz-shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.5);
  --afz-shadow-md:   0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-card {
  background: var(--afz-bg);
  border: 1px solid var(--afz-border);
  border-radius: var(--afz-radius);
  padding: 40px 36px;
  box-shadow: var(--afz-shadow-md);
  animation: afz-fade-up 0.25s ease both;
}

@keyframes afz-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-progress {
  display: flex;
  gap: 5px;
  margin: 0 0 32px;
}

.afz-seo-cost-calc-wrapper .afz-progress-pip {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--afz-border);
  transition: background 0.3s ease;
}

.afz-seo-cost-calc-wrapper .afz-progress-pip.is-done   { background: var(--afz-green); }
.afz-seo-cost-calc-wrapper .afz-progress-pip.is-active { background: var(--afz-accent); }

/* ═══════════════════════════════════════════════════════════════
   STEP — HEADER
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-step-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--afz-muted);
  margin: 0 0 12px;
}

.afz-seo-cost-calc-wrapper .afz-step-question {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--afz-text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.afz-seo-cost-calc-wrapper .afz-step-hint {
  font-size: 14px;
  color: var(--afz-muted);
  line-height: 1.55;
  margin: 0 0 28px;
}

/* ═══════════════════════════════════════════════════════════════
   STEP — OPTIONS
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-options {
  display: grid;
  gap: 10px;
  margin: 0 0 28px;
}

.afz-seo-cost-calc-wrapper .afz-options.cols-2 { grid-template-columns: 1fr 1fr; }
.afz-seo-cost-calc-wrapper .afz-options.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.afz-seo-cost-calc-wrapper .afz-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 14px;
  border: 1.5px solid var(--afz-border);
  border-radius: var(--afz-radius-sm);
  background: var(--afz-bg);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--afz-font);
  color: var(--afz-text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.afz-seo-cost-calc-wrapper .afz-option:hover {
  border-color: var(--afz-accent);
  background: var(--afz-accent-soft);
  transform: translateY(-1px);
}

.afz-seo-cost-calc-wrapper .afz-option.is-selected {
  border-color: var(--afz-accent);
  background: var(--afz-accent-soft);
  box-shadow: 0 0 0 3px var(--afz-accent-soft);
}

.afz-seo-cost-calc-wrapper .afz-option:focus-visible {
  outline: 2px solid var(--afz-accent);
  outline-offset: 2px;
}

.afz-seo-cost-calc-wrapper .afz-option-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--afz-text);
  line-height: 1.25;
  margin: 0;
}

.afz-seo-cost-calc-wrapper .afz-option-desc {
  font-size: 12px;
  color: var(--afz-muted);
  line-height: 1.45;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   STEP — NAV
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.afz-seo-cost-calc-wrapper .afz-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--afz-font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.afz-seo-cost-calc-wrapper .afz-btn-primary {
  background: var(--afz-btn-bg);
  color: var(--afz-btn-text);
}

.afz-seo-cost-calc-wrapper .afz-btn-primary:hover:not(:disabled) {
  opacity: 0.85;
  transform: translateY(-1px);
}

.afz-seo-cost-calc-wrapper .afz-btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.afz-seo-cost-calc-wrapper .afz-btn-ghost {
  background: transparent;
  color: var(--afz-muted);
  padding: 11px 4px;
}

.afz-seo-cost-calc-wrapper .afz-btn-ghost:hover:not(:disabled) { color: var(--afz-text); }
.afz-seo-cost-calc-wrapper .afz-btn-ghost:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════
   RESULTS — TOP STRIP (badge + currency toggle)
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px;
  gap: 12px;
}

.afz-seo-cost-calc-wrapper .afz-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--afz-green);
  background: var(--afz-green-soft);
  padding: 6px 12px;
  border-radius: 99px;
}

.afz-seo-cost-calc-wrapper .afz-currency-toggle {
  display: inline-flex;
  background: var(--afz-surface-alt);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.afz-seo-cost-calc-wrapper .afz-currency-btn {
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--afz-font);
  border: none;
  border-radius: var(--afz-radius-xs);
  background: transparent;
  color: var(--afz-muted);
  cursor: pointer;
  letter-spacing: 0.06em;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.afz-seo-cost-calc-wrapper .afz-currency-btn.is-active {
  background: var(--afz-bg);
  color: var(--afz-text);
  box-shadow: var(--afz-shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS — HERO COST
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-cost-hero {
  text-align: center;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--afz-border-soft);
  margin: 0 0 28px;
}

.afz-seo-cost-calc-wrapper .afz-cost-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--afz-muted);
  margin: 0 0 14px;
}

.afz-seo-cost-calc-wrapper .afz-cost-amount {
  font-size: 38px;
  font-weight: 800;
  color: var(--afz-text);
  line-height: 1.1;
  letter-spacing: -0.025em;
  word-break: break-word;
  margin: 0;
}

.afz-seo-cost-calc-wrapper .afz-cost-period {
  font-size: 13px;
  color: var(--afz-muted);
  font-weight: 500;
  margin: 8px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS — BREAKDOWN
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-breakdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--afz-muted);
  margin: 0 0 18px;
}

.afz-seo-cost-calc-wrapper .afz-breakdown-item {
  margin: 0 0 16px;
}

.afz-seo-cost-calc-wrapper .afz-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
}

.afz-seo-cost-calc-wrapper .afz-breakdown-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--afz-text-soft);
  flex: 1;
  min-width: 0;
  margin: 0;
}

.afz-seo-cost-calc-wrapper .afz-breakdown-amount {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--afz-text);
  white-space: nowrap;
  margin: 0;
}

.afz-seo-cost-calc-wrapper .afz-bar-track {
  height: 5px;
  border-radius: 99px;
  background: var(--afz-surface-alt);
  overflow: hidden;
}

.afz-seo-cost-calc-wrapper .afz-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--afz-accent);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.afz-seo-cost-calc-wrapper .afz-bar-fill.bar-2 { background: #7c3aed; }
.afz-seo-cost-calc-wrapper .afz-bar-fill.bar-3 { background: #0891b2; }
.afz-seo-cost-calc-wrapper .afz-bar-fill.bar-4 { background: #d97706; }

/* ═══════════════════════════════════════════════════════════════
   RESULTS — DISCLAIMER
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-disclaimer {
  font-size: 11px;
  color: var(--afz-subtle);
  text-align: center;
  line-height: 1.6;
  margin: 24px 0 24px;
  padding: 0 8px;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS — CTA
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-cta-box {
  background: var(--afz-surface);
  border: 1px solid var(--afz-border);
  border-radius: var(--afz-radius-sm);
  padding: 24px 22px;
  text-align: center;
}

.afz-seo-cost-calc-wrapper .afz-cta-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--afz-text);
  line-height: 1.35;
  margin: 0 0 8px;
}

.afz-seo-cost-calc-wrapper .afz-cta-sub {
  font-size: 13px;
  color: var(--afz-muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.afz-seo-cost-calc-wrapper .afz-cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--afz-btn-bg) !important;
  color: var(--afz-btn-text) !important;
  text-decoration: none !important;
  padding: 13px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--afz-font);
  letter-spacing: 0.01em;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.afz-seo-cost-calc-wrapper .afz-cta-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none !important;
  color: var(--afz-btn-text) !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS — FOOTER (restart button)
   ═══════════════════════════════════════════════════════════════ */
.afz-seo-cost-calc-wrapper .afz-footer {
  text-align: center;
  margin: 18px 0 0;
}

.afz-seo-cost-calc-wrapper .afz-restart-btn {
  background: none;
  border: none;
  font-family: var(--afz-font);
  font-size: 12px;
  color: var(--afz-subtle);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease;
}

.afz-seo-cost-calc-wrapper .afz-restart-btn:hover { color: var(--afz-text); }

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .afz-seo-cost-calc-wrapper .afz-card,
  .afz-seo-cost-calc-wrapper .afz-bar-fill,
  .afz-seo-cost-calc-wrapper .afz-option,
  .afz-seo-cost-calc-wrapper .afz-btn,
  .afz-seo-cost-calc-wrapper .afz-cta-link,
  .afz-seo-cost-calc-wrapper .afz-currency-btn,
  .afz-seo-cost-calc-wrapper .afz-progress-pip {
    animation: none !important;
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤640px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .afz-seo-cost-calc-wrapper .afz-card           { padding: 32px 24px; }
  .afz-seo-cost-calc-wrapper .afz-options.cols-3 { grid-template-columns: 1fr 1fr; }
  .afz-seo-cost-calc-wrapper .afz-step-question  { font-size: 19px; }
  .afz-seo-cost-calc-wrapper .afz-cost-amount    { font-size: 30px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤480px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .afz-seo-cost-calc-wrapper .afz-card {
    padding: 24px 18px;
    border-radius: 12px;
    box-shadow: none;
  }

  .afz-seo-cost-calc-wrapper .afz-step-question { font-size: 18px; }

  .afz-seo-cost-calc-wrapper .afz-options.cols-2,
  .afz-seo-cost-calc-wrapper .afz-options.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Stack badge + currency toggle */
  .afz-seo-cost-calc-wrapper .afz-result-top {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
  }

  .afz-seo-cost-calc-wrapper .afz-cost-amount { font-size: 26px; }

  /* Stack breakdown rows */
  .afz-seo-cost-calc-wrapper .afz-breakdown-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .afz-seo-cost-calc-wrapper .afz-cta-link { width: 100%; padding: 14px 18px; }
  .afz-seo-cost-calc-wrapper .afz-cta-box  { padding: 20px 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Small Mobile (≤380px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .afz-seo-cost-calc-wrapper .afz-card { padding: 20px 14px; }

  .afz-seo-cost-calc-wrapper .afz-options.cols-2,
  .afz-seo-cost-calc-wrapper .afz-options.cols-3 {
    grid-template-columns: 1fr;
  }

  .afz-seo-cost-calc-wrapper .afz-cost-amount { font-size: 22px; }
}
