/* Visual language of fanapcampus.ir: navy primary, teal secondary, burgundy accent, white base, pill buttons.
   Target screen: 27" 1920×1080 monitor, keyboard + mouse, headset. */
/* Vazirmatn is bundled (SIL OFL, see fonts/OFL.txt): Google Fonts is often unreachable from Iran. */
@font-face {
  font-family: Vazirmatn;
  src: url("fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --navy: #002d4b;       /* site primary-950 */
  --navy-soft: #006195;  /* primary-800 */
  --blue: #0074b4;       /* primary-700 */
  --teal: #009ec4;       /* secondary-600 */
  --teal-bg: #ebfeff;    /* secondary-50 */
  --burgundy: #9a0000;   /* tertiary-800 */
  --red: #c01221;        /* logo red */
  --bg: #ffffff;
  --surface-alt: #f8fafc;
  --text: #111827;       /* gray-900 */
  --muted: #4b5563;      /* gray-600 */
  --border: #d1d5db;     /* gray-300 */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
@media (min-width: 1700px) { html { font-size: 20px; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  /* IRANSansX is the site font (commercial); used if installed on the kiosk, otherwise Vazirmatn. */
  font-family: IRANSansX, IRANSansXFaNum, Vazirmatn, Tahoma, sans-serif;
}
button { font: inherit; cursor: pointer; border: 0; border-radius: 999px; }
kbd {
  display: inline-block; direction: ltr; font: 700 .8em/1 ui-monospace, Menlo, monospace;
  padding: .3em .6em; border-radius: 6px; border: 1px solid currentColor; border-bottom-width: 3px;
}
.primary {
  background: #fff; color: var(--navy);
  height: 3.4rem; padding: 0 3rem; font-size: 1.25rem; font-weight: 700;
  transition: background .15s;
}
.primary:hover { background: var(--teal-bg); }
.secondary {
  background: transparent; color: var(--burgundy);
  border: 1px solid var(--burgundy); height: 2.6rem; padding: 0 1.4rem; font-size: .9rem;
}
.secondary:hover { background: #ffefef; }
.muted { color: var(--muted); }

.topbar { height: 72px; flex: none; display: flex; align-items: center; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--border); }
.screen { height: calc(100vh - 72px); flex: none; display: flex; padding: 24px 32px; }

/* Start */
#start {
  flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem;
  background: radial-gradient(circle at 20% 110%, var(--navy-soft) 0, var(--navy) 55%);
  color: #fff;
}
#start h1 { font-size: 3rem; font-weight: 800; margin: 0; }
#start > p { color: #cdeefb; margin: 0; line-height: 1.9; font-size: 1.1rem; }
.steps { list-style: none; display: flex; gap: 1.2rem; padding: 0; margin: 1.2rem 0 1.6rem; }
.steps li {
  display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 13rem; padding: 1.1rem .8rem;
  border: 1px solid rgb(255 255 255 / .18); border-radius: 18px; background: rgb(255 255 255 / .06); font-size: .95rem;
}
.steps li span { font-size: 1.8rem; height: 2.2rem; display: grid; place-items: center; }
.steps kbd { font-size: .9rem; }
#start .hint { font-size: .85rem; color: #9fc6dc; }

/* Conversation + live profile */
#chat { gap: 28px; }
.conversation { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px; }
.bubble { padding: 14px 22px; border-radius: 22px; max-width: 75%; line-height: 1.9; font-size: 1.05rem; }
.bubble.bot { background: var(--teal-bg); border: 1px solid #a1f5ff; align-self: flex-start; border-start-start-radius: 4px; }
.bubble.user { background: var(--surface-alt); border: 1px solid var(--border); align-self: flex-end; border-start-end-radius: 4px; }
.status { min-height: 1.6em; margin: 0; color: var(--muted); text-align: center; }
.talk {
  flex: none; align-self: center; display: flex; align-items: center; justify-content: center; gap: 1rem;
  width: min(100%, 34rem); height: 5.5rem; background: var(--navy); color: #fff; font-size: 1.1rem; font-weight: 600;
  box-shadow: 0 0 0 8px #dcf1ff; user-select: none; touch-action: none;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.talk-icon { font-size: 1.8rem; }
.talk kbd { margin: 0 .3em; }
.talk .rec-only, .talk.recording .idle-only { display: none; }
.talk.recording .rec-only { display: inline; }
.talk.recording { background: var(--red); box-shadow: 0 0 0 12px #ffdada; transform: scale(1.03); }
.talk:disabled { opacity: .5; cursor: wait; }

.profile {
  flex: none; width: 27rem; display: flex; flex-direction: column; gap: .6rem;
  background: var(--surface-alt); border: 1px solid var(--border); border-top: 6px solid var(--teal);
  border-radius: 20px; padding: 1.4rem 1.6rem;
}
.profile h2 { margin: 0 0 .4rem; font-size: 1.15rem; color: var(--navy); }
.profile h3 { margin: .8rem 0 .2rem; font-size: .95rem; color: var(--navy); }
.profile dl { display: grid; grid-template-columns: auto 1fr; gap: .7rem 1rem; margin: 0; font-size: .95rem; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 700; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-content: flex-start; }
.chip { background: #fff; border: 1px solid var(--teal); color: var(--navy); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; }
#pKnown { flex: 1; min-height: 0; overflow-y: auto; }
.profile-note { color: var(--muted); font-size: .8rem; line-height: 1.8; margin: 0; }
.profile .secondary { align-self: flex-start; }

/* Final learning map: one screen, high contrast, made to be photographed with a phone. */
.poster-mode .topbar { display: none; }
.poster { height: 100vh; display: flex; flex-direction: column; gap: 12px; padding: 18px 24px 14px; background: #eef3f7; }
.sheet {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border-radius: 20px; border-top: 8px solid var(--navy);
  box-shadow: 0 6px 24px rgb(0 45 75 / .10); padding: 18px 28px 12px;
}
.sheet-head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0; color: var(--teal); font-weight: 600; font-size: .9rem; }
.sheet-head h1 { margin: 0; color: var(--navy); font-size: 2rem; font-weight: 800; line-height: 1.5; }
.sub { margin: 0; color: var(--muted); font-size: .9rem; }
.known-strip { flex: none; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .85rem; }
.known-strip:empty { display: none; }
.known-label { color: var(--muted); margin-inline-end: .3rem; }
.known-strip .chip { border-color: var(--border); color: var(--muted); }

.graph { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.graph-inner { position: absolute; transform-origin: 0 0; }
.graph-inner svg { position: absolute; inset: 0; overflow: visible; }
.graph-inner path { fill: none; stroke: #8a9bb0; stroke-width: 2; }
.graph-empty { text-align: center; font-size: 1.4rem; color: var(--navy); margin-top: 3rem; }
.node {
  position: absolute; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border-radius: 14px; border: 2px solid var(--border); background: #fff; color: var(--text);
  font-size: 13px; overflow: hidden;
}
.node .num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #64748b; color: #fff; font-weight: 700; font-size: 14px;
}
.node-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.node strong { font-size: 16px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node small { direction: ltr; text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .course { font-style: normal; font-size: 12px; color: var(--blue); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.junior { background: var(--teal-bg); border-color: var(--teal); }
.node.junior .num { background: var(--teal); }
.node.mid { background: #dcf1ff; border-color: var(--blue); }
.node.mid .num { background: var(--blue); }
.node.senior { background: var(--navy); border-color: var(--navy); color: #fff; }
.node.senior .num { background: #fff; color: var(--navy); }
.node.senior small { color: #b2e5ff; }
.node.senior .course { color: #a1f5ff; }

.sheet-foot { flex: none; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: .75rem; }
.legend { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--border); background: #fff; }
.sw.junior { background: var(--teal-bg); border-color: var(--teal); }
.sw.mid { background: #dcf1ff; border-color: var(--blue); }
.sw.senior { background: var(--navy); border-color: var(--navy); }
.course-mark { font-style: normal; }

.poster-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.photo-hint { margin: 0; font-weight: 700; color: var(--navy); white-space: nowrap; }
.contact { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.contact input { font: inherit; width: 8.5rem; height: 2.4rem; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.contact input:focus { outline: 2px solid var(--teal); border-color: transparent; }
.contact .secondary { height: 2.4rem; }
.contact-msg { color: var(--teal); font-weight: 600; }
.poster-actions { display: flex; gap: 8px; }

/* Recommended courses under the map: Fanap Campus first, then popular public courses (Coursera etc.). */
.course-strip { flex: none; display: flex; align-items: stretch; gap: 14px; }
.course-strip h3 { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); margin: 0; font-size: .8rem; color: var(--teal); text-align: center; }
.course-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.course-card { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); font-size: .72rem; }
.course-card.ours { border: 2px solid var(--teal); background: var(--teal-bg); }
.course-provider { color: var(--teal); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-card strong { font-size: .82rem; line-height: 1.5; color: var(--text); unicode-bidi: plaintext; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card code { direction: ltr; text-align: left; font: 600 .7rem/1.4 ui-monospace, Menlo, monospace; color: var(--navy-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-steps { color: var(--muted); font-weight: 600; }
