:root {
  --pfc-primary: #1D9E75;
  --pfc-primary-dark: #157a5a;
  --pfc-accent: #f4a261;
  --pfc-bg: #f8f9fa;
  --pfc-card: #ffffff;
  --pfc-text: #1a1f1d;
  --pfc-muted: #6b7280;
  --pfc-border: #e5e7eb;
  --pfc-danger: #dc2626;
  --pfc-radius: 12px;
  --pfc-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

.pfc-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--pfc-text);
  line-height: 1.5;
  box-sizing: border-box;
}

.pfc-container *,
.pfc-container *::before,
.pfc-container *::after { box-sizing: border-box; }

.pfc-header { text-align: center; margin-bottom: 32px; }
.pfc-header h1 { font-size: 2rem; margin: 0 0 8px; color: var(--pfc-primary-dark); }
.pfc-subtitle { color: var(--pfc-muted); font-size: 0.95rem; margin: 0; }

.pfc-card {
  background: var(--pfc-card);
  border: 1px solid var(--pfc-border);
  border-radius: var(--pfc-radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--pfc-shadow);
}

.pfc-card h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; margin: 0 0 20px;
}

.pfc-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--pfc-primary); color: #fff;
  border-radius: 50%; font-size: 0.85rem; font-weight: 700;
  flex-shrink: 0;
}

.pfc-hint { color: var(--pfc-muted); font-size: 0.875rem; margin: -8px 0 16px; }

.pfc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.pfc-field { display: flex; flex-direction: column; gap: 6px; }
.pfc-field label { font-size: 0.875rem; font-weight: 600; color: var(--pfc-text); }

.pfc-field input[type="text"],
.pfc-field input[type="number"],
.pfc-field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--pfc-border);
  border-radius: 8px; font-size: 0.95rem;
  background: #fff; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pfc-field input:focus,
.pfc-field select:focus {
  outline: none; border-color: var(--pfc-primary);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}

.pfc-field small { font-size: 0.75rem; color: var(--pfc-muted); }
.pfc-input-group { display: flex; gap: 8px; }
.pfc-input-group input { flex: 1; }
.pfc-input-group select { width: auto; min-width: 110px; }
.pfc-field input[type="range"] { accent-color: var(--pfc-primary); width: 100%; }

/* BCS FIELD */
.pfc-bcs-field {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

.pfc-bcs-help { font-size: 0.8rem; color: #065f46; margin: 0 0 12px; }
.pfc-bcs-help a { color: var(--pfc-primary); font-weight: 600; }

.pfc-bcs-emoji-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 20px;
  transition: background 0.3s;
  border: 1px solid #d1fae5;
}

.pfc-bcs-emoji {
  font-size: 110px;
  line-height: 1;
  transition: font-size 0.25s ease, filter 0.25s ease;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.pfc-bcs-emoji-label {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pfc-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pfc-bcs-emoji-wrap.pfc-state-thin { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-color: #bfdbfe; }
.pfc-bcs-emoji-wrap.pfc-state-ideal { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #bbf7d0; }
.pfc-bcs-emoji-wrap.pfc-state-over { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fecaca; }

.pfc-state-thin .pfc-bcs-emoji-label { color: #1d4ed8; }
.pfc-state-ideal .pfc-bcs-emoji-label { color: #15803d; }
.pfc-state-over .pfc-bcs-emoji-label { color: #b91c1c; }

.pfc-bcs-scale {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--pfc-muted);
  margin-top: 6px;
}
.pfc-bcs-scale #pfc-bcs-value { font-weight: 700; color: var(--pfc-primary-dark); }

/* BCS GUIDE */
.pfc-bcs-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.pfc-bcs-guide-item {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--pfc-border);
}

.pfc-bcs-guide-item h4 { margin: 4px 0 10px; font-size: 1rem; }

.pfc-bcs-guide-item ul {
  margin: 0; padding-left: 18px;
  font-size: 0.85rem; line-height: 1.6;
  color: var(--pfc-text);
}

.pfc-bcs-guide-range {
  display: inline-block;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 2px 10px;
  border-radius: 6px;
  background: #fff;
}

.pfc-bcs-thin { background: #eff6ff; border-color: #bfdbfe; }
.pfc-bcs-thin .pfc-bcs-guide-range { color: #1d4ed8; }

.pfc-bcs-ideal { background: #f0fdf4; border-color: #bbf7d0; }
.pfc-bcs-ideal .pfc-bcs-guide-range { color: #15803d; }

.pfc-bcs-heavy { background: #fef2f2; border-color: #fecaca; }
.pfc-bcs-heavy .pfc-bcs-guide-range { color: #b91c1c; }

/* ACTIONS */
.pfc-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center; margin: 24px 0;
}

.pfc-btn {
  padding: 12px 24px; border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  font-family: inherit;
}
.pfc-btn:active { transform: scale(0.98); }

.pfc-btn-primary {
  background: var(--pfc-primary); color: #fff;
  flex: 1; min-width: 220px; font-size: 1rem; padding: 14px 32px;
}
.pfc-btn-primary:hover { background: var(--pfc-primary-dark); }

.pfc-btn-secondary {
  background: #fff; color: var(--pfc-text);
  border: 1px solid var(--pfc-border);
}
.pfc-btn-secondary:hover { background: var(--pfc-bg); }

/* FREE TAG */
.pfc-freetag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #065f46;
}
.pfc-freetag-icon { font-size: 1rem; }

/* GATE NOTE */
.pfc-gate-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 620px;
  margin: 12px auto 0;
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.5;
}
.pfc-gate-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }

/* RESULTS */
.pfc-results {
  border-top: 4px solid var(--pfc-primary);
  animation: pfc-fadeIn 0.3s ease-out;
}
@keyframes pfc-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.pfc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}

.pfc-stat {
  background: var(--pfc-bg); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}

.pfc-stat-label {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--pfc-muted); font-weight: 600;
}

.pfc-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--pfc-primary-dark); }

.pfc-stat-highlight {
  background: linear-gradient(135deg, var(--pfc-primary), var(--pfc-primary-dark));
}
.pfc-stat-highlight .pfc-stat-label { color: rgba(255,255,255,0.85); }
.pfc-stat-highlight .pfc-stat-value { color: #fff; }

.pfc-note {
  background: #fffbeb; border-left: 4px solid var(--pfc-accent);
  padding: 12px 16px; border-radius: 6px;
  font-size: 0.9rem; margin-bottom: 16px;
  white-space: pre-line;
}

.pfc-disclaimer {
  background: #fef2f2; border-left: 4px solid var(--pfc-danger);
  padding: 12px 16px; border-radius: 6px;
  font-size: 0.85rem; color: #7f1d1d; margin-bottom: 16px;
}

/* AMAZON CTA */
.pfc-amazon-cta {
  display: flex; gap: 16px; align-items: flex-start;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.pfc-amazon-icon { font-size: 2.2rem; flex-shrink: 0; line-height: 1; }
.pfc-amazon-body { flex: 1; }

.pfc-amazon-body h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #7c2d12;
  font-weight: 700;
}

.pfc-amazon-body p {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.5;
}

.pfc-amazon-btn {
  display: inline-block;
  background: #ff9900;
  color: #111;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  border: 1px solid #e88b00;
}

.pfc-amazon-btn:hover { background: #ffb84d; transform: translateY(-1px); }

.pfc-amazon-disclosure {
  font-size: 0.7rem !important;
  color: #78350f !important;
  margin: 10px 0 0 !important;
  font-style: italic;
}

/* PRINT-ONLY */
.pfc-print-header,
.pfc-print-profile,
.pfc-print-footer { display: none; }
.pfc-screen-only { display: block; }

/* ============================================================
   AUTH MODAL
   ============================================================ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-modal[hidden] { display: none; }

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 28px;
  animation: auth-modal-in 0.25s ease-out;
  color: #1a1f1d;
}

@keyframes auth-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.auth-modal-close:hover { background: #e5e7eb; color: #111; }

.auth-modal-tabs {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.auth-tab-active {
  background: #fff;
  color: #1D9E75;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-modal-message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.auth-modal-message.auth-msg-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-modal-message.auth-msg-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.auth-panel { display: none; }
.auth-panel-active { display: block; }

.auth-modal-lead {
  font-size: 0.9rem;
  color: #4b5563;
  margin: 0 0 16px;
  line-height: 1.5;
}

.auth-panel label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.auth-panel input[type="text"],
.auth-panel input[type="email"],
.auth-panel input[type="password"],
.auth-panel input[type="tel"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.auth-panel input:focus {
  outline: none;
  border-color: #1D9E75;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}

.auth-panel small {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 400;
}

.auth-submit {
  width: 100%;
  padding: 13px 20px;
  background: #1D9E75;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  margin-top: 4px;
}
.auth-submit:hover { background: #157a5a; }
.auth-submit:active { transform: scale(0.98); }

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  margin: 16px 0 0;
}

.auth-switch a {
  color: #1D9E75;
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-modal-note {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}

body.auth-modal-open { overflow: hidden; }

@media (max-width: 600px) {
  .pfc-header h1 { font-size: 1.5rem; }
  .pfc-card { padding: 18px; }
  .pfc-stat-value { font-size: 1.1rem; }
  .pfc-amazon-cta { flex-direction: column; align-items: center; text-align: center; }
  .pfc-amazon-icon { font-size: 2rem; }
  .pfc-bcs-emoji { font-size: 80px; }
  .auth-modal-content { padding: 22px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {

  body > header,
  body > footer,
  header.navbar,
  footer,
  nav,
  .navbar,
  .nav-links,
  .site-header,
  .site-footer,
  aside {
    display: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 14mm 12mm;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
    line-height: 1.4;
    font-family: Georgia, "Times New Roman", serif;
  }

  .pfc-header,
  .pfc-card:not(.pfc-results),
  .pfc-actions,
  .pfc-screen-only,
  .auth-modal {
    display: none !important;
  }

  .pfc-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .pfc-results {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: none !important;
  }

  .pfc-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #1D9E75;
    padding-bottom: 10px;
    margin-bottom: 18px;
    gap: 16px;
  }

  .pfc-print-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16pt;
    font-weight: 700;
    color: #1D9E75;
  }

  .pfc-print-logo { font-size: 18pt; }
  .pfc-print-brand-name { color: #1D9E75; }

  .pfc-print-meta { text-align: right; font-size: 9pt; }
  .pfc-print-title { font-weight: 700; font-size: 11pt; color: #111; }
  .pfc-print-date { color: #555; font-size: 8.5pt; margin-top: 2px; }

  .pfc-results h2 { font-size: 14pt; margin: 0 0 12px; color: #111; display: block !important; }

  .pfc-result-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 18px !important;
    margin-bottom: 14px !important;
  }

  .pfc-stat {
    background: #f7f9f8 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .pfc-stat-highlight {
    background: #e8f5ef !important;
    border-color: #1D9E75 !important;
  }

  .pfc-stat-label {
    font-size: 9pt !important;
    color: #444 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
  }

  .pfc-stat-value {
    font-size: 11pt !important;
    color: #111 !important;
    font-weight: 700 !important;
  }

  .pfc-stat-highlight .pfc-stat-label,
  .pfc-stat-highlight .pfc-stat-value { color: #111 !important; }

  .pfc-print-profile {
    display: block !important;
    margin: 14px 0;
    page-break-inside: avoid;
  }

  .pfc-print-profile h3 {
    font-size: 11pt;
    margin: 0 0 8px;
    color: #1D9E75;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 4px;
  }

  .pfc-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
  }

  .pfc-print-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
  }

  .pfc-print-table td:first-child { width: 38%; color: #555; }
  .pfc-print-table td:last-child { color: #111; }

  .pfc-note {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 9.5pt !important;
    color: #78350f !important;
    margin: 12px 0 !important;
    white-space: pre-line !important;
    page-break-inside: avoid;
  }

  .pfc-disclaimer {
    background: #fef2f2 !important;
    border-left: 3px solid #dc2626 !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 8.5pt !important;
    color: #7f1d1d !important;
    margin: 12px 0 !important;
    page-break-inside: avoid;
  }

  .pfc-print-footer {
    display: block !important;
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid #d1d5db;
    font-size: 8pt;
    color: #666;
    text-align: center;
    line-height: 1.5;
  }

  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .pfc-results h2,
  .pfc-result-grid,
  .pfc-print-profile,
  .pfc-note,
  .pfc-disclaimer,
  .pfc-print-footer {
    page-break-inside: avoid;
  }
}
/* ============================================================
   SEO ARTICLE
   ============================================================ */
.pfc-seo-article {
  max-width: 960px;
  margin: 48px auto 24px;
  padding: 32px 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1f1d;
  line-height: 1.7;
  border-top: 1px solid #e5e7eb;
}

.pfc-article-header {
  margin-bottom: 28px;
}

.pfc-article-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #157a5a;
  margin: 0 0 12px;
  line-height: 1.25;
}

.pfc-article-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
}

.pfc-article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1f1d;
  margin: 32px 0 12px;
  line-height: 1.3;
}

.pfc-article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1f1d;
  margin: 24px 0 8px;
}

.pfc-article-body p {
  font-size: 1rem;
  margin: 0 0 16px;
  color: #374151;
}

.pfc-article-body strong { color: #111; font-weight: 700; }

.pfc-article-body a {
  color: #1D9E75;
  text-decoration: underline;
  text-decoration-color: rgba(29, 158, 117, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.pfc-article-body a:hover {
  text-decoration-color: #1D9E75;
}

.pfc-article-body ul,
.pfc-article-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  font-size: 1rem;
  color: #374151;
}

.pfc-article-body li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.pfc-faq-item {
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}

.pfc-faq-item:last-child { border-bottom: none; }

.pfc-faq-item h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #1a1f1d;
  margin: 0 0 6px;
}

.pfc-faq-item p {
  margin: 0;
  font-size: 0.95rem;
  color: #4b5563;
}

.pfc-article-cta {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 1rem;
  margin: 28px 0 0;
  text-align: center;
  font-weight: 600;
}

.pfc-article-cta a {
  color: #157a5a;
  font-weight: 700;
}

@media (max-width: 600px) {
  .pfc-seo-article { padding: 24px 16px; margin-top: 32px; }
  .pfc-article-header h2 { font-size: 1.4rem; }
  .pfc-article-body h2 { font-size: 1.15rem; }
  .pfc-article-body h3 { font-size: 1rem; }
}

/* Hide article on print */
@media print {
  .pfc-seo-article { display: none !important; }
}