/* Travail.ma — mobile-first, refined */
:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #ccfbf1;
  --accent: #ea580c;
  --accent-soft: #ffedd5;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --nav-h: 60px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}
body.rtl { direction: rtl; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(var(--max), 100% - 1.75rem); margin-inline: auto; }
.main { flex: 1; padding: 1.35rem 0 3.5rem; }

/* Typography helpers */
.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary-dark); background: var(--primary-soft);
  padding: .3rem .6rem; border-radius: 999px; margin: 0 0 .6rem;
}
.eyebrow.light { background: rgba(255,255,255,.18); color: #ecfdf5; }
.eyebrow-employer { background: var(--accent-soft); color: #9a3412; }
.lead { font-size: 1.05rem; max-width: 40rem; }
.center { text-align: center; }
.text-link { font-weight: 600; font-size: .92rem; }
.section-title {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  margin: 0; letter-spacing: -0.02em; font-weight: 800;
}
.section-head { margin-bottom: 1rem; align-items: baseline; }
.section-block { margin: 2rem 0; }
.page-hero { margin-bottom: 1.5rem; }
.page-hero h1 { margin: 0 0 .4rem; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.03em; }

/* Nav */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.9);
  min-height: var(--nav-h);
}
.topbar-inner {
  display: flex; align-items: center; gap: .75rem;
  min-height: var(--nav-h); justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800; font-size: 1.2rem; color: var(--text);
  letter-spacing: -0.03em; text-decoration: none;
}
.brand span { color: var(--primary); }
.nav-toggle {
  display: inline-flex; border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: .45rem .7rem; font-size: 1.05rem; cursor: pointer;
}
.nav-links {
  display: none; flex-direction: column; gap: .15rem;
  width: 100%; order: 3;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .55rem; box-shadow: var(--shadow);
}
.nav-links.open { display: flex; }
.nav-links a {
  display: block; padding: .65rem .7rem; color: var(--text);
  border-radius: 8px; text-decoration: none; font-weight: 500; font-size: .93rem;
}
.nav-links a:hover { background: var(--primary-soft); text-decoration: none; color: var(--primary-dark); }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.lang-select {
  border: 1px solid var(--border); border-radius: 8px; padding: .4rem .55rem;
  background: var(--surface); font-size: .85rem;
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav-actions { order: 3; margin-inline-start: 0; }
  .nav-links {
    display: flex; flex-direction: row; align-items: center; gap: .1rem;
    width: auto; order: 2; border: 0; box-shadow: none; padding: 0;
    background: transparent; flex: 1; justify-content: center;
  }
  .nav-links a { padding: .45rem .7rem; white-space: nowrap; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 11px; border: 1px solid transparent; padding: .68rem 1.05rem;
  font-weight: 650; font-size: .94rem; cursor: pointer; text-decoration: none;
  line-height: 1.2; background: var(--surface); color: var(--text);
  border-color: var(--border); transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .42rem .75rem; font-size: .85rem; border-radius: 9px; }
.btn-lg { padding: .8rem 1.2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

/* Forms */
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); border-radius: 11px;
  padding: .72rem .9rem; font: inherit; background: #fff; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
label { display: block; font-weight: 650; font-size: .88rem; margin-bottom: .35rem; }
.field { margin-bottom: .95rem; }
.field-hint { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.form-error, .errorlist { color: var(--danger); font-size: .88rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.form-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.form-table { width: 100%; border-collapse: collapse; }
.form-table th, .form-table td { display: block; text-align: start; padding: .15rem 0; }
.form-table th { font-size: .85rem; color: var(--muted); font-weight: 600; padding-top: .75rem; }
@media (min-width: 640px) {
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .form-table th, .form-table td {
    display: table-cell; padding: .55rem .4rem; vertical-align: top;
  }
  .form-table th { width: 32%; color: var(--text); }
  .form-table tr { border-bottom: 1px solid var(--border); }
}
.filter-bar { margin-bottom: 1rem; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem;
}
.card + .card { margin-top: .85rem; }
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .75rem; margin-bottom: .45rem;
}
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.space-between { justify-content: space-between; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* Hero v2 */
.hero, .hero-v2 {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(45,212,191,.25), transparent 50%),
    linear-gradient(145deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
  color: #fff; border-radius: 22px; padding: 1.5rem 1.25rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.hero-v2 h1 {
  margin: 0 0 .65rem; font-size: clamp(1.55rem, 5.2vw, 2.35rem);
  letter-spacing: -0.035em; line-height: 1.12; font-weight: 800;
}
.hero-lead { margin: 0 0 1.1rem; opacity: .93; max-width: 36rem; font-size: 1.02rem; }
.hero-grid { display: grid; gap: 1.25rem; }
.hero-search {
  display: grid; gap: .5rem;
  background: rgba(255,255,255,.12); padding: .7rem; border-radius: 16px;
  backdrop-filter: blur(8px);
}
.hero-search .input { border: 0; }
.hero-stats-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: .65rem;
}
.hero-stat {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px; padding: .85rem .9rem;
}
.hero-stat .n { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.hero-stat .l { font-size: .78rem; opacity: .88; }
.role-split { display: grid; gap: .55rem; }
.split-btn {
  display: block; background: #fff; color: var(--text); border-radius: 14px;
  padding: .85rem 1rem; text-decoration: none; box-shadow: var(--shadow);
}
.split-btn:hover { text-decoration: none; transform: translateY(-1px); }
.split-btn strong { display: block; color: var(--primary-dark); font-size: 1rem; }
.split-btn span { font-size: .85rem; color: var(--muted); }
.split-employer strong { color: #c2410c; }

@media (min-width: 800px) {
  .hero-v2 { padding: 2.1rem 2rem; }
  .hero-grid { grid-template-columns: 1.45fr .85fr; align-items: stretch; }
  .hero-search { grid-template-columns: 1.4fr 1fr auto; }
  .role-split { grid-template-columns: 1fr 1fr; }
}

/* Job cards */
.job-card { transition: transform .12s, box-shadow .12s; }
.job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.job-card-main { display: flex; gap: .75rem; align-items: flex-start; min-width: 0; }
.job-co-logo, .co-mini-logo {
  width: 44px; height: 44px; border-radius: 11px; object-fit: cover;
  background: var(--primary-soft); flex-shrink: 0;
}
.job-co-logo.placeholder, .co-mini-logo.placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--primary-dark); font-size: 1.05rem;
}
.job-title { margin: 0; font-size: 1.05rem; font-weight: 750; letter-spacing: -0.01em; }
.job-title a { color: var(--text); text-decoration: none; }
.job-title a:hover { color: var(--primary-dark); }
.job-meta { color: var(--muted); font-size: .86rem; margin: .2rem 0 0; }
.co-link { color: inherit; font-weight: 600; }
.job-excerpt { margin: .55rem 0 .35rem; }

/* Chips / badges */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  border-radius: 999px; padding: .22rem .6rem; font-size: .74rem;
  font-weight: 750; background: #f1f5f9; color: #334155; white-space: nowrap;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-good { background: #ccfbf1; color: #115e59; }
.badge-fair { background: #fef3c7; color: #92400e; }
.badge-low { background: #fee2e2; color: #991b1b; }
.badge-soft { background: var(--primary-soft); color: var(--primary-dark); }
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; padding: .4rem .75rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); color: var(--text);
  font-size: .88rem; font-weight: 600; text-decoration: none;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.chip-soft {
  background: #f8fafc; border: 0; font-size: .75rem; font-weight: 650; color: var(--muted);
  padding: .25rem .55rem;
}

/* Category tiles */
.cat-grid {
  display: grid; gap: .55rem;
  grid-template-columns: repeat(2, 1fr);
}
.cat-tile {
  display: flex; align-items: center; gap: .55rem;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .75rem .8rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow);
}
.cat-tile:hover { border-color: var(--primary); text-decoration: none; color: var(--primary-dark); }
.cat-ico { font-size: 1.15rem; }
@media (min-width: 700px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* City grid */
.city-grid {
  display: grid; gap: .55rem;
  grid-template-columns: 1fr 1fr;
}
.city-tile {
  display: flex; flex-direction: column; gap: .2rem;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .85rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.city-tile:hover { border-color: var(--primary); text-decoration: none; }
@media (min-width: 700px) {
  .city-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Match bar */
.match-bar {
  height: 7px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: .4rem;
}
.match-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), #2dd4bf);
  border-radius: 999px;
}

/* Layouts */
.grid-cards { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-cards.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid-cards.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.layout-2 { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .layout-2 { grid-template-columns: 1.5fr 1fr; align-items: start; }
  .layout-2.sidebar-left { grid-template-columns: 280px 1fr; }
}

/* Features */
.features-band { padding: 1.5rem 0 .5rem; }
.feature-card { text-align: center; padding: 1.35rem 1.1rem; }
.feature-ico { font-size: 1.6rem; margin-bottom: .4rem; }
.feature-card h3 { margin: .2rem 0 .4rem; font-size: 1.05rem; }

/* Auth / role pick */
.auth-wrap { max-width: 760px; margin: 0 auto; }
.auth-wrap.narrow { max-width: 440px; }
.auth-intro h1 { margin: 0 0 .4rem; font-size: clamp(1.4rem, 4vw, 1.85rem); letter-spacing: -0.03em; }
.auth-card { margin-top: 1rem; }
.auth-foot { margin-top: 1.1rem; text-align: center; }
.role-pick {
  display: grid; gap: .85rem; margin-top: 1.25rem;
}
.role-card {
  display: block; background: #fff; border: 2px solid var(--border);
  border-radius: 18px; padding: 1.25rem 1.15rem; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: border-color .12s, transform .12s, box-shadow .12s;
}
.role-card:hover {
  border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg);
  text-decoration: none; color: var(--text);
}
.role-card h2 { margin: .35rem 0 .35rem; font-size: 1.2rem; }
.role-card p { margin: 0 0 .75rem; color: var(--muted); font-size: .95rem; }
.role-icon { font-size: 1.6rem; }
.role-cta { font-weight: 750; color: var(--primary-dark); }
.role-employer:hover { border-color: var(--accent); }
.role-employer .role-cta { color: #c2410c; }
@media (min-width: 700px) {
  .role-pick { grid-template-columns: 1fr 1fr; }
}

/* How it works */
.path-card { padding: 1.35rem; }
.path-card h2 { margin-top: 0; }
.steps { padding-inline-start: 1.15rem; margin: 0 0 1.1rem; }
.steps li { margin: .55rem 0; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: .8rem 1rem; border-radius: 12px; margin-bottom: .5rem;
  background: #ecfeff; border: 1px solid #a5f3fc;
}
.messages li.error { background: #fef2f2; border-color: #fecaca; }
.messages li.success { background: #f0fdf4; border-color: #bbf7d0; }
.messages li.warning { background: #fffbeb; border-color: #fde68a; }
.messages li.info { background: #eff6ff; border-color: #bfdbfe; }

/* Footer */
.footer {
  border-top: 1px solid #1e293b; background: #0b1220; color: #94a3b8;
  padding: 2.25rem 0 1.4rem; margin-top: auto;
}
.footer a { color: #e2e8f0; }
.footer-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer h4 { margin: 0 0 .55rem; color: #fff; font-size: .95rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: .35rem 0; font-size: .9rem; }
.disclaimer {
  margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #1e293b;
  font-size: .76rem; color: #64748b;
}

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #0f172a; color: #e2e8f0; padding: 1rem;
  box-shadow: 0 -8px 24px rgba(0,0,0,.22);
}
.cookie-banner .inner {
  width: min(var(--max), 100%); margin: 0 auto;
  display: grid; gap: .75rem;
}
@media (min-width: 700px) {
  .cookie-banner .inner { grid-template-columns: 1fr auto; align-items: center; }
}

/* Resume editor */
.section-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.section-card summary {
  cursor: pointer; padding: .95rem 1rem; font-weight: 750; background: #f8fafc;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.section-card summary::-webkit-details-marker { display: none; }
.section-card[open] summary { border-bottom: 1px solid var(--border); }
.section-body { padding: 1rem; }
.item-row {
  display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start;
  padding: .65rem 0; border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: 0; }

/* Resume preview */
.resume-preview {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem; max-width: 800px; margin: 0 auto;
}
.resume-preview.tpl-modern { border-top: 5px solid #0d9488; }
.resume-preview.tpl-classic { border-top: 5px solid #1a365d; }
.resume-preview.tpl-minimal { border-top: 2px solid #111827; }
.resume-preview.tpl-compact { border-top: 5px solid #b45309; font-size: .92rem; }
.resume-preview h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.resume-preview h2 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--primary); margin: 1.1rem 0 .4rem; border-bottom: 1px solid var(--border);
  padding-bottom: .2rem;
}
.resume-preview .rp-meta { color: var(--muted); font-size: .9rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td {
  text-align: start; padding: .7rem .5rem; border-bottom: 1px solid var(--border);
}
table.data th {
  font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}

/* Empty / score */
.empty {
  text-align: center; padding: 2.2rem 1rem; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 14px; background: #fff;
}
.score-big { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1; }
.sticky-actions {
  position: sticky; bottom: 0; background: rgba(244,247,246,.95);
  backdrop-filter: blur(8px); padding: .75rem 0; border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.prose p { margin: 0 0 .75rem; }
.prose h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.prose ul { padding-inline-start: 1.2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@media print {
  .topbar, .footer, .cookie-banner, .no-print { display: none !important; }
  body { background: #fff; }
  .resume-preview { box-shadow: none; border: 0; }
}

/* ── Wizard (CV + job forms) ─────────────────────────── */
.wizard { max-width: 560px; margin: 0 auto; }
.wizard-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .75rem; margin-bottom: .85rem; flex-wrap: wrap;
}
.wizard-title {
  margin: 0; font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  letter-spacing: -0.03em; font-weight: 800;
}
.wizard-hint {
  margin: 0 0 1rem; color: var(--muted); font-size: .92rem;
  background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px;
  padding: .65rem .8rem;
}
.wizard-steps {
  display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .35rem;
  margin-bottom: .45rem; -webkit-overflow-scrolling: touch;
}
.wizard-dot {
  flex: 1 0 auto; min-width: 4.2rem; display: flex; flex-direction: column;
  align-items: center; gap: .2rem; padding: .4rem .3rem; border: 0;
  background: transparent; cursor: pointer; text-decoration: none; color: var(--muted);
  font: inherit;
}
.wizard-dot .n {
  width: 1.7rem; height: 1.7rem; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: .8rem; font-weight: 800;
  background: #e2e8f0; color: #475569;
}
.wizard-dot .l { font-size: .65rem; font-weight: 650; white-space: nowrap; }
.wizard-dot.is-done .n { background: var(--primary-soft); color: var(--primary-dark); }
.wizard-dot.is-active .n {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.wizard-dot.is-active { color: var(--primary-dark); }
.wizard-dot:hover { text-decoration: none; color: var(--primary-dark); }
.wizard-bar {
  height: 5px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
  margin-bottom: 1rem;
}
.wizard-bar > span {
  display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #2dd4bf);
  border-radius: 999px; transition: width .25s ease;
}
.wizard-panel { padding: 1.15rem 1.1rem 1.25rem; }
.wizard-form .field:last-of-type { margin-bottom: .5rem; }
.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: .65rem; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.wizard-nav .btn { flex: 1 1 auto; min-width: 7rem; }
.wizard-nav .btn-primary { flex: 1.4 1 auto; }
.wiz-step[hidden] { display: none !important; }
.wiz-step.is-active { display: block; animation: wizIn .2s ease; }
@keyframes wizIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (min-width: 640px) {
  .wizard { max-width: 600px; }
  .wizard-dot .l { font-size: .72rem; }
}
.field-span-2 { grid-column: 1 / -1; }
