/* === RealEstatePractice — Design System (Education Theme) === */
:root {
  /* Clean/minimal palette — Slate + Amber */
  --primary: #334155;
  --primary-dark: #1e293b;
  --primary-light: #e2e8f0;
  --primary-bg: #f8fafc;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --error: #ef4444;
  --error-light: #fee2e2;
  --warning: #f59e0b;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg: #f8f9ff;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --max-width: 1100px;
  --content-width: 720px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* === Header === */
.site-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  padding: 0 1rem;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.25rem; color: white !important; text-decoration: none !important; }
.logo-icon { font-size: 1.5rem; }
.logo-text span { color: #fcd34d; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 500; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: white; }

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #1e293b, #334155, #475569);
  color: white;
  text-align: center;
  padding: 4rem 1rem 3rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: none; transition: all 0.2s; text-decoration: none !important;
}
.btn-primary { background: var(--accent); color: #1f2937; }
.btn-primary:hover { background: #e6900a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; backdrop-filter: blur(4px); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }

/* === Container === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Sections === */
.section { padding: 3rem 0; }
.section-title { text-align: center; font-size: 1.75rem; margin-bottom: 2rem; color: var(--text); }

/* === Trust Badges === */
.trust-badges {
  display: flex; justify-content: center; gap: 2rem;
  padding: 1.5rem 1rem; flex-wrap: wrap;
  background: var(--primary-bg);
}
.trust-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-secondary); }

/* === Card Grid === */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 1px solid var(--border); transition: all 0.2s;
  text-decoration: none !important; color: var(--text) !important;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.card .tag {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; margin-top: 0.75rem;
  background: var(--primary-light); color: var(--primary-dark);
}

/* === FAQ === */
.faq-section { background: var(--bg); padding: 3rem 1rem; }
.faq-section h2 { text-align: center; margin-bottom: 2rem; }
.faq-item {
  max-width: var(--content-width); margin: 0 auto 0.75rem;
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}
.faq-question {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-question:hover { background: var(--border-light); }
.faq-question .arrow { transition: transform 0.2s; }
.faq-question.active .arrow { transform: rotate(180deg); }
.faq-answer { display: none; padding: 0 1.25rem 1rem; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.faq-answer.open { display: block; }

/* === Footer === */
.site-footer {
  background: #1f2937; color: rgba(255,255,255,0.7);
  text-align: center; padding: 2rem 1rem; font-size: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,0.9); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ============ QUIZ ENGINE ============ */
.quiz-container { max-width: var(--content-width); margin: 0 auto; padding: 2rem 1rem; }
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.quiz-progress { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--text-secondary); }
.quiz-progress-bar {
  width: 200px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s;
}
.quiz-controls { display: flex; gap: 0.5rem; }
.quiz-btn {
  padding: 0.5rem 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s;
}
.quiz-btn:hover { background: var(--border-light); }
.quiz-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.question-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.question-number {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem;
}
.question-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 1.5rem; line-height: 1.5; }
.option {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem; margin-bottom: 0.5rem;
  border-radius: var(--radius); border: 2px solid var(--border);
  cursor: pointer; transition: all 0.15s; font-size: 0.95rem;
}
.option:hover { border-color: var(--primary); background: var(--primary-bg); }
.option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  background: var(--border-light); flex-shrink: 0;
}
.option.selected { border-color: var(--primary); background: var(--primary-bg); }
.option.selected .option-letter { background: var(--primary); color: white; }
.option.correct { border-color: var(--success); background: var(--success-light); }
.option.correct .option-letter { background: var(--success); color: white; }
.option.incorrect { border-color: var(--error); background: var(--error-light); }
.option.incorrect .option-letter { background: var(--error); color: white; }
.explanation {
  display: none; margin-top: 1rem; padding: 1rem;
  background: var(--primary-light); border-radius: var(--radius);
  font-size: 0.9rem; line-height: 1.6;
}
.explanation.visible { display: block; }
.explanation h4 { margin-bottom: 0.5rem; color: var(--primary-dark); }

.quiz-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem;
}
.nav-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Results === */
.results-panel {
  max-width: var(--content-width); margin: 0 auto; padding: 2rem 1rem;
  text-align: center;
}
.results-score {
  font-size: 3rem; font-weight: 800; color: var(--primary);
  margin: 1rem 0 0.5rem;
}
.results-label { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.results-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin: 2rem 0; padding: 1.5rem;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

.domain-scores { margin: 1.5rem 0; }
.domain-score {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light);
}
.domain-score:last-child { border-bottom: none; }
.domain-name { font-weight: 500; font-size: 0.9rem; }
.domain-score-value {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.75rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600;
}
.domain-score-value.above { background: var(--success-light); color: #065f46; }
.domain-score-value.target { background: var(--accent-light); color: #92400e; }
.domain-score-value.below { background: var(--error-light); color: #991b1b; }

/* === Flashcard === */
.flashcard-container {
  max-width: 500px; margin: 0 auto; perspective: 1000px; padding: 2rem 1rem;
}
.flashcard {
  width: 100%; height: 300px; position: relative;
  cursor: pointer; transform-style: preserve-3d;
  transition: transform 0.5s ease;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; text-align: center;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 1.1rem; line-height: 1.6;
}
.flashcard-back { transform: rotateY(180deg); background: var(--primary-bg); border-color: var(--primary); color: var(--primary-dark); font-weight: 500; }
.flashcard-controls {
  display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem;
}
.flashcard-counter { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; }

/* === Products === */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; max-width: 900px; margin: 0 auto;
}
.product-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 2rem; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.product-card.featured { border-color: var(--accent); position: relative; }
.product-card.featured::before {
  content: 'Best Value'; position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%); background: var(--accent);
  padding: 0.25rem 1rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
}
.product-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.product-price { font-size: 2rem; font-weight: 800; color: var(--primary); margin: 0.75rem 0; }
.product-price span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.product-cta { margin-top: auto; }
.btn-product {
  display: block; width: 100%; padding: 0.75rem;
  background: var(--primary); color: white; border: none;
  border-radius: var(--radius); font-weight: 600; cursor: pointer;
  transition: all 0.2s; text-decoration: none !important;
}
.btn-product:hover { background: var(--primary-dark); transform: translateY(-1px); }
.product-card.featured .btn-product { background: var(--accent); color: #1f2937; }
.product-card.featured .btn-product:hover { background: #e6900a; }

/* === Study Guide === */
.guide-content {
  max-width: var(--content-width); margin: 0 auto;
  padding: 2rem 1rem;
}
.guide-content h1 { font-size: 2rem; margin-bottom: 1rem; }
.guide-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.guide-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
.guide-content p { margin-bottom: 1rem; font-size: 1rem; line-height: 1.8; }
.guide-content ul, .guide-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.guide-content li { margin-bottom: 0.5rem; }
.guide-content table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
}
.guide-content th, .guide-content td {
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 0.95rem;
}
.guide-content th { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.callout {
  background: var(--primary-light); border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem; border-radius: var(--radius);
  margin: 1.5rem 0;
}
.callout-title { font-weight: 700; margin-bottom: 0.5rem; }

/* === Page Layout === */
.page-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white; padding: 2.5rem 1rem; text-align: center;
}
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { opacity: 0.85; font-size: 1.05rem; }
.breadcrumb {
  font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }

/* === Blog === */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.blog-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
  border: 1px solid var(--border); text-decoration: none !important;
  color: var(--text) !important; transition: all 0.2s;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.blog-card h3 { margin-bottom: 0.5rem; }
.blog-card p { font-size: 0.9rem; color: var(--text-secondary); }
.blog-date { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.75rem; }
.article-content { max-width: var(--content-width); margin: 0 auto; padding: 2rem 1rem; }
.article-content h1 { font-size: 2rem; margin-bottom: 1rem; }
.article-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.article-content p { margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.85; }

/* === Tracker Stats === */
.stats-grid {
  max-width: 500px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.stat-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 1.25rem; text-align: center;
  border: 1px solid var(--border);
}

/* === Hamburger Menu === */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; flex-direction: column; gap: 5px; z-index: 100; }
.hamburger span { display: block; width: 24px; height: 2px; background: white; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
#menu-toggle { display: none; }
#menu-toggle:checked ~ .nav-links { display: flex; }
#menu-toggle:checked ~ .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
#menu-toggle:checked ~ .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    z-index: 99;
  }
  .nav-links a { font-size: 0.95rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .site-header { position: relative; }
  .header-inner { position: relative; }
  .card-grid { grid-template-columns: 1fr; }
  .results-stats { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .quiz-header { flex-direction: column; gap: 0.75rem; }
  .quiz-progress-bar { width: 100%; }
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero h1 { font-size: 1.5rem; }
  .site-header .header-inner { height: 56px; }
}