/* צבעי המותג והגופנים של AviPro AI. כל הדפים משתמשים בקובץ הזה. */
:root {
  --navy: #16285A;
  --gold: #F2A900;
  --gold-on-dark: #FFC94D;
  --ai-on-white: #9A6500;
  --bg-dark: #0E1838;
  --text-muted: #4A5785;
  --by-light: #8790AE;
  --divider: #B8C0D6;
  --divider-dark: #3A4670;
  --bg-light: #F4F5F9;
  --white: #FFFFFF;
  --success: #1E7A4C;
  --danger: #B42318;

  --font-he: "Heebo", system-ui, sans-serif;
  --font-latin: "Lato", "Heebo", sans-serif;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 40, 90, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-he);
  background: var(--bg-light);
  color: var(--navy);
  line-height: 1.6;
}

body.dark {
  background: var(--bg-dark);
  color: var(--white);
}

a { color: var(--navy); }
.muted { color: var(--text-muted); }
body.dark .muted { color: var(--by-light); }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- לוגו ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo .mark { width: 30px; height: 30px; }
.logo .sep { width: 1px; height: 24px; background: var(--divider); }
.logo .ai { font-family: var(--font-latin); font-weight: 900; font-size: 1.5rem; color: var(--ai-on-white); line-height: 1; }
.logo .by { font-family: var(--font-latin); color: var(--by-light); font-size: 0.85rem; }
body.dark .logo .ai, .topbar .logo .ai { color: var(--gold-on-dark); }
.topbar .logo .sep { background: var(--divider-dark); }

/* ---------- סרגל עליון ---------- */
.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar nav { display: flex; align-items: center; gap: 16px; font-size: 0.95rem; }
.topbar a { color: var(--white); }
.topbar .who { color: var(--by-light); }

@media (max-width: 520px) {
  .topbar .who, .topbar .logo .by { display: none; }
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }

/* ---------- כפתורים וטפסים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  border: 0; border-radius: 999px;
  padding: 10px 22px; cursor: pointer;
  background: var(--gold); color: var(--navy);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--divider); }
.btn.small { padding: 6px 14px; font-size: 0.9rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); text-decoration: underline; cursor: pointer; }

label { display: block; font-weight: 500; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--navy);
  padding: 10px 12px; border: 1px solid var(--divider); border-radius: 10px; background: var(--white);
}
input[dir=ltr] { text-align: left; }
textarea { min-height: 110px; resize: vertical; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.95rem; }
.msg.error { background: #FDECEA; color: var(--danger); }
.msg.ok { background: #E7F5EE; color: var(--success); }

/* ---------- כרטיסים ---------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.tip { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 18px 20px; border-inline-start: 6px solid var(--gold); }
.tip .label { display: inline-block; background: var(--gold); color: var(--navy); font-weight: 800; font-size: 0.8rem; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.tip a { color: var(--gold-on-dark); }

/* ---------- התקדמות ---------- */
.bar { height: 8px; background: #E3E7F0; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.4s; }
.pct { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- דף הכניסה ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-shell {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr;
  background: var(--white); border-radius: 22px; overflow: hidden; box-shadow: 0 18px 60px rgba(22, 40, 90, 0.14);
}
/* הצד הממותג: לוגו, הרובוט והסלוגן על רקע נייבי */
.auth-brand {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px;
  padding: 20px 20px 0; color: var(--white); overflow: hidden;
  background: radial-gradient(circle at 70% 25%, #24407f 0%, var(--navy) 45%, var(--bg-dark) 100%);
}
.auth-logo img { display: block; width: 150px; height: auto; }
.auth-robot { grid-row: span 2; width: 92px; height: auto; align-self: end; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.auth-slogan { margin: 0 0 16px; color: var(--gold-on-dark); font-weight: 700; font-size: 0.95rem; }
.auth-card { padding: 24px 20px 28px; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.6rem; }

@media (min-width: 760px) {
  .auth-shell { grid-template-columns: 1fr 1fr; min-height: 540px; }
  .auth-brand { order: 2; grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; padding: 40px 32px; gap: 20px; }
  .auth-logo img { width: 220px; }
  .auth-robot { grid-row: auto; width: 190px; align-self: center; }
  .auth-slogan { margin: 0; font-size: 1.1rem; }
  .auth-card { align-self: center; padding: 48px 44px; }
}

/* ---------- האזור האישי ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.hello h1 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.overall { min-width: 240px; flex: 0 1 320px; }
.layer { margin-top: 32px; }
.layer h2 { font-size: 1.2rem; margin: 0 0 4px; }
.layer > p { margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.course-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform 0.15s; }
.course-card:hover { transform: translateY(-2px); }
.course-card h3 { margin: 0; font-size: 1.05rem; }
.course-card.soon { opacity: 0.6; pointer-events: none; }
.tier-box { margin-top: 32px; }

/* ---------- דף קורס ---------- */
.crumbs { font-size: 0.9rem; margin-bottom: 12px; }
.section { margin-top: 20px; }
.section h2 { font-size: 1.05rem; margin: 0 0 8px; color: var(--text-muted); }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid #E8EBF2; }
.lesson-list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; text-decoration: none; color: inherit; }
.lesson-list a:hover { background: var(--bg-light); }
.lesson-list .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--divider); flex: none; display: grid; place-items: center; font-size: 0.8rem; }
.lesson-list .done .check { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.lesson-list .dur { margin-inline-start: auto; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- דף שיעור ---------- */
.lesson-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .lesson-layout { grid-template-columns: 1fr 300px; } }
.lesson-title { margin: 0 0 12px; font-size: clamp(1.3rem, 3.5vw, 1.8rem); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* הנגן: המסגרת הזו היא מה שעובר למסך מלא, כולל סימן המים */
.player-frame { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; color: var(--white); }
.player-frame:fullscreen { border-radius: 0; aspect-ratio: auto; }
.player-frame.fill { position: fixed; inset: 0; z-index: 1000; border-radius: 0; aspect-ratio: auto; }
.player-stage { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #22386f, #0E1838 70%); }
.player-stage .note { font-size: 0.85rem; color: var(--by-light); }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-big {
  width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: var(--navy); font-size: 1.8rem; padding-inline-start: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.play-big:hover { filter: brightness(1.06); }
/* כפתור המסך המלא שלנו: מגדיל את המסגרת כולה, כולל סימן המים */
.player-fs {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(14, 24, 56, 0.6); color: var(--white); font-size: 1.1rem;
}
.player-fs:hover { background: rgba(14, 24, 56, 0.85); }
/* סימן המים: עדין, ומופיע ונעלם במקום (בלי תנועה בין מקומות) */
.watermark {
  position: absolute; z-index: 2; pointer-events: none; user-select: none;
  font-size: clamp(0.6rem, 1.1vw, 1rem); color: rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35); direction: ltr; white-space: nowrap;
  visibility: hidden;
}
.watermark.on { visibility: visible; }
.player-blocked { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(14, 24, 56, 0.94); }
.player-blocked .muted { color: var(--by-light); }

.side h3 { margin: 0 0 8px; font-size: 1rem; }
.side .card + .card { margin-top: 16px; }
.qa-item { border-top: 1px solid #E8EBF2; padding-top: 10px; margin-top: 10px; font-size: 0.95rem; }
.qa-item .answer { background: var(--bg-light); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }

/* ---------- מסך הניהול ---------- */
.admin-title { margin: 0 0 12px; font-size: 1.6rem; }
.admin-sub { font-size: 1.05rem; margin: 24px 0 10px; }
.alert-text { color: var(--danger); font-weight: 700; }
.tabs { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 2px solid #E3E7F0; margin-bottom: 20px; }
.tabs button {
  font: inherit; font-weight: 500; color: var(--text-muted); background: none; border: 0; cursor: pointer;
  padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }
.tabs .count:not(:empty) {
  display: inline-block; min-width: 20px; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: var(--white); font-size: 0.75rem; line-height: 20px; text-align: center;
}
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; text-align: start; border: 0; cursor: pointer; font: inherit; color: inherit; }
.stat .num { font-family: var(--font-latin); font-weight: 900; font-size: 2.2rem; line-height: 1; }
.stat .label { color: var(--text-muted); }
.stat.alert { box-shadow: inset 0 0 0 2px var(--danger), var(--shadow); }
.stat.alert .num { color: var(--danger); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.toolbar p { margin: 0; }
.toolbar input { max-width: 320px; }
.table-wrap { padding: 0; overflow-x: auto; }
.admin table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin th, .admin td { padding: 10px 12px; text-align: start; border-bottom: 1px solid #E8EBF2; vertical-align: top; }
.admin th { background: var(--bg-light); font-weight: 700; white-space: nowrap; }
.admin tbody tr:last-child td { border-bottom: 0; }
.bar.small { height: 6px; width: 70px; display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #E3E7F0; color: var(--navy); }
.badge.alert, .badge.status-needs_review, .badge.status-failed { background: #FDECEA; color: var(--danger); }
.badge.status-paid { background: #E7F5EE; color: var(--success); }
.q-card + .q-card { margin-top: 14px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 0.92rem; }
.q-body { white-space: pre-wrap; margin: 10px 0; }
.q-answer { background: var(--bg-light); border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; margin-bottom: 8px; }
.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.coupon-form { margin-bottom: 20px; }
.coupon-form .admin-sub { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.tier-pick { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tier-pick legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.tier-pick label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }

/* ---------- דף "בקרוב" הזמני ---------- */
.soon-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 16px;
}
.soon-page { justify-items: center; gap: 4px; background: radial-gradient(circle at 50% 30%, #24407f 0%, var(--navy) 40%, var(--bg-dark) 100%); }
.soon-page h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); margin: 0.3em 0 0.1em; }
.soon-logo { width: min(260px, 70vw); height: auto; margin-bottom: 8px; }
.soon-robot { width: min(170px, 40vw); height: auto; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.4)); }
.soon-note { color: var(--gold-on-dark); font-weight: 500; font-size: 1.1rem; margin: 0 0 12px; }
.soon-page .soon-login { color: var(--white); box-shadow: inset 0 0 0 2px var(--divider-dark); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
