/* ===== עיצוב ראשי - משא בקליק ===== */

  :root {
    --primary: #1a3a5c;
    --primary-light: #2a5298;
    --accent: #e8a020;
    --accent-light: #f5c55a;
    --success: #2e7d32;
    --error: #c62828;
    --bg: #f7f9fc;
    --bg-card: #ffffff;
    --text: #1a2332;
    --text-muted: #5a6a7a;
    --border: #d8e3ee;
    --shadow: 0 2px 16px rgba(26,58,92,0.10);
    --shadow-hover: 0 6px 32px rgba(26,58,92,0.18);
    --radius: 14px;
  }

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

  body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
  }

  /* ---- HEADER ---- */
  header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(26,58,92,0.3);
  }
  .header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .logo-icon {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
  }
  .logo-text h1 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
  }
  .logo-text span {
    font-size: 0.78rem;
    opacity: 0.8;
    font-weight: 300;
  }
  .header-cta {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  .header-cta:hover { background: var(--accent-light); transform: translateY(-1px); }

  /* ---- HERO ---- */
  .hero {
    background: linear-gradient(160deg, var(--primary) 0%, #1e4976 60%, #2a5298 100%);
    color: white;
    padding: 60px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .hero::before {
    content: '🚛';
    position: absolute;
    font-size: 280px;
    opacity: 0.04;
    left: -40px;
    top: -40px;
    pointer-events: none;
  }
  .hero-badge {
    display: inline-block;
    background: rgba(232,160,32,0.2);
    border: 1px solid rgba(232,160,32,0.5);
    color: var(--accent-light);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
  }
  .hero h2 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 16px;
  }
  .hero h2 span { color: var(--accent-light); }
  .hero p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 580px;
    margin: 0 auto 36px;
    font-weight: 300;
    line-height: 1.7;
  }
  .hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
  }
  .stat { text-align: center; }
  .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
    display: block;
    font-family: 'Frank Ruhl Libre', serif;
  }
  .stat-label { font-size: 0.82rem; opacity: 0.7; }

  /* ---- MAIN LAYOUT ---- */
  .main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
  }

  /* ---- SIDEBAR ---- */
  .sidebar { position: sticky; top: 80px; }
  .sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
  }
  .sidebar-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
  }
  .chapter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
    font-size: 0.9rem;
    text-align: right;
    transition: all 0.2s;
    margin-bottom: 4px;
    color: var(--text);
    position: relative;
  }
  .chapter-btn:hover { background: var(--bg); }
  .chapter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
  }
  .chapter-btn .ch-num {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: rgba(26,58,92,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  .chapter-btn.active .ch-num { background: rgba(255,255,255,0.2); color: white; }
  .chapter-btn .ch-lock {
    margin-right: auto;
    font-size: 0.75rem;
    opacity: 0.5;
  }
  .chapter-btn.locked { opacity: 0.6; }

  .progress-wrap { margin-top: 8px; }
  .progress-label {
    display: flex; justify-content: space-between;
    font-size: 0.82rem; color: var(--text-muted);
    margin-bottom: 6px;
  }
  .progress-bar {
    height: 6px; background: var(--border);
    border-radius: 3px; overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.5s ease;
  }

  .upgrade-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
  }
  .upgrade-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
  .upgrade-card p { font-size: 0.82rem; opacity: 0.85; margin-bottom: 16px; line-height: 1.5; }
  .upgrade-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
  }
  .upgrade-btn:hover { background: var(--accent-light); }
  .price-tag {
    margin-top: 12px;
    font-size: 0.82rem;
    opacity: 0.7;
  }
  .price-tag strong { color: var(--accent-light); font-size: 1.1rem; }

  /* ---- CONTENT AREA ---- */
  .content-area {}

  .chapter-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .chapter-icon {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
  }
  .chapter-meta h2 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .chapter-meta p { color: var(--text-muted); font-size: 0.88rem; }
  .chapter-actions { margin-right: auto; }
  .btn-quiz {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-quiz:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

  /* ---- QUIZ AREA ---- */
  .quiz-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .quiz-topbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
  }
  .quiz-topbar-info { font-size: 0.88rem; opacity: 0.9; }
  .quiz-topbar-num { font-weight: 800; font-size: 1.1rem; }
  .quiz-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.2);
  }
  .quiz-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
  }

  .question-card {
    padding: 18px 22px;
  }
  .question-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text);
  }
  .options-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
  .option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
    font-size: 0.92rem;
    text-align: right;
    transition: all 0.18s;
    color: var(--text);
  }
  .option-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    background: #f0f5ff;
  }
  .option-letter {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: all 0.18s;
  }
  .option-btn.correct {
    border-color: var(--success);
    background: #f0f9f0;
  }
  .option-btn.correct .option-letter {
    background: var(--success);
    border-color: var(--success);
    color: white;
  }
  .option-btn.wrong {
    border-color: var(--error);
    background: #fff5f5;
  }
  .option-btn.wrong .option-letter {
    background: var(--error);
    border-color: var(--error);
    color: white;
  }
  .option-btn:disabled { cursor: default; }

  .explanation {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f0f9f0;
    border-right: 4px solid var(--success);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--success);
    font-weight: 500;
    display: none;
  }
  .explanation.show { display: block; }
  .explanation.wrong-exp {
    background: #fff5f5;
    border-color: var(--error);
    color: var(--error);
  }

  .quiz-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .score-badge {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; color: var(--text-muted);
  }
  .score-num { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
  .btn-next {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
  }
  .btn-next.show { display: block; }
  .btn-next:hover { background: var(--accent-light); }

  /* ---- PAYWALL ---- */
  .paywall {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 32px;
    text-align: center;
    display: none;
  }
  .paywall.show { display: block; }
  .paywall-icon { font-size: 56px; margin-bottom: 20px; }
  .paywall h3 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--primary);
  }
  .paywall p { color: var(--text-muted); font-size: 1rem; margin-bottom: 32px; line-height: 1.7; max-width: 440px; margin-inline: auto; }
  .paywall-plans {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }
  .plan-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    min-width: 200px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
  }
  .plan-card:hover, .plan-card.recommended {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
  }
  .plan-card.recommended { background: #f0f5ff; }
  .plan-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .plan-price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    font-family: 'Frank Ruhl Libre', serif;
  }
  .plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
  .plan-name { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0 14px; }
  .plan-features { list-style: none; font-size: 0.85rem; text-align: right; }
  .plan-features li { padding: 4px 0; color: var(--text-muted); }
  .plan-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }
  .plan-btn {
    display: block;
    margin-top: auto;
    padding-top: 16px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
  }
  .plan-btn:hover { background: var(--primary-light); }

  /* ---- RESULTS ---- */
  .results-screen {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 32px;
    text-align: center;
    display: none;
  }
  .results-screen.show { display: block; }
  .result-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: 'Frank Ruhl Libre', serif;
  }
  .result-circle.pass { background: #e8f5e9; border: 4px solid var(--success); }
  .result-circle.fail { background: #ffebee; border: 4px solid var(--error); }
  .result-pct { font-size: 2.2rem; font-weight: 900; }
  .result-circle.pass .result-pct { color: var(--success); }
  .result-circle.fail .result-pct { color: var(--error); }
  .result-label { font-size: 0.8rem; color: var(--text-muted); }
  .results-screen h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }
  .results-screen p { color: var(--text-muted); margin-bottom: 28px; }
  .btn-retry {
    background: var(--primary);
    color: white;
    border: none;
    padding: 13px 32px;
    border-radius: 8px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 6px;
  }
  .btn-retry:hover { background: var(--primary-light); }

  /* ---- FREE CHAPTER NOTICE ---- */
  .free-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e6;
    border: 1px solid #f0d080;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: #7a5500;
  }

  /* ---- RESPONSIVE ---- */
  @media (max-width: 768px) {
    .main { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hero-stats { gap: 24px; }
  }