/* ============================================================
   RESUME MAKER — STYLES
   Palette: paper background, ink navy text, brass accent
   Type: Source Serif 4 (headings/resume), Inter (UI)
   ============================================================ */

:root{
  --paper:      #FAF7F1;
  --paper-dim:  #F1ECE1;
  --ink:        #1B2430;
  --ink-soft:   #4A5262;
  --ink-faint:  #8892A0;
  --line:       #DED6C4;
  --line-soft:  #E9E3D6;
  --brass:      #A97142;
  --brass-dark: #8C5B32;
  --teal:       #2F6F62;
  --teal-soft:  #E4EEE9;
  --danger:     #9B4038;
  --danger-soft:#F3E4E2;
  --white:      #FFFFFF;

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(27,36,48,0.04), 0 8px 24px rgba(27,36,48,0.06);
}

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

html, body{
  margin: 0;
  padding: 0;
  background: var(--paper-dim);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,h2,h3{ font-family: var(--font-serif); margin: 0; color: var(--ink); }

button, input, select, textarea{ font-family: inherit; font-size: inherit; color: inherit; }

:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ============================================================
   APP SHELL / HEADER
   ============================================================ */

.app-shell{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 48px;
}

.app-header{
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: center;
  padding: 4px 0 18px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-serif);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.brand-name{
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ============================================================
   PROGRESS TRACK
   ============================================================ */

.progress-track{
  width: 100%;
  max-width: 640px;
  position: relative;
  margin-bottom: 22px;
}

.progress-steps{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 2px;
}

.progress-step{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.step-dot{
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.step-label{
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.progress-step.is-active .step-dot{
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}
.progress-step.is-active .step-label{ color: var(--ink); }

.progress-step.is-done .step-dot{
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}
.progress-step.is-done .step-label{ color: var(--ink-soft); }

.progress-fill{ display: none; } /* fill bar not needed with dot styling; kept for possible future use */

/* ============================================================
   FORM PANEL
   ============================================================ */

.form-panel{
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 28px 24px 24px;
}

.form-step{ display: none; }
.form-step.is-active{ display: block; animation: step-in 0.22s ease; }

@keyframes step-in{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}

.step-title{
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-hint{
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.field-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field{ display: flex; flex-direction: column; }
.field-full{ grid-column: 1 / -1; }

.field label{
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field .optional{
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 12px;
}

.req{ color: var(--brass-dark); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--paper);
  font-size: 14.5px;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.field textarea{ resize: vertical; min-height: 72px; font-family: var(--font-sans); }

.field input.field-invalid,
.field select.field-invalid{
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field-error{
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
}
.field-error.is-visible{ display: block; }

/* DOB row */
.dob-row{
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}

/* Photo upload */
.photo-upload{
  display: flex;
  align-items: center;
  gap: 16px;
}

.photo-preview{
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--paper-dim);
  border: 1.5px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.photo-preview span{
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 0 6px;
}

.photo-preview img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-actions{
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* ============================================================
   REPEATABLE ITEM CARDS (education / qualifications / experience)
   ============================================================ */

.repeat-list{ display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }

.repeat-item{
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 14px 14px;
  background: var(--paper);
  position: relative;
}

.repeat-item-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.repeat-item-title{
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0.01em;
}

.btn-remove{
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-remove:hover{ background: var(--danger-soft); color: var(--danger); }

.repeat-item .field-grid{ gap: 12px; }

.repeat-item-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.empty-state{
  color: var(--ink-faint);
  font-size: 13px;
  padding: 14px 2px;
  font-style: italic;
}

/* language compact rows */
.repeat-list-compact .repeat-item{ padding: 10px 12px; }
.language-row{ display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; }

/* ============================================================
   EDUCATION TABLE (add row / column entry)
   ============================================================ */

.edu-table-wrap{
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.edu-table{
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
}

.edu-table th{
  background: var(--paper-dim);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.edu-table td{
  padding: 6px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.edu-table tr:last-child td{ border-bottom: none; }

.edu-table input{
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 8px;
  background: var(--paper);
  font-size: 13px;
  width: 100%;
  min-width: 100px;
}

.edu-table input:focus{
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  outline: none;
}

.edu-table-action-col{ width: 40px; }

.edu-table .btn-remove{ padding: 5px 7px; }

.edu-empty-row td{
  color: var(--ink-faint);
  font-style: italic;
  font-size: 13px;
  padding: 14px 8px;
}

/* ============================================================
   TAG INPUT (skills / hobbies)
   ============================================================ */

.tag-input{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 8px 10px;
}

.tag-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tag-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
}

.tag-chip button{
  border: none;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px;
  opacity: 0.7;
}
.tag-chip button:hover{ opacity: 1; }

.tag-input input{
  border: none;
  background: transparent;
  width: 100%;
  padding: 4px 2px;
  font-size: 14px;
  outline: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.06s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{ background: var(--ink); color: var(--paper); }
.btn-primary:hover{ background: #29344a; }

.btn-secondary{ background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover{ background: var(--paper-dim); }

.btn-ghost{ background: transparent; color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover{ background: var(--paper-dim); }

.btn-danger{ background: var(--danger); color: var(--white); }
.btn-danger:hover{ background: #83352e; }

.btn-small{ padding: 7px 12px; font-size: 12.5px; }

.btn-add{
  background: var(--white);
  color: var(--brass-dark);
  border: 1px dashed var(--brass);
  width: 100%;
  padding: 10px;
  font-size: 13px;
}
.btn-add:hover{ background: #FBF3EA; }
.btn-add-small{ width: auto; padding: 7px 14px; font-size: 12.5px; }

.step-actions{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

/* ============================================================
   PREVIEW SHELL + A4 PAGE
   ============================================================ */

.app-shell.is-hidden{
  display: none;
}

.preview-shell{
  min-height: 100vh;
  background: var(--paper-dim);
  padding: 18px 16px 60px;
  display: none;
}

.preview-shell.is-active{
  display: block;
}

.preview-toolbar{
  max-width: 900px;
  margin: 0 auto 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-toolbar-actions{ display: flex; gap: 10px; }

.print-tip{
  max-width: 900px;
  margin: 0 auto 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--teal-soft);
  border: 1px solid #C9DED8;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
}

.a4-stage{
  display: flex;
  justify-content: center;
}

/* A4 at 96dpi ≈ 794 x 1123 px, scaled down for smaller screens via wrapper */
.a4-page{
  width: 794px;
  min-height: 1123px;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--ink);
  box-shadow: var(--shadow-card);
  padding: 46px 50px;
  font-family: var(--font-sans);
  color: var(--ink);
}

/* ---- resume content typography (generated by JS) ---- */

.rz-title-banner{
  background: var(--paper-dim);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  text-align: center;
  padding: 10px 0;
  margin-bottom: 20px;
}

.rz-title-banner h1{
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
}

.rz-top-info{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.rz-name{
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.15;
}

.rz-info-block{ margin-bottom: 9px; }
.rz-info-block:last-child{ margin-bottom: 0; }

.rz-info-label{
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px;
}

.rz-info-value{
  font-size: 12.5px;
  color: var(--teal);
  font-weight: 500;
  margin: 0;
}

.rz-photo{
  width: 96px;
  height: 116px;
  object-fit: cover;
  border: 1px solid var(--ink);
  flex-shrink: 0;
}

.rz-section{ margin-bottom: 18px; }

.rz-section-banner{
  background: var(--paper-dim);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
  padding: 6px 0;
  margin-bottom: 10px;
}

.rz-section-banner h2{
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

/* Colorful variant used for Academic Qualification */
.rz-section-banner--edu{
  background: var(--teal);
  border-top-color: var(--teal-dark, var(--teal));
  border-bottom-color: var(--teal-dark, var(--teal));
}

.rz-section-banner--edu h2{
  color: var(--white);
}

.rz-table--edu th{
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.rz-plain-title{
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.rz-summary{ font-size: 12.5px; line-height: 1.6; color: var(--teal); text-align: center; padding: 0 6px; }

.rz-entry{ margin-bottom: 10px; }
.rz-entry:last-child{ margin-bottom: 0; }

.rz-entry-row{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.rz-entry-title{ font-weight: 700; }
.rz-entry-sub{ font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.rz-entry-date{ font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.rz-entry-desc{ font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.55; }

.rz-inline-list{
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.rz-chip-row{ display: flex; flex-wrap: wrap; gap: 6px; }
.rz-chip{
  font-size: 11.5px;
  background: var(--paper-dim);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 3px 9px;
  color: var(--ink-soft);
}

/* Academic qualification table (printed output) */
.rz-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.rz-table th{
  background: var(--paper-dim);
  border: 1px solid var(--ink);
  padding: 6px 8px;
  text-align: left;
  font-weight: 700;
}

.rz-table td{
  border: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--ink-soft);
}

/* Personal details label:value grid */
.rz-details-grid{
  display: grid;
  grid-template-columns: 150px 1fr;
  row-gap: 8px;
}

.rz-details-label{ font-size: 12.5px; font-weight: 700; color: var(--ink); }
.rz-details-value{ font-size: 12.5px; color: var(--teal); }

/* Declaration */
.rz-declaration-title{
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  margin: 0 0 8px;
}

.rz-declaration-text{
  font-size: 12px;
  color: var(--teal);
  line-height: 1.6;
}

/* Footer: date / place / signature */
.rz-footer{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 22px;
  font-size: 12.5px;
}

.rz-footer-signature{
  text-align: right;
}

.rz-footer-signature .rz-signature-name{
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13.5px;
  margin-top: 22px;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(27,36,48,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.is-open{
  display: flex;
}

/* Belt-and-braces: if a hosting/optimization plugin strips the "hidden"
   attribute from any element, force it hidden via CSS too. */
[hidden]{
  display: none !important;
}

.modal-box{
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(27,36,48,0.25);
}

.modal-box h3{ font-size: 17px; margin-bottom: 8px; }
.modal-box p{ font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.modal-actions{ display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   RESPONSIVE — MOBILE (360–430px covered by fluid layout)
   ============================================================ */

@media (max-width: 480px){
  .form-panel{ padding: 20px 16px 18px; }
  .step-title{ font-size: 19px; }
  .dob-row{ grid-template-columns: 1fr 1.3fr 1fr; gap: 6px; }
  .repeat-item-row{ grid-template-columns: 1fr; }
  .language-row{ grid-template-columns: 1fr 1fr auto; }
  .step-label{ font-size: 9.5px; }
  .step-dot{ width: 22px; height: 22px; font-size: 11px; }
  .a4-page{ padding: 28px 22px; }
  .rz-name{ font-size: 17px; }
  .rz-photo{ width: 72px; height: 88px; }
  .rz-details-grid{ grid-template-columns: 120px 1fr; }
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (min-width: 601px) and (max-width: 900px){
  .app-shell{ padding-top: 32px; }
  .form-panel, .app-header, .progress-track{ max-width: 680px; }
}

/* ============================================================
   RESPONSIVE — DESKTOP (comfortable centered container, not a dashboard)
   ============================================================ */

@media (min-width: 901px){
  .app-shell{ padding-top: 44px; }
  .form-panel{ max-width: 760px; padding: 36px 40px 30px; }
  .app-header, .progress-track{ max-width: 760px; }
  .field-grid{ gap: 18px; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print{
  @page{
    size: A4 portrait;
    margin: 0;
  }

  html, body{
    background: var(--white);
    margin: 0;
    padding: 0;
  }

  .app-shell,
  .app-header,
  .progress-track,
  .form-panel,
  .preview-toolbar,
  .no-print,
  .modal-overlay{
    display: none !important;
  }

  .preview-shell{
    display: block !important;
    padding: 0;
    background: var(--white);
    min-height: 0;
  }

  .a4-stage{
    display: block;
  }

  .a4-page{
    width: 210mm;
    min-height: 297mm;
    max-width: none;
    box-shadow: none;
    border: 1px solid var(--ink);
    margin: 0;
    padding: 16mm 18mm;
  }
}
