@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

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

:root {
  --orange: #FF6F15;
  --dark:   #3D4658;
  --light:  #F7F7F5;
  --gray1:  #c3c6cb;
  --gray2:  #a6aab2;
  --gray4:  #646b79;
  --blue:   #1F5C9E;
  --radius: 16px;
  --font:   'Cairo', sans-serif;
}

body { font-family: var(--font); color: var(--dark); background: var(--light); }

.main-wrap {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── Steps ─────────────────────────────────────────────────────── */
.step-section { display: none; }
.step-section.active { display: block; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero-text { text-align: center; margin-bottom: 36px; }
.kicker { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray4); font-weight: 700; margin-bottom: 8px; }
.hero-title { font-size: clamp(32px, 5vw, 52px); font-weight: 800; color: var(--dark); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 14px; }
.hero-title span { color: var(--orange); }
.hero-sub { font-size: 17px; color: var(--gray4); font-weight: 500; line-height: 1.65; max-width: 560px; margin: 0 auto; }

/* ── Step indicator ─────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot span {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: var(--gray1); color: #fff;
  transition: background 0.3s;
}
.step-dot label { font-size: 12px; font-weight: 600; color: var(--gray4); }
.step-dot.active span  { background: var(--orange); }
.step-dot.done span    { background: #2ecc71; }
.step-line {
  flex: 1; max-width: 80px; height: 2px;
  background: var(--gray1); margin: 0 8px; margin-bottom: 22px;
  transition: background 0.3s;
}
.step-line.done { background: #2ecc71; }

/* ── Upload card ────────────────────────────────────────────────── */
.upload-card {
  background: #fff;
  border: 2px dashed var(--gray1);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  max-width: 560px;
  margin: 0 auto;
}
.upload-card:hover, .upload-card.drag-over {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255,111,21,0.1);
}
.upload-icon { font-size: 56px; margin-bottom: 16px; }
.upload-title { font-size: 20px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.upload-sub   { font-size: 14px; color: var(--gray4); margin-bottom: 28px; font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: #fff;
  border: none; border-radius: 999px;
  padding: 12px 28px; font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #e86513; transform: scale(1.02); }
.btn-primary:disabled { background: var(--gray1); cursor: not-allowed; transform: none; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--dark);
  border: 2px solid var(--gray1); border-radius: 999px;
  padding: 10px 22px; font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

/* ── Processing ─────────────────────────────────────────────────── */
.processing-card {
  max-width: 480px; margin: 60px auto;
  background: #fff; border-radius: var(--radius);
  padding: 48px 40px; text-align: center;
  box-shadow: 0 8px 40px rgba(61,70,88,.1);
}
.spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid var(--gray1);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.processing-sub   { font-size: 14px; color: var(--gray4); margin-bottom: 28px; font-weight: 500; }
.processing-steps { text-align: left; }
.proc-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--gray4); }
.proc-icon { font-size: 18px; width: 24px; text-align: center; }
.proc-icon.done   { color: #2ecc71; }
.proc-icon.active { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Review header ──────────────────────────────────────────────── */
.review-header {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.review-name { font-size: clamp(24px, 4vw, 36px); font-weight: 800; color: var(--dark); }
.review-role { font-size: 16px; color: var(--orange); font-weight: 600; margin-top: 4px; }
.review-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── Tabs ────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid var(--gray1);
  margin-bottom: 24px;
}
.tab {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: 10px 18px; font-family: var(--font); font-size: 14px; font-weight: 700;
  color: var(--gray4); cursor: pointer; margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.tab:hover   { color: var(--dark); }
.tab.active  { color: var(--orange); border-bottom-color: var(--orange); }

.tab-content { margin-bottom: 40px; }

/* ── Cards (review sections) ────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.info-card {
  background: #fff; border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(61,70,88,.07);
}
.info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gray4); margin-bottom: 6px; }
.info-value { font-size: 15px; font-weight: 600; color: var(--dark); word-break: break-word; }
.info-value.empty { color: var(--gray2); font-style: italic; font-weight: 400; }

.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--gray4);
  margin: 28px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--gray1); }

/* ── Tables (education, languages, experience) ──────────────────── */
.cv-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(61,70,88,.07); }
.cv-table th { background: var(--dark); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 12px 16px; text-align: left; }
.cv-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--light); vertical-align: top; }
.cv-table tr:last-child td { border-bottom: none; }
.cv-table tr:hover td { background: var(--light); }

/* ── Experience cards ───────────────────────────────────────────── */
.exp-card {
  background: #fff; border-radius: 12px;
  padding: 20px 22px; margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(61,70,88,.07);
  border-left: 4px solid var(--orange);
}
.exp-period { font-size: 12px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.exp-position { font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.exp-employer { font-size: 14px; color: var(--gray4); margin-bottom: 10px; font-weight: 600; }
.exp-desc { font-size: 14px; color: var(--dark); line-height: 1.6; font-weight: 500; }

/* ── Skill tags ─────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  display: inline-block; padding: 5px 14px;
  background: rgba(255,111,21,0.08); color: var(--orange);
  border: 1px solid rgba(255,111,21,0.25); border-radius: 999px;
  font-size: 13px; font-weight: 700;
}

/* ── Key qualifications ─────────────────────────────────────────── */
.kq-block {
  background: #fff; border-radius: 12px; padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(61,70,88,.07);
  font-size: 15px; line-height: 1.75; font-weight: 500; color: var(--dark);
}

/* ── JSON editor ────────────────────────────────────────────────── */
.json-editor-panel {
  background: var(--dark); border-radius: var(--radius);
  padding: 24px; margin-bottom: 32px;
}
.json-editor-panel.hidden { display: none; }
.json-editor-label { color: #c3c6cb; font-size: 13px; margin-bottom: 12px; font-weight: 600; }
.json-editor-label strong { color: #fff; }
#json-editor {
  width: 100%; height: 400px; resize: vertical;
  background: #1e2530; color: #e8f0ff;
  border: 1px solid #4a5568; border-radius: 10px;
  padding: 16px; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px;
  line-height: 1.6; outline: none;
}
.json-editor-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

/* ── Download section ───────────────────────────────────────────── */
.download-section { margin-top: 16px; }
.download-label { font-size: 14px; font-weight: 700; color: var(--gray4); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.download-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-card {
  background: #fff; border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  box-shadow: 0 2px 20px rgba(61,70,88,.08);
  border: 2px solid transparent; transition: border-color 0.2s;
}
.dl-card:hover { border-color: var(--orange); }
.dl-flag { font-size: 40px; }
.dl-title { font-size: 18px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.dl-desc { font-size: 13px; color: var(--gray4); line-height: 1.55; font-weight: 500; }

/* ── Error & Empty ──────────────────────────────────────────────── */
.error-msg { color: #e74c3c; font-size: 14px; font-weight: 600; padding: 12px 16px; background: #fdf2f2; border-radius: 10px; margin-top: 12px; }
.error-msg.hidden { display: none; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray4); font-size: 15px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main-wrap { padding: 24px 16px 48px; }
  .download-cards { grid-template-columns: 1fr; }
  .review-header { flex-direction: column; }
  .dl-card { padding: 18px; }
}
