/* =============================================
   CV SUITE — STYLES PRINCIPAUX
   ============================================= */

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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #0ea5e9;
  --secondary-light: #e0f2fe;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --transition: .18s ease;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-brand .icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
}

.topbar-nav {
  display: none;
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--transition);
}

.topbar-link:hover { background: var(--bg); color: var(--text); }
.topbar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── LAYOUT ─────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  overflow-x: hidden;
  width: 100%;
}

/* Sidebar nav pour le constructeur */
.sidebar-nav {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 20px 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { border-left-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 14px; }

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  display: none;
}
.nav-badge.visible { display: inline-block; }

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 960px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

/* ── PAGE CONTAINER (sans sidebar) ─────────── */
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
}

.page-container.wide {
  max-width: 1100px;
}

/* ── CARDS / SECTIONS ───────────────────────── */
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  box-sizing: border-box;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.section-body { padding: 24px; }

/* ── FORM FIELDS ────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.col-span-2 { grid-column: span 2; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

.form-label .req { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-textarea.code {
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 12.5px;
  min-height: 200px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── ENTRY BLOCKS ───────────────────────────── */
.entry-block {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: border-color var(--transition);
  background: #fafbff;
}
.entry-block:hover { border-color: #c7d2fe; }

.entry-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entry-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
}

.entry-actions { display: flex; gap: 6px; }

/* ── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #fca5a5;
  padding: 6px 12px;
  font-size: 12px;
}
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }

.btn-add {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px dashed #a5b4fc;
  width: 100%;
  justify-content: center;
  padding: 10px;
}
.btn-add:hover { background: #e0e7ff; border-style: solid; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 10px; }
.btn-xl { padding: 14px 36px; font-size: 16px; border-radius: 12px; }

/* ── THEME PICKER ───────────────────────────── */
.theme-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.theme-option { display: none; }
.theme-label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: var(--transition);
}
.theme-swatch {
  width: 56px; height: 56px;
  border-radius: 12px;
  border: 3px solid transparent;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.theme-option:checked + .theme-label .theme-swatch {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
  transform: scale(1.08);
}
.theme-option:checked + .theme-label { color: var(--primary); }

/* ── SKILL TAGS ─────────────────────────────── */
.skill-preview { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ── LOADING OVERLAY ────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 52px; height: 52px;
  border: 4px solid #e0e7ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner.big { width: 72px; height: 72px; border-width: 5px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── PROGRESS BAR (generating page) ────────── */
.progress-bar-track {
  width: 100%; height: 8px;
  background: #e0e7ff; border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 40%; background: var(--primary); border-radius: 4px;
}
.progress-bar-fill.animated {
  animation: progress-slide 1.6s ease-in-out infinite;
}
@keyframes progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.loading-text { font-weight: 600; color: var(--text); font-size: 16px; }
.loading-sub { font-size: 13px; color: var(--muted); }

/* ── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ── ALERT / ERROR BOX ──────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-danger { background: var(--danger-light); color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--secondary-light); color: #0c4a6e; border: 1px solid #7dd3fc; }

/* ── SCORE BADGES ───────────────────────────── */
.score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  min-width: 100px;
}
.score-value { font-size: 28px; line-height: 1; }
.score-label { font-size: 11px; margin-top: 4px; opacity: .75; }
.score-green { background: var(--success-light); color: #065f46; }
.score-yellow { background: var(--warning-light); color: #92400e; }
.score-red { background: var(--danger-light); color: #b91c1c; }

/* ── RESULTS HEADER ─────────────────────────── */
.results-header {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.results-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.results-job-info { flex: 1; }

.results-job-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.results-company {
  font-size: 16px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

.results-scores {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.results-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.results-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.results-tag.blocking { background: var(--danger-light); color: #b91c1c; border-color: #fca5a5; }
.results-tag.missing { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }

/* ── DOWNLOAD GRID ──────────────────────────── */
.download-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── TABS ───────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: inherit;
  border-radius: 6px 6px 0 0;
}

.tab-btn:hover { color: var(--primary); background: var(--primary-light); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── TEXT CONTENT DISPLAY ───────────────────── */
.text-display {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
  font-family: inherit;
  min-height: 200px;
  box-sizing: border-box;
}

.text-display.editable {
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}
.text-display.editable:focus { border-color: var(--primary); }

.outreach-textarea {
  min-height: min(68vh, 760px);
  padding: 24px;
  font-size: 14px;
  line-height: 1.9;
}

.md-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.md-content h2 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; color: var(--text); }
.md-content h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; color: var(--primary); }
.md-content strong { font-weight: 700; }
.md-content em { font-style: italic; }
.md-content blockquote { border-left: 3px solid var(--primary); padding-left: 14px; color: var(--muted); margin: 8px 0; }
.md-content ul, .md-content ol { padding-left: 20px; margin: 6px 0; }
.md-content li { margin: 4px 0; }
.md-content p { margin: 8px 0; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.md-content code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12.5px; }

/* ── INPUT TABS (URL / Texte) ───────────────── */
.input-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}

.input-tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  font-family: inherit;
}

.input-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.input-tab-btn:hover { color: var(--primary); }

.input-tab-panel { display: none; }
.input-tab-panel.active { display: block; }

/* ── CV SOURCE TOGGLE ───────────────────────── */
.toggle-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle-opt input { display: none; }

.toggle-opt label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  color: var(--muted);
}

.toggle-opt input:checked + label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ── DASHBOARD ──────────────────────────────── */
.dashboard-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.dashboard-hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.dashboard-hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}

.dashboard-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,.12);
}

.dashboard-card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 26px;
  margin-bottom: 4px;
}

.dashboard-card-icon.blue { background: var(--primary-light); }
.dashboard-card-icon.cyan { background: var(--secondary-light); }

.dashboard-card h2 { font-size: 18px; font-weight: 700; }
.dashboard-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; flex: 1; }
.dashboard-card .cta { color: var(--primary); font-size: 13px; font-weight: 600; margin-top: 4px; }

/* ── HISTORY TABLE ──────────────────────────── */
/* Wrapper scrollable horizontalement pour petits écrans */
.history-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
  max-width: 100%;
}
.history-table-wrap::-webkit-scrollbar { height: 6px; }
.history-table-wrap::-webkit-scrollbar-track { background: transparent; }
.history-table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }

.history-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.history-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  background: #fafafa;
}

.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-green { background: var(--success-light); color: #065f46; }
.badge-yellow { background: var(--warning-light); color: #92400e; }
.badge-red { background: var(--danger-light); color: #b91c1c; }
.badge-grey { background: var(--bg); color: var(--muted); }

/* ── RECENT JOBS LIST ───────────────────────── */
.recent-section { margin-top: 40px; }
.recent-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--text); }

.recent-item {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  border: 1.5px solid var(--border);
}

.recent-item:hover { border-color: var(--primary); }
.recent-item-info { flex: 1; }
.recent-item-title { font-weight: 600; font-size: 14px; }
.recent-item-company { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.recent-item-scores { display: flex; gap: 8px; flex-shrink: 0; }

/* ── COPY BUTTON ────────────────────────────── */
.copy-btn {
  font-size: 12px;
  padding: 5px 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-weight: 500;
}
.copy-btn:hover { background: var(--bg); color: var(--text); }
.copy-btn.copied { color: var(--success); border-color: #6ee7b7; }

/* ── LETTER DOCUMENT PREVIEW ───────────────── */
.letter-preview-outer {
  background: #cbd5e1;
  border-radius: 10px;
  padding: 28px 20px;
  overflow-y: auto;
  max-height: 860px;
  display: flex;
  justify-content: center;
}

.letter-pdf-preview {
  width: 100%;
  max-width: 740px;
  height: 1000px;
  border: none;
  background: #fff;
  box-shadow: 0 6px 32px rgba(0,0,0,.18);
  border-radius: 3px;
}

.letter-pdf-preview.is-loading {
  opacity: 0.65;
}

/* Modes de la lettre: aperçu vs édition */
.letter-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.letter-mode-btns {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: 8px;
}

.letter-mode-btn {
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all var(--transition);
  font-family: inherit;
}

.letter-mode-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.letter-editor-panel { display: none; }
.letter-editor-panel.visible { display: block; }

/* ── CV YAML EDITOR ─────────────────────────── */
.yaml-editor {
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  background: #0f172a;
  color: #e2e8f0;
  border: 2px solid #1e293b;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  resize: vertical;
  min-height: 480px;
  outline: none;
  transition: border-color var(--transition);
}

.yaml-editor:focus { border-color: var(--primary); }

.yaml-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.regen-status {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  display: none;
}
.regen-status.success { background: var(--success-light); color: #065f46; display: inline-block; }
.regen-status.error { background: var(--danger-light); color: #b91c1c; display: inline-block; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 900px) {
  .main-content { padding: 16px 12px; max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .dashboard-cards { grid-template-columns: 1fr; }
  .results-meta { flex-direction: column; }
}

/* ── MOBILE HAMBURGER MENU ─────────────────── */
.topbar-burger {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
  order: 10;
}
.topbar-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.topbar-burger span + span { margin-top: 5px; }
.topbar-burger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.topbar-burger.open span:nth-child(2) { opacity: 0; }
.topbar-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 99;
  padding: 12px 16px;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--transition);
}
.mobile-nav a:hover { background: var(--bg); color: var(--text); }
.mobile-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* Auth buttons hidden when logged in — moved to burger menu */
.topbar-auth-logged {
  display: none;
}

@media (max-width: 680px) {
  .sidebar-nav { display: none; }
  .topbar { padding: 0 16px; }
  .page-container { padding: 20px 16px; }
}

/* =============================================
   LANDING PAGE
   ============================================= */

/* ── HERO ───────────────────────────────────── */
.landing-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
  color: #fff;
  padding: 80px 32px 72px;
  text-align: center;
}
.landing-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.landing-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 28px;
  color: rgba(255,255,255,.9);
}
.landing-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -.02em;
}
.landing-title-accent {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-subtitle {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255,255,255,.8);
  max-width: 580px;
  margin: 0 auto 36px;
}
.landing-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.btn-hero-primary {
  background: #fff;
  color: #312e81;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
}
.btn-hero-primary:hover { background: #eef2ff; transform: translateY(-1px); }
.btn-hero-secondary {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,.22); }

/* ── STATS BAR ──────────────────────────────── */
.landing-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  padding: 18px 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}
.landing-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.landing-stat-label {
  font-size: 11.5px;
  color: rgba(255,255,255,.65);
  margin-top: 4px;
  text-align: center;
}
.landing-stat-sep {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.2);
}

/* ── SECTIONS ───────────────────────────────── */
.landing-section {
  padding: 72px 32px;
}
.landing-section--alt {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.landing-cta-section {
  padding: 80px 32px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f4fd 100%);
  border-top: 1px solid var(--border);
}
.landing-container {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-section-header {
  text-align: center;
  margin-bottom: 48px;
}
.landing-section-header h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.landing-section-header p {
  font-size: 16px;
  color: var(--muted);
}

/* ── FEATURE CARDS ──────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 24px rgba(79,70,229,.12);
  transform: translateY(-2px);
}
.feature-card--primary {
  background: linear-gradient(135deg, #f0f4ff 0%, #eef2ff 100%);
  border-color: #c7d2fe;
}
.feature-icon {
  font-size: 32px;
}
.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.feature-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.feature-list li { padding: 0; }
.feature-cta {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
}

/* ── STEPS ──────────────────────────────────── */
.steps-grid {
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.step-card {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
  padding: 24px 20px;
}
.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}
.step-arrow {
  font-size: 28px;
  color: var(--border);
  align-self: center;
  padding: 0 8px;
  margin-top: -20px;
}

/* =============================================
   AUTH
   ============================================= */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--bg);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 28px;
  justify-content: center;
}
.auth-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-message {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-message--error {
  background: var(--danger-light);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.auth-message--success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.auth-sep {
  text-align: center;
  margin: 18px 0;
  position: relative;
  color: var(--muted);
  font-size: 12px;
}
.auth-sep::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-sep span {
  background: var(--card);
  position: relative;
  padding: 0 10px;
}

.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.btn-oauth:hover { background: var(--bg); border-color: #94a3b8; }

.auth-footer-link {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}
.auth-footer-link a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ── AUTH NAV USER ──────────────────────────── */
.topbar-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-user-btn {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}
.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* ── RESPONSIVE LANDING ─────────────────────── */
@media (max-width: 900px) {
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); }
  .landing-stat-sep { display: none; }
  .landing-stats { gap: 16px; }
}

/* =============================================
   DASHBOARD (connected view)
   ============================================= */

/* ── Hero banner ── */
.dash-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 50%, #4f46e5 100%);
  border-radius: 16px;
  padding: 36px 40px;
  margin-bottom: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(99,102,241,.35) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(14,165,233,.2) 0%, transparent 50%);
  pointer-events: none;
}

.dash-hero-text { flex: 1; min-width: 0; position: relative; }

.dash-hero-greeting {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 6px;
}

.dash-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}

.dash-hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  max-width: 520px;
  line-height: 1.6;
}

/* ── Profile completeness ring (hero version) ── */
.dash-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.dash-ring-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  text-align: center;
}

.dash-ring-btn {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: 4px 14px;
  text-decoration: none;
  transition: background var(--transition);
}
.dash-ring-btn:hover { background: rgba(255,255,255,.25); }

/* ── Stats row ── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.dash-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.dash-stat:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(79,70,229,.1); }

.dash-stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.dash-stat-icon.violet { background: var(--primary-light); }
.dash-stat-icon.cyan   { background: var(--secondary-light); }
.dash-stat-icon.green  { background: var(--success-light); }

.dash-stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.dash-stat-label { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 3px; }

/* ── Quick action cards ── */
.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.dash-quick-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.dash-quick-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(79,70,229,.14);
  transform: translateY(-2px);
}

.dash-quick-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.dash-quick-icon.gradient-violet {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
}
.dash-quick-icon.gradient-cyan {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}
.dash-quick-icon.gradient-amber {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.dash-quick-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.dash-quick-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.dash-quick-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Section wrapper ── */
.dash-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.dash-section-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-section-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dash-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.dash-section-body { padding: 22px; }

/* ── Profile subsections ── */
.dash-profile-group { margin-bottom: 20px; }
.dash-profile-group:last-child { margin-bottom: 0; }

.dash-profile-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-exp-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background var(--transition);
}
.dash-exp-item:last-child { margin-bottom: 0; }
.dash-exp-item:hover { background: #eef2ff; }

.dash-exp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

.dash-exp-title { font-size: 13px; font-weight: 700; color: var(--text); }
.dash-exp-company { font-size: 12px; color: var(--primary); font-weight: 500; margin-top: 2px; }
.dash-exp-dates { font-size: 11px; color: var(--muted); margin-top: 2px; }

.dash-edu-item {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 8px;
}
.dash-edu-item:last-child { margin-bottom: 0; }
.dash-edu-degree { font-size: 13px; font-weight: 700; }
.dash-edu-school { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dash-skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dash-skill-row:last-child { margin-bottom: 0; }
.dash-skill-cat {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  width: 130px;
  flex-shrink: 0;
}
.dash-skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dash-skill-tag {
  font-size: 11px;
  padding: 2px 9px;
  background: rgba(79,70,229,.08);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 500;
}

.dash-lang-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-lang-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
}

/* ── Missing profile alert ── */
.dash-missing-alert {
  background: linear-gradient(135deg, rgba(79,70,229,.06), rgba(14,165,233,.06));
  border: 1px solid rgba(79,70,229,.18);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.dash-missing-icon { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.dash-missing-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.dash-missing-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-missing-chip {
  font-size: 12px;
  color: var(--primary);
  background: rgba(79,70,229,.08);
  padding: 3px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid rgba(79,70,229,.15);
  transition: background var(--transition);
}
.dash-missing-chip:hover { background: rgba(79,70,229,.15); }

/* ── Recent items ── */
.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition), box-shadow var(--transition);
  border: 1.5px solid transparent;
}
.dash-recent-item:last-child { margin-bottom: 0; }
.dash-recent-item:hover {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(79,70,229,.1);
}
.dash-recent-item-info { flex: 1; min-width: 0; }
.dash-recent-item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-recent-item-company { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-recent-item-scores { display: flex; gap: 8px; flex-shrink: 0; }
.dash-recent-arrow { color: var(--muted); font-size: 14px; flex-shrink: 0; }

/* ── Empty state ── */
.dash-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.dash-empty-icon { font-size: 36px; margin-bottom: 12px; }
.dash-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dash-empty-text { font-size: 13px; margin-bottom: 20px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ── Responsive dashboard ── */
@media (max-width: 780px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-quick-grid { grid-template-columns: 1fr; }
  .dash-hero { padding: 24px; }
  .dash-hero-title { font-size: 20px; }
}

@media (max-width: 520px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-ring-wrap { display: none; }
}

/* ── DASHBOARD URL BAR (connected hero) ───────────────────────────────────── */
.dash-url-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  max-width: 640px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
.dash-url-bar:focus-within {
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,.3);
}
.dash-url-icon {
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}
.dash-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  min-width: 0;
}
.dash-url-input::placeholder {
  color: rgba(255,255,255,.5);
}
.dash-url-btn {
  background: #fff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.dash-url-btn:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}

/* Pills under the dashboard hero */
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
}

/* ── LANDING URL BAR (non-connected hero) ─────────────────────────────────── */
.landing-url-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 14px;
  padding: 8px 8px 8px 18px;
  max-width: 580px;
  margin: 0 auto 0;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.landing-url-bar:hover {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 0 3px rgba(99,102,241,.25);
}
.landing-url-icon {
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}
.landing-url-placeholder {
  flex: 1;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  text-align: left;
}
.landing-url-btn {
  background: #fff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Deliverables row under landing hero */
.landing-deliverables {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
  margin-bottom: 12px;
}
.landing-deliverable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}
.landing-del-icon {
  font-size: 14px;
}

/* ── CV MODEL CARDS (landing page) ── */
.cv-model-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: box-shadow .2s, transform .15s;
}
.cv-model-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.cv-model-preview {
  position: relative;
  height: 80px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.cv-model-name {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 8px 2px;
  color: var(--heading);
}
.cv-model-desc {
  font-size: 11px;
  color: var(--muted);
  padding: 0 8px 10px;
}

@media (max-width: 640px) {
  .dash-url-bar { flex-direction: column; padding: 12px; gap: 8px; }
  .dash-url-input { width: 100%; text-align: center; }
  .dash-url-btn { width: 100%; text-align: center; }
  .landing-url-bar { flex-direction: column; padding: 12px; gap: 8px; }
  .landing-url-placeholder { text-align: center; }
  .landing-url-btn { width: 100%; text-align: center; }
}

@media (max-width: 768px) {
  /* Before/after comparison grid */
  .landing-section [style*="grid-template-columns:1fr 1fr"],
  .landing-section [style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
  /* CV model grid: 2 cols on tablet, 1 on very small */
  .landing-section [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .landing-section [style*="grid-template-columns:repeat(4"],
  .landing-section [style*="grid-template-columns:repeat(2"],
  .landing-section [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — AUTO-SCALE pour écrans petits / différentes tailles
   ══════════════════════════════════════════════════════════════════════════ */

/* Empêcher le scroll horizontal */
html, body { overflow-x: hidden; }

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .landing-hero { padding: 56px 24px 48px; }
  .landing-section { padding: 48px 16px; }
  .landing-cta-section { padding: 48px 16px; }
  .landing-container { padding: 0 8px; }

  /* Social proof bar */
  .landing-section [style*="gap:40px"] { gap: 20px !important; }
  .landing-section [style*="font-size:36px"] { font-size: 28px !important; }
}

/* ── Small tablet / large phone (≤ 768px) ── */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; height: 54px; }
  .topbar-brand { font-size: 15px; gap: 6px; }
  .topbar-brand .icon { width: 28px; height: 28px; font-size: 14px; }
  .topbar-auth .topbar-user-btn { max-width: 120px; font-size: 12px; }

  .landing-hero { padding: 40px 16px 36px; }
  .landing-subtitle { font-size: 14px !important; }
  .landing-stats { flex-wrap: wrap; justify-content: center; }
  .landing-stat { min-width: 100px; }

  .landing-deliverables { gap: 8px !important; }
  .landing-deliverable { font-size: 12px; padding: 6px 10px !important; }
  .landing-del-icon { font-size: 14px !important; width: 24px !important; height: 24px !important; }

  /* Sections padding */
  .page-container { padding: 16px 12px !important; }

  /* Social proof bar inline styles */
  section[style*="padding:40px 24px"] { padding: 24px 12px !important; }

  /* CTA bottom */
  .landing-cta-section h2,
  .landing-section-header h2 { font-size: clamp(20px, 4vw, 28px) !important; }

  /* ATS grid 3 cols → 1 col */
  .landing-section [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Phone (≤ 640px) ── */
@media (max-width: 640px) {
  .topbar-auth { gap: 4px; }
  .topbar-auth .btn { padding: 5px 8px; font-size: 12px; }

  .landing-hero { padding: 32px 12px 28px; }
  .landing-badge { font-size: 11px; padding: 4px 12px; margin-bottom: 16px; }
  .landing-title { margin-bottom: 12px; }

  /* Hero CTA buttons */
  .btn-hero-primary, .btn-hero-secondary {
    font-size: 13px !important;
    padding: 10px 18px !important;
  }

  /* Social proof numbers */
  section[style*="padding:40px 24px"] [style*="font-size:36px"] {
    font-size: 24px !important;
  }
  section[style*="padding:40px 24px"] [style*="width:1px"] {
    display: none !important;
  }
  section[style*="padding:40px 24px"] [style*="gap:40px"] {
    gap: 16px !important;
  }

  /* Before/after comparison boxes */
  .landing-section [style*="padding:28px 24px"] {
    padding: 16px 14px !important;
  }
  .landing-section [style*="font-size:20px"] {
    font-size: 16px !important;
  }

  /* Feature cards */
  .feature-card { padding: 20px 16px; }

  /* CV model cards */
  .cv-model-card { min-width: 0; }
  .cv-model-preview { height: 50px; }
  .cv-model-name { font-size: 12px; }
  .cv-model-desc { font-size: 10px; }

  /* History detail & results — stack grids on mobile */
  .section-card [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .section-card pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    font-size: 11px !important;
  }
  .section-card textarea {
    min-height: 200px;
    font-size: 12px !important;
  }
  .section-card form[style*="display:flex"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  .section-card form[style*="display:flex"] select,
  .section-card form[style*="display:flex"] button {
    width: 100%;
  }
  .results-header { flex-direction: column; }
  .results-meta { flex-direction: column; }

  /* Dashboard connected */
  .dash-hero { border-radius: 10px; padding: 20px 14px !important; }
  .dash-hero-title { font-size: 18px !important; }
  .dash-hero-subtitle { font-size: 13px !important; }
  .dash-pill { font-size: 11px; padding: 4px 10px; }
  .dash-section { margin-bottom: 16px; }
  .dash-section-head { padding: 12px 14px; }
  .dash-section-body { padding: 12px 14px; }
  .dash-quick-card { padding: 14px; }
  .dash-quick-icon { width: 36px; height: 36px; font-size: 16px; }
  .dash-quick-title { font-size: 13px; }
  .dash-quick-desc { font-size: 11.5px; }
  .dash-stat-value { font-size: 22px; }
  .dash-missing-alert { padding: 12px; }
}

/* ── Very small phone (≤ 400px) ── */
@media (max-width: 400px) {
  .topbar { height: 48px; padding: 0 8px; }
  .topbar-brand { font-size: 14px; }
  .topbar-auth .topbar-user-btn { display: none; }

  .landing-hero { padding: 24px 10px 20px; }
  .landing-title { font-size: 24px !important; }
  .landing-subtitle { font-size: 13px !important; }

  .dash-stats { gap: 8px; }
  .dash-stat { padding: 12px; }

  /* Pills wrap tighter */
  .landing-deliverables { gap: 4px !important; }
  .dash-pill { font-size: 10px; padding: 3px 8px; }

  .page-container { padding: 12px 8px !important; }
}

/* ── WCAG 2.4.1: Skip navigation link (visually hidden, shown on focus) ── */
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--primary, #6366f1);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  z-index: 10000;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ── ADVISOR ANSWER (Markdown rendered) ────────── */
.advisor-answer {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.advisor-answer p {
  margin: 0 0 12px;
}
.advisor-answer p:last-child {
  margin-bottom: 0;
}
.advisor-answer strong {
  font-weight: 600;
  color: var(--text);
}
.advisor-answer ol,
.advisor-answer ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}
.advisor-answer li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.advisor-answer li::marker {
  color: var(--primary);
  font-weight: 600;
}
