:root {
  --ink: #17212b;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --brand: #0f766e;
  --brand-dark: #0b514c;
  --brand-soft: #e7f7f4;
  --accent: #f0b44c;
  --radius: 16px;
  font-family: "Alexandria", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  height: 72px;
  padding: 0 3vw;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 132px; height: 48px; object-fit: contain; object-position: right center; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { padding: 9px 11px; border-radius: 9px; color: #475467; text-decoration: none; font-size: 11px; font-weight: 700; }
.main-nav a:hover, .main-nav a.active { color: var(--brand-dark); background: var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.save-state { color: var(--brand); font-size: 12px; }
.iraq-badge { padding: 7px 10px; border-radius: 999px; background: #f4f7f6; color: #344054; font-size: 11px; font-weight: 700; }

.button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: white; box-shadow: 0 6px 18px rgba(15,118,110,.22); }
.button-primary:hover { background: var(--brand-dark); }
.button-ghost { background: white; color: var(--ink); border: 1px solid var(--line); }
.button-soft { background: var(--brand-soft); color: var(--brand-dark); }
.button-dark { background: var(--ink); color: white; min-width: 100px; }
.button-add { width: 100%; background: var(--brand-soft); color: var(--brand-dark); border: 1px dashed #79bdb7; }

.app-shell { display: grid; grid-template-columns: minmax(440px, 48%) minmax(520px, 52%); min-height: calc(100vh - 72px); }
.editor-panel { padding: 38px clamp(24px,4vw,64px) 56px; background: var(--surface); border-left: 1px solid var(--line); }
.intro .eyebrow { display: inline-block; color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .04em; margin-bottom: 10px; }
.intro h1 { font-size: clamp(28px,3vw,44px); line-height: 1.2; margin: 0 0 10px; letter-spacing: -.04em; }
.intro p { color: var(--muted); line-height: 1.8; margin: 0; }
.completion-card { margin-top: 24px; padding: 15px 17px; border: 1px solid #dce6e4; border-radius: 14px; background: linear-gradient(135deg,#fbfdfc,#f2f8f7); }
.completion-copy { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; }
.completion-copy b { color: var(--brand); font-size: 14px; }
.completion-track { height: 7px; margin: 10px 0 7px; overflow: hidden; border-radius: 99px; background: #dce8e6; }
.completion-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#31a89c); transition: width .35s ease; }
.completion-card small { color: var(--muted); font-size: 10px; }

.steps { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; margin: 30px 0; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
.step { min-width: 70px; border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 12px; padding: 9px 5px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.step span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 4px; background: #f2f4f7; border-radius: 50%; }
.step.active { color: var(--brand-dark); border-color: #87c8c2; background: var(--brand-soft); }
.step.active span { background: var(--brand); color: white; }

.form-section { display: none; animation: reveal .25s ease; }
.form-section.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.section-heading { margin-bottom: 22px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { font-size: 22px; margin: 0; }
.section-heading p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 7px 0 0; }
.section-number { color: var(--accent); font-size: 12px; font-weight: 800; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; color: #344054; font-size: 13px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.field em { color: #98a2b3; font-size: 9px; font-style: normal; font-weight: 500; }
.photo-upload-card { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 15px; border: 1px dashed #a9c9c5; border-radius: 14px; background: #f8fcfb; }
.photo-upload-preview { flex: 0 0 auto; display: grid; place-items: center; width: 78px; height: 78px; overflow: hidden; border-radius: 50%; background: #dcebe9; color: var(--brand); font-size: 11px; font-weight: 700; border: 3px solid white; box-shadow: 0 0 0 1px #bed7d3; }
.photo-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-copy { flex: 1; min-width: 0; }
.photo-upload-copy b { font-size: 13px; }
.photo-upload-copy em { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 500; }
.photo-upload-copy p { margin: 5px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.photo-actions { display: flex; align-items: center; gap: 10px; }
.upload-button { display: inline-block; padding: 8px 12px; font-size: 11px; cursor: pointer; }
.photo-remove { border: 0; background: transparent; color: #b42318; font-size: 10px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d9dee7; background: #fbfcfd; color: var(--ink); border-radius: 10px; padding: 12px 13px; outline: 0; font-weight: 400; resize: vertical; transition: .2s; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { background: white; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.field small { align-self: flex-end; color: var(--muted); font-weight: 400; }
.tip { margin-top: 18px; padding: 13px 15px; border-radius: 10px; background: #fffaeb; color: #72510d; font-size: 13px; line-height: 1.7; border-right: 3px solid var(--accent); }
.repeat-list { display: grid; gap: 14px; margin-bottom: 14px; }
.repeat-card { position: relative; padding: 18px; background: #fafafa; border: 1px solid var(--line); border-radius: 13px; }
.remove-item { position: absolute; top: 8px; left: 8px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff1f1; color: #b42318; font-size: 20px; line-height: 1; }
.form-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-navigation span { font-size: 12px; color: var(--muted); }

.preview-panel { padding: 28px clamp(18px,3vw,48px); background: #e9edef; overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.preview-toolbar > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.preview-toolbar small { color: var(--muted); font-size: 11px; }
.customizer { max-width: 720px; margin: 0 auto 14px; padding: 11px 13px; display: grid; grid-template-columns: 1.2fr 1fr .8fr 1.25fr; gap: 10px; align-items: end; border: 1px solid rgba(15,118,110,.15); border-radius: 13px; background: rgba(255,255,255,.84); }
.custom-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.custom-control > span { color: #667085; font-size: 9px; font-weight: 700; }
.custom-control select { height: 31px; border: 1px solid #d0d5dd; border-radius: 8px; background: white; color: #344054; padding: 3px 7px; font: 10px inherit; outline: 0; }
.segmented { display: flex; height: 31px; padding: 3px; border-radius: 8px; background: #edf1f3; }
.segmented button { flex: 1; padding: 3px 7px; border: 0; border-radius: 6px; background: transparent; color: #667085; font-size: 9px; font-weight: 700; }
.segmented button.active { background: white; color: var(--brand); box-shadow: 0 1px 4px rgba(16,24,40,.12); }
.color-options { display: flex; align-items: center; gap: 6px; min-height: 31px; }
.color-swatch { width: 21px; height: 21px; padding: 0; border: 3px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #c8ced6; }
.color-swatch.active { box-shadow: 0 0 0 2px #17212b; }
.color-custom { position: relative; width: 23px; height: 23px; overflow: hidden; border-radius: 50%; background: conic-gradient(red,yellow,lime,aqua,blue,magenta,red); box-shadow: 0 0 0 1px #c8ced6; cursor: pointer; }
.color-custom input { position: absolute; inset: -8px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.template-picker { display: flex; gap: 7px; background: rgba(255,255,255,.7); border-radius: 99px; padding: 6px; }
.template-dot { width: 23px; height: 23px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #cbd2da; }
.template-dot:nth-child(1) { background: #0f766e; }
.template-dot:nth-child(2) { background: #2d3440; }
.template-dot:nth-child(3) { background: #8c5e3c; }
.template-dot:nth-child(4) { background: #183b66; }
.template-dot:nth-child(5) { background: #6f2436; }
.template-dot:nth-child(6) { background: #ffffff; }
.template-dot.active { box-shadow: 0 0 0 2px var(--ink); }
.paper-wrap { max-width: 720px; margin: 0 auto; filter: drop-shadow(0 18px 35px rgba(23,33,43,.14)); }
.resume { --cv: #0f766e; --cv-font: "Alexandria", Tahoma, Arial, sans-serif; width: 100%; aspect-ratio: 210 / 297; min-height: 740px; background: white; overflow: hidden; color: #24313d; direction: rtl; font-family: var(--cv-font); }
.resume-header { min-height: 128px; padding: 34px 40px; display: flex; align-items: center; gap: 22px; color: white; background: var(--cv); }
.initials { flex: 0 0 auto; display: grid; place-items: center; width: 70px; height: 70px; overflow: hidden; border: 2px solid rgba(255,255,255,.65); border-radius: 50%; background: rgba(255,255,255,.12); font-size: 25px; font-weight: 800; }
.initials img { width: 100%; height: 100%; object-fit: cover; }
.resume-identity h2 { margin: 0 0 7px; font-size: 30px; line-height: 1.2; }
.resume-identity p { margin: 0; opacity: .88; font-size: 15px; }
.resume-body { display: grid; grid-template-columns: 31% 69%; min-height: calc(100% - 128px); }
.resume-side { padding: 30px 24px; background: #f1f7f6; }
.resume-main { padding: 31px 34px; }
.resume section { margin-bottom: 27px; }
.resume h3 { margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #dfe6e8; color: var(--cv); font-size: 13px; }
.resume-side h3 { border-color: #cadad8; }
.contact-list, .plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.contact-list li, .plain-list li { font-size: 9.5px; line-height: 1.55; overflow-wrap: anywhere; }
.contact-list b { display: block; font-size: 8px; color: var(--cv); margin-bottom: 1px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill { padding: 5px 7px; border-radius: 5px; background: white; color: #344054; font-size: 8.5px; border: 1px solid #d9e5e3; }
.summary-text { font-size: 10px; line-height: 1.8; margin: 0; white-space: pre-line; }
.resume-item { position: relative; padding-right: 14px; margin-bottom: 17px; }
.resume-item::before { content: ''; position: absolute; right: 0; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--cv); }
.resume-item h4 { margin: 0 0 4px; font-size: 11px; }
.resume-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--cv); font-size: 8.5px; font-weight: 700; }
.resume-item p { margin: 6px 0 0; font-size: 9px; line-height: 1.65; white-space: pre-line; }
.privacy-note { text-align: center; color: #667085; font-size: 11px; }

.template-classic { --cv: #2d3440; }
.template-classic .resume-header { justify-content: center; text-align: center; background: white; color: #2d3440; border-top: 9px solid var(--cv); border-bottom: 1px solid #ccd1d7; }
.template-classic .resume-body { grid-template-columns: 29% 71%; }
.template-classic .resume-side { background: #f5f5f5; }
.template-minimal { --cv: #8c5e3c; }
.template-minimal .resume-header { background: #fff; color: #27201c; border-right: 12px solid var(--cv); padding-right: 30px; }
.template-minimal .initials { color: var(--cv); border-color: var(--cv); background: #faf6f3; }
.template-minimal .resume-side { background: #fcfaf8; }

.template-navy { --cv: #183b66; }
.template-navy .resume-header { background: linear-gradient(135deg,#102b4b,#24598e); border-bottom: 5px solid #cf9f4b; }
.template-navy .resume-side { background: #edf3f9; }
.template-navy .initials { border-radius: 12px; }
.template-navy .skill { border-radius: 99px; border-color: #c8d9eb; }

.template-royal { --cv: #6f2436; }
.template-royal .resume-header { background: #f8f2eb; color: #40252b; border-bottom: 8px solid #b98b44; }
.template-royal .initials { border-color: #b98b44; color: #6f2436; background: white; }
.template-royal .resume-side { background: #6f2436; color: #fff; }
.template-royal .resume-side h3 { color: #f1d59f; border-color: rgba(255,255,255,.22); }
.template-royal .contact-list b { color: #f1d59f; }
.template-royal .skill { color: white; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); }

.template-ats { --cv: #111827; color: #111827; }
.template-ats .resume-header { min-height: auto; padding: 27px 40px 20px; color: #111827; background: white; border-bottom: 2px solid #111827; }
.template-ats .initials { display: none; }
.template-ats .resume-body { display: flex; flex-direction: column; }
.template-ats .resume-main { order: 1; padding: 25px 40px 0; }
.template-ats .resume-side { order: 2; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; padding: 8px 40px 24px; background: white; }
.template-ats .resume-side section { margin: 0; }
.template-ats h3 { color: #111827; border-bottom: 1px solid #111827; }
.template-ats .contact-list b { color: #111827; }
.template-ats .skill { border-radius: 2px; border-color: #adb5bd; }
.resume.text-small .summary-text { font-size: 9px; }
.resume.text-small .resume-item p { font-size: 8px; }
.resume.text-small .resume-item h4 { font-size: 10px; }
.resume.text-small .contact-list li, .resume.text-small .plain-list li { font-size: 8.5px; }
.resume.text-large .summary-text { font-size: 11px; }
.resume.text-large .resume-item p { font-size: 10px; }
.resume.text-large .resume-item h4 { font-size: 12px; }
.resume.text-large .contact-list li, .resume.text-large .plain-list li { font-size: 10.5px; }

.site-footer { padding: 34px clamp(20px,5vw,70px) 22px; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; background: #101b25; color: #cbd5df; }
.site-footer img { width: 118px; height: 44px; object-fit: contain; object-position: right; filter: brightness(0) invert(1); }
.site-footer p { margin: 8px 0 0; max-width: 360px; font-size: 10px; line-height: 1.8; }
.site-footer nav { display: flex; flex-direction: column; gap: 9px; }
.site-footer a { color: #dce5ed; text-decoration: none; font-size: 11px; }
.site-footer a:hover { color: #72d2c8; }
.site-footer .copyright { grid-column: 1 / -1; max-width: none; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); text-align: center; }

.toast { position: fixed; z-index: 50; right: 50%; bottom: 28px; transform: translate(50%, 20px); padding: 11px 18px; border-radius: 10px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .25s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(50%, 0); }

@media (max-width: 1050px) {
  .site-header { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
  .app-shell { grid-template-columns: 1fr; }
  .editor-panel { border-left: 0; }
  .preview-panel { min-height: 700px; }
  .paper-wrap { max-width: 680px; }
}
@media (max-width: 650px) {
  .site-header { height: auto; min-height: 66px; padding: 12px 16px; }
  .brand { font-size: 19px; }
  .brand-logo { width: 104px; height: 40px; }
  .save-state, .iraq-badge, .header-actions .button-ghost, .header-actions .button-soft { display: none; }
  .main-nav { justify-content: flex-start; overflow-x: auto; padding-top: 7px; border-top: 1px solid var(--line); }
  .main-nav a { white-space: nowrap; }
  .button { padding: 10px 12px; font-size: 12px; }
  .editor-panel { padding: 27px 18px 40px; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .steps { margin: 22px 0; }
  .step { min-width: 55px; font-size: 0; }
  .step span { margin: 0; font-size: 12px; }
  .preview-panel { padding: 20px 8px; }
  .customizer { grid-template-columns: 1fr 1fr; margin-inline: 6px; }
  .resume { min-height: 560px; }
  .resume-header { padding: 22px 24px; min-height: 96px; }
  .initials { width: 50px; height: 50px; font-size: 18px; }
  .resume-identity h2 { font-size: 21px; }
  .resume-identity p { font-size: 11px; }
  .resume-body { min-height: calc(100% - 96px); }
  .resume-side { padding: 21px 14px; }
  .resume-main { padding: 22px 18px; }
  .resume section { margin-bottom: 18px; }
  .resume h3 { font-size: 10px; margin-bottom: 10px; }
  .summary-text { font-size: 7px; }
  .resume-item h4 { font-size: 8px; }
  .resume-item p, .contact-list li, .plain-list li { font-size: 6.5px; }
  .resume-meta, .skill { font-size: 6px; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer .copyright { grid-column: auto; }
}

@page { size: A4; margin: 0; }
@media print {
  body { background: white; }
  body * { visibility: hidden; }
  #resume, #resume * { visibility: visible; }
  #resume { position: absolute; inset: 0; width: 210mm; height: 297mm; min-height: 297mm; aspect-ratio: auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .resume-header { min-height: 38mm; }
  .resume-body { min-height: 259mm; }
}
