/* Ascend — visual identity. Professional, warm, calm. Navy + gold + cream. No emoji anywhere. */

/* Estedad — Farsi typeface, bundled (same font as the Pearl of Persia project). */
@font-face { font-family: 'Estedad'; src: url('/assets/fonts/Estedad-Regular.ttf') format('truetype');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Estedad'; src: url('/assets/fonts/Estedad-Medium.ttf') format('truetype');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Estedad'; src: url('/assets/fonts/Estedad-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Estedad'; src: url('/assets/fonts/Estedad-Bold.ttf') format('truetype');     font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --navy: #0f2747;
  --navy-700: #1c3a63;
  --navy-50: #eef2f8;
  --gold: #c6a15b;
  --gold-600: #b08e44;
  --cream: #f7f4ee;
  --paper: #ffffff;
  --ink: #1a2230;
  --muted: #6a7686;
  --line: #e7e4dc;
  --good: #2e9e6b;
  --warn: #c2792a;
  --bad: #c5483f;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16,40,73,.05);
  --shadow: 0 1px 2px rgba(16,40,73,.04), 0 6px 20px rgba(16,40,73,.06);
  --shadow-lg: 0 18px 48px rgba(16,40,73,.14);
  --maxw: 900px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(198,161,91,.12), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(15,39,71,.05), transparent 55%),
    linear-gradient(180deg, #faf8f3 0%, #f4f0e8 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
h1, h2, h3 { letter-spacing: -0.015em; }
/* Standalone section headings (between cards) get a gold accent bar. */
#view > h2 { position: relative; padding-inline-start: 13px; font-size: 19px; }
#view > h2::before { content: ''; position: absolute; inset-inline-start: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--gold-600)); }
/* Farsi uses Estedad throughout (inputs/buttons inherit via font: inherit). */
html[lang="fa"] body { font-family: 'Estedad', Vazirmatn, Tahoma, sans-serif; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button { font: inherit; cursor: pointer; }
a { color: var(--navy-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }

/* ── App bar ─────────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 13px 22px;
  background: linear-gradient(180deg, #143055 0%, #0f2747 100%); color: #fff;
  box-shadow: 0 6px 28px rgba(15,39,71,.22);
  border-bottom: 1px solid rgba(198,161,91,.22);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; font-size: 18px; }
.brand .mark { width: 28px; height: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.appbar nav { display: flex; gap: 4px; margin-left: 12px; }
.appbar nav button {
  background: transparent; color: #c2cee0; border: 0; padding: 8px 15px; border-radius: 999px; font-weight: 600; transition: background .18s, color .18s;
}
.appbar nav button.active { background: linear-gradient(180deg, rgba(198,161,91,.30), rgba(198,161,91,.16)); color: #fff; box-shadow: inset 0 0 0 1px rgba(198,161,91,.4); }
.appbar nav button:hover { color: #fff; background: rgba(255,255,255,.08); }
.appbar .spacer { flex: 1; }
.appbar .who { color: #cdd7e6; font-size: 14px; }
.appbar .ghost { background: transparent; color: #cdd7e6; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.avatar.lg { width: 48px; height: 48px; }
.lang-select { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; min-width: 160px; }
.lang-select option { color: var(--ink); }

/* Accessibility: visible keyboard focus everywhere. */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
/* RTL: flip the gold accent border on goal cards. */
[dir="rtl"] .goal { border-left: 0; border-right: 4px solid var(--gold); }
[dir="rtl"] .bubble.coach { border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
[dir="rtl"] .bubble.user { border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 96px; }

/* ── Cards / generic ─────────────────────────────────────── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card h2 { font-size: 19px; font-weight: 700; }
.card h3 { font-size: 15.5px; font-weight: 700; }
/* Interactive cards (assessments, toolkit, jobs) lift with a gold accent on hover. */
.assess-card { position: relative; overflow: hidden; cursor: pointer; }
.assess-card::after { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-600)); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.assess-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(198,161,91,.45); }
.assess-card:hover::after { transform: scaleX(1); }
[dir="rtl"] .assess-card::after { transform-origin: right; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--navy-50); color: var(--navy-700); }
.pill.gold { background: #f6edd9; color: var(--gold-600); }
.pill.good { background: #e3f4ec; color: var(--good); }
.tag { display:inline-block; padding:4px 10px; border-radius:999px; background:var(--cream); border:1px solid var(--line); font-size:13px; margin:3px 4px 0 0; }

.btn { background: linear-gradient(180deg, #1c3a63, #0f2747); color: #fff; border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 600; box-shadow: 0 2px 8px rgba(15,39,71,.22); transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { background: linear-gradient(180deg, #244878, #14315a); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15,39,71,.28); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(15,39,71,.22); }
.btn.gold { background: linear-gradient(180deg, #d4b06b, #c6a15b); color: #241a07; box-shadow: 0 2px 8px rgba(198,161,91,.35); }
.btn.gold:hover { background: linear-gradient(180deg, #ddbb78, #b08e44); box-shadow: 0 6px 18px rgba(198,161,91,.4); }
.btn.outline { background: #fff; color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.outline:hover { background: #fff; border-color: rgba(198,161,91,.5); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn.sm { padding: 8px 13px; font-size: 14px; border-radius: 9px; }

input, textarea, select {
  font: inherit; width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198,161,91,.2); }
label { font-weight: 600; font-size: 14px; display: block; margin: 12px 0 5px; }

/* ── Auth ────────────────────────────────────────────────── */
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 18px; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero .mark { width: 54px; height: 54px; }
.auth-hero h1 { font-size: 28px; margin-top: 12px; color: var(--navy); }
.auth-hero p { color: var(--muted); margin: 0; }
.tabs { display: flex; gap: 6px; background: var(--navy-50); padding: 4px; border-radius: 999px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.tabs button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 18px; }

/* ── Coach chat ──────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 86%; padding: 12px 15px; border-radius: 16px; white-space: pre-wrap; box-shadow: var(--shadow); }
.bubble.coach { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.bubble.coach .who { font-size: 12px; font-weight: 700; color: var(--gold-600); margin-bottom: 4px; }
.composer {
  position: sticky; bottom: 0; background: linear-gradient(transparent, var(--cream) 24%);
  padding-top: 14px; display: flex; gap: 8px; align-items: flex-end;
}
.composer textarea { resize: none; max-height: 140px; }
.thinking { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; border-radius: 16px; padding: 12px 15px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; }
.thinking .who { font-size: 12px; font-weight: 700; color: var(--gold-600); margin: 0; }

/* Coach toolbar: history + new session */
.coachbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.chiplink { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.chiplink:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--gold); }
.chiplink svg { width: 16px; height: 16px; }
.linklike { background: none; border: 0; color: var(--gold-600); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: 13px; padding: 0; }
.linklike-muted { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.readonly-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; justify-content: center;
  background: linear-gradient(transparent, var(--cream) 24%); padding: 14px 0 4px; color: var(--muted); font-size: 13px; }
.readonly-bar svg { width: 15px; height: 15px; opacity: .8; }

/* History drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,28,42,0); z-index: 60; transition: background .22s ease; }
.drawer-overlay.open { background: rgba(20,28,42,.42); }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(380px, 90vw); background: var(--cream);
  box-shadow: -12px 0 40px rgba(20,28,42,.22); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease; }
[dir="rtl"] .drawer { box-shadow: 12px 0 40px rgba(20,28,42,.22); transform: translateX(-100%); }
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.drawer-head strong { font-size: 16px; }
.drawer-x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.drawer-body { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.hist-item { text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.hist-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--gold); }
.hist-label { font-weight: 600; font-size: 14px; color: var(--navy); }
.hist-meta { font-size: 12px; color: var(--muted); }
.tag-cur { display: inline-block; margin-inline-start: 8px; font-size: 11px; font-weight: 700; color: var(--gold-600);
  background: rgba(198,161,91,.16); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.thinking .dots { display: inline-flex; gap: 4px; }
.thinking .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; animation: ascend-blink 1.2s infinite ease-in-out both; }
.thinking .dots i:nth-child(2) { animation-delay: .18s; }
.thinking .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes ascend-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.action-note { align-self: center; font-size: 12px; color: var(--gold-600); background: #f6edd9; padding: 4px 12px; border-radius: 999px; }
.safety { align-self: stretch; background: #fdecea; border: 1px solid #f5c6c2; color: #8a2d26; padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* ── Journey / progress ──────────────────────────────────── */
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; text-align: center; padding: 11px 8px; border-radius: 11px; background: var(--navy-50); color: var(--muted); font-size: 13px; font-weight: 600; transition: background .2s, color .2s; }
.step.done { background: #e3f4ec; color: var(--good); }
.step.current { background: var(--navy); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kpi { background: linear-gradient(180deg, #ffffff, #fcfaf5); border: 1px solid var(--line); border-radius: 13px; padding: 16px; box-shadow: var(--shadow-sm); }
.kpi .n { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .d { font-size: 12px; font-weight: 600; }
.d.up { color: var(--good); } .d.down { color: var(--bad); }

.goal { border-left: 4px solid var(--gold); }
.goal h3 { font-size: 16px; }
.gas { display: flex; gap: 4px; margin: 10px 0; }
.gas .lvl { flex: 1; text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--navy-50); font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.gas .lvl.on { background: var(--gold); color: #1a1407; }
.gas .lvl[data-k="0"] { outline: 1px dashed var(--line); }
.steps { list-style: none; padding: 0; margin: 10px 0 0; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.steps input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--gold-600); }
.steps li.done span { text-decoration: line-through; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; margin-top: 6px; }
.spark i { flex: 1; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 3px; }

/* ── Assessments ─────────────────────────────────────────── */
.assess-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
.assess-card .state { font-size: 13px; font-weight: 600; }
.why-banner { background: #f6edd9; border: 1px solid #ecdcb4; color: var(--gold-600); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 4px 0 14px; }
.q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.q .qt { font-weight: 600; margin-bottom: 8px; }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; padding: 10px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--muted); }
.scale button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.scale .ends { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.chip .num { font-size: 12px; margin-right: 6px; color: var(--gold-600); }
.chip.on .num { color: #1a1407; }

.filelist { list-style: none; padding: 0; margin: 8px 0 0; }
.filelist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.filelist .star { color: var(--gold); font-size: 12px; letter-spacing: -1px; min-width: 46px; padding-top: 2px; }
.rowbtns { display: flex; gap: 8px; flex: 0 0 auto; }
.linkbtn { background: none; border: 0; color: var(--navy-700); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.linkbtn.danger { color: var(--bad); }

/* ── CV builder ─────────────────────────────────────────── */
.cvblock { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cvdoc { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; color: #1a2230; max-width: 760px; margin: 8px auto 0; }
.cvdoc .cv-head { border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 12px; }
.cvdoc h1 { font-size: 24px; color: var(--navy); margin: 0; }
.cvdoc .cv-headline { color: var(--gold-600); font-weight: 600; margin-top: 2px; }
.cvdoc .cv-contact { font-size: 13px; color: var(--muted); margin-top: 6px; }
.cvdoc .cv-sec { margin-top: 14px; }
.cvdoc .cv-sec h4 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 3px; margin: 0 0 8px; }
.cvdoc .cv-item { margin-bottom: 10px; }
.cvdoc .cv-item-head { font-size: 14px; }
.cvdoc .cv-period { float: right; color: var(--muted); font-weight: 400; font-size: 13px; }
[dir="rtl"] .cvdoc .cv-period { float: left; }
.cvdoc ul { margin: 4px 0 0; padding-inline-start: 18px; }
.cvdoc li { font-size: 13.5px; margin: 2px 0; }
.cvdoc p { font-size: 14px; margin: 0; }

/* CV themes */
.cvdoc.theme-minimal { font-family: Georgia, 'Times New Roman', serif; }
.cvdoc.theme-minimal .cv-head { border-bottom: 1px solid #333; }
.cvdoc.theme-minimal h1 { color: #111; }
.cvdoc.theme-minimal .cv-headline { color: #444; }
.cvdoc.theme-minimal .cv-sec h4 { color: #111; letter-spacing: .04em; }
.cvdoc.theme-modern .cv-head { background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 18px 20px; margin: -28px -32px 16px; }
.cvdoc.theme-modern h1 { color: #fff; }
.cvdoc.theme-modern .cv-headline { color: var(--gold); }
.cvdoc.theme-modern .cv-contact { color: #cdd7e6; }
.cvdoc.theme-modern .cv-sec h4 { color: var(--gold-600); border-bottom-color: var(--gold); }

/* Print: when printing, show ONLY the CV preview. */
@media print {
  body.printing .appbar, body.printing .botnav, body.printing .composer { display: none !important; }
  body.printing #view > .card:not(:last-child) { display: none !important; }
  body.printing .cvdoc { border: 0; padding: 0; max-width: 100%; }
  body.printing main { padding: 0; }
}

.center { text-align: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); z-index: 50; font-size: 14px; }

/* ── Bottom nav (mobile) ─────────────────────────────────── */
.botnav { display: none; }
@media (max-width: 680px) {
  .appbar nav { display: none; }
  .botnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px env(safe-area-inset-bottom);
  }
  .botnav button { flex: 1; background: transparent; border: 0; padding: 8px 4px; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .botnav button.active { color: var(--navy); }
  .botnav svg { width: 22px; height: 22px; }
  main { padding-bottom: 86px; }
}
