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

:root {
  --blue: #0038a8;
  --red: #ce1126;
  --yellow: #fcd116;
  --bg: #fafafa;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --card: #fff;
  --green: #16a34a;
  --orange: #ea580c;
  --critical: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --text: #e5e5e5;
    --muted: #999;
    --border: #2a2a2a;
    --card: #1a1a1a;
  }
}

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

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* When embedded in an iframe, hide the header logo/tagline and footer links —
 * the parent WordPress site already provides them. */
body.is-embedded header,
body.is-embedded footer .footer-text {
  display: none;
}
body.is-embedded .container {
  padding-top: 0;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--blue);
}

.tagline {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.tagline-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* Form */
.input-group {
  display: flex;
  gap: 0.5rem;
}

#url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s;
}

#url-input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
}

#submit-btn {
  padding: 0.75rem 1.5rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

#submit-btn:hover { opacity: 0.9; }
#submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Loading */
#loading {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

#loading-text {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Error */
.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .error-box {
    background: #2d1111;
    border-color: #5c2020;
  }
}

.error-box p { margin-bottom: 0.75rem; color: var(--critical); }
.error-box button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--critical);
  background: transparent;
  color: var(--critical);
  border-radius: 6px;
  cursor: pointer;
}

/* Score */
.score-section {
  text-align: center;
  padding: 2rem 0;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background: conic-gradient(var(--score-color, var(--muted)) calc(var(--score-pct, 0) * 3.6deg), var(--border) 0);
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--card);
}

.score-number {
  position: relative;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  position: relative;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-low { background: #dcfce7; color: #166534; }
.risk-medium { background: #fef9c3; color: #854d0e; }
.risk-high { background: #fed7aa; color: #9a3412; }
.risk-critical { background: #fecaca; color: #991b1b; }

@media (prefers-color-scheme: dark) {
  .risk-low { background: #14532d; color: #bbf7d0; }
  .risk-medium { background: #713f12; color: #fef08a; }
  .risk-high { background: #7c2d12; color: #fed7aa; }
  .risk-critical { background: #7f1d1d; color: #fecaca; }
}

.recommendation {
  margin-top: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Breakdown */
.breakdown {
  margin: 1.5rem 0;
}

.breakdown h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.breakdown-item {
  margin-bottom: 1.25rem;
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.breakdown-score { font-weight: 700; }

.bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  width: 0;
}

.reasons {
  list-style: none;
  margin-top: 0.4rem;
}

.reasons li {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 1em;
  position: relative;
}

.reasons li::before {
  content: '·';
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Flags */
.flags-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 480px) {
  .flags-section { grid-template-columns: 1fr; }
}

.flags {
  padding: 1rem;
  border-radius: 8px;
}

.flags h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.red-flags {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.green-flags {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

@media (prefers-color-scheme: dark) {
  .red-flags { background: #1c0a0a; border-color: #5c2020; }
  .green-flags { background: #0a1c0f; border-color: #1b5c2e; }
}

.flags ul {
  list-style: none;
}

.flags li {
  font-size: 0.85rem;
  padding: 0.2rem 0;
}

/* Summary */
.summary-section {
  margin: 1.5rem 0;
}

.summary-section h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.summary-fil {
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Share */
.share-section {
  text-align: center;
  margin: 1.5rem 0;
}

#share-btn {
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

#share-btn:hover { background: var(--blue); color: #fff; }

.share-social {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.share-social-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#share-fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
#share-twitter:hover { background: #000; color: #fff; border-color: #000; }

@media (prefers-color-scheme: dark) {
  #share-twitter:hover { background: #e7e9ea; color: #0f1419; border-color: #e7e9ea; }
}

/* Disclaimer */
.disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

/* Stats / Footer */
footer {
  margin-top: 3rem;
  text-align: center;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.lang-switcher a {
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.lang-switcher a:hover {
  color: var(--blue);
  border-color: var(--border);
}

.lang-switcher a.active {
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 600;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.social-links a {
  color: var(--muted);
  transition: color 0.2s;
  display: flex;
}

.social-links a[aria-label="Facebook"]:hover { color: #1877f2; }
.social-links a[aria-label="Instagram"]:hover { color: #E4405F; }
.social-links a[aria-label="X (Twitter)"]:hover { color: var(--text); }

.footer-text {
  font-size: 0.75rem;
  color: var(--muted);
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Score colors helper */
.score-green { --score-color: #16a34a; }
.score-yellow { --score-color: #eab308; }
.score-orange { --score-color: #ea580c; }
.score-red { --score-color: #dc2626; }


/* Ad container */
.ad-container {
  margin: 1.5rem 0;
  min-height: 100px;
  text-align: center;
}

/* Page content (about, privacy, terms, blog) */
.page-content h2 { margin-bottom: 1rem; font-size: 1.5rem; }
.page-content h3 { margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }
.page-content p, .page-content li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content a { color: var(--blue); }
.updated, .blog-date { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.blog-card { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.blog-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.blog-card h3 a { text-decoration: none; color: var(--text); }
.blog-card h3 a:hover { color: var(--blue); }
.footer-text a { color: var(--muted); text-decoration: none; }
.footer-text a:hover { color: var(--blue); }

/* Header row with user menu */
.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.user-menu {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.user-email {
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.user-menu-link:hover {
  text-decoration: underline;
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
}

.auth-modal.hidden {
  display: none !important;
}

.auth-modal-card {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.auth-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.auth-modal-close {
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  padding: 0.25rem;
}

.auth-modal-close:hover {
  color: var(--text);
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.auth-field input {
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

.auth-field input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
}

.auth-error {
  color: var(--critical);
  font-size: 0.85rem;
  margin: 0;
}

.auth-submit-btn {
  padding: 0.7rem 1rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-submit-btn:hover { opacity: 0.9; }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-google-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: not-allowed;
}

.auth-toggle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1rem;
}

.auth-toggle a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* Scan counter */
.scan-counter {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

/* Upgrade banner */
.upgrade-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  margin-top: 1rem;
}

.upgrade-banner p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.upgrade-banner-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.upgrade-banner-link:hover {
  opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
  .upgrade-banner {
    background: #1e293b;
    border-color: #334155;
  }
}

/* Premium page */
.premium-hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.premium-hero h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.premium-hero p {
  color: var(--muted);
  font-size: 1rem;
}

.current-plan {
  text-align: center;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.current-plan strong {
  color: var(--blue);
}

.premium-benefits {
  margin: 1.5rem 0;
}

.premium-benefits h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.benefit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.benefit-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.benefit-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 480px) {
  .pricing-cards { grid-template-columns: 1fr; }
}

.pricing-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--blue);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.pricing-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.pricing-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.pricing-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pricing-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.pricing-cta:hover { opacity: 0.9; }
.pricing-cta:disabled, .pricing-cta.disabled { opacity: 0.5; cursor: not-allowed; }

.pricing-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  font-style: italic;
}

/* Navigation bar */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.nav-bar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.nav-bar a:hover {
  color: var(--blue);
}

.nav-bar a.active {
  color: var(--blue);
  background: #eff6ff;
}

@media (prefers-color-scheme: dark) {
  .nav-bar a.active { background: #1e293b; }
}

