:root {
  --bg: #e5e7eb;
  --card: #ffffff;
  --accent: #4338ca;
  --muted: #4b5563;
  --danger: #ef4444;
  --radius: 12px;
  --container-w: 1000px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: #111827;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.body-no-scroll {
  overflow: hidden;
}

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem;
  background: #000;
  color: #fff;
  z-index: 9999;
}

/* Header & Navigation */
.site-header {
  background: var(--card);
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.site-header nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
}

.site-header nav .logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.site-header nav .logo-link img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover {
  background: #f3f4f6;
  color: var(--accent);
}

.nav-links a.active {
  font-weight: 600;
  color: var(--accent);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Cards */
.card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
  margin: 1rem 0;
}

.card-main {
  margin-top: 2rem;
}

.card-secondary {
  margin-top: 22px;
}

/* Forms */
.form .label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.dual {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.column {
  flex: 1;
  min-width: 220px;
}

.column h3 {
  margin-top: 1rem;
}

.grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.form-item .input {
  flex: 1;
}

.form-item .weight {
  flex: 0 0 80px;
}

.form-item .btn-remove {
  background: transparent;
  color: var(--muted);
  padding: 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.form-item .btn-remove:hover {
  color: var(--danger);
}

/* Buttons */
button,
a.btn-primary,
a.btn-outline,
a.btn-ghost,
a.btn-danger {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

button:focus,
a.btn-primary:focus,
a.btn-outline:focus,
a.btn-ghost:focus,
a.btn-danger:focus {
  outline: 3px solid rgba(79, 70, 229, 0.2);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: var(--muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover {
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #3730a3 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 56, 202, 0.4);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-ghost {
  background: #eef2ff;
  color: #4338ca;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.1);
}

.btn-ghost:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Results */
.result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.result-yes {
  background: #dcfce7;
  color: #166534;
}

.result-no {
  background: #fee2e2;
  color: #991b1b;
}

.result-balanced {
  background: #fef9c3;
  color: #854d0e;
}

.chart {
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  display: block;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 1rem;
  background: var(--card);
  margin-top: auto;
}

.site-footer .footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .footer-content a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}

.site-footer .footer-content a:hover {
  color: var(--accent);
}

/* Popup */
.popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1002;
  padding: 1rem;
}

.popup-content {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.popup-logo {
  display: block;
  margin: 0 auto 1rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

/* Utility Classes */
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Page-specific styles */
.page-about .grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.page-about .cta {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #0ea5a4;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
}

.page-about .cta:hover {
  background: #0d9493;
}

.page-legal .section {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.page-about summary {
  cursor: pointer;
  font-weight: 600;
}

/* Blog post styles */
.step-card,
.reason-card,
.bias-card,
.tip-card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

blockquote {
  border-left: 4px solid #cbd5e1;
  padding-left: 1rem;
  margin-left: 0;
  font-style: italic;
  color: var(--muted);
}

.post {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.post .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.post h2,
.post h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.post .excerpt {
  color: var(--muted);
  margin: 0.75rem 0;
}

.read-more {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.list-styled {
  padding-left: 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Ad slots */
.ad-slot-top,
.ad-slot-bottom {
  margin: 1.5rem 0;
  text-align: center;
}

/* Popular Decisions Section */
.popular-decisions {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
}

.popular-decisions .section-title {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.decisions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.decision-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.decision-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.15);
  border-color: var(--accent);
  background: linear-gradient(135deg, #fff 0%, #eef2ff 100%);
}

.decision-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.decision-text {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

.decision-arrow {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.decision-card:hover .decision-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Template Cards - Special styling */
.template-card {
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) border-box;
}

.template-card:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%) padding-box,
    linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) border-box;
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.25);
}

.templates-section {
  background: linear-gradient(135deg, #faf5ff 0%, #f0f9ff 100%);
  border: 1px solid #e9d5ff;
}

.templates-section .section-title {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Share Section */
.share-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.share-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-share svg {
  flex-shrink: 0;
}

.btn-share-whatsapp {
  background: #25d366;
  color: #fff;
}

.btn-share-whatsapp:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.btn-share-twitter {
  background: #0f1419;
  color: #fff;
}

.btn-share-twitter:hover {
  background: #272c30;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 20, 25, 0.35);
}

.btn-share-copy {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.btn-share-copy:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.btn-share-copied {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}

/* Template Section */
.template-section {
  margin-top: 2rem;
}

.template-section h2 {
  margin-bottom: 0.5rem;
}

.template-section .grid-2cols {
  margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }

  .site-header nav {
    padding: 1rem;
  }

  .site-header nav .logo-link img {
    width: 48px;
    height: 48px;
  }

  .brand {
    font-size: 1.25rem;
  }

  /* Show mobile menu button */
  .mobile-menu-btn {
    display: flex;
  }

  /* Hide nav links by default on mobile */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 300px;
    height: 100vh;
    background: var(--card);
    flex-direction: column;
    padding: 4rem 1rem 1rem;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    gap: 0;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
  }

  .grid-2cols {
    grid-template-columns: 1fr;
  }

  .dual {
    flex-direction: column;
  }

  .page-about .grid {
    grid-template-columns: 1fr;
  }

  .site-footer .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .form-item {
    flex-wrap: wrap;
  }

  .form-item .weight {
    flex: 0 0 70px;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1.1rem;
  }

  .card {
    padding: 1rem;
  }

  .input {
    font-size: 14px;
  }

  button,
  a.btn-primary,
  a.btn-outline,
  a.btn-ghost,
  a.btn-danger {
    padding: 0.65rem 1.25rem;
    font-size: 14px;
  }

  .popup-content {
    padding: 1rem;
  }
}