/* ===== Form & UI Components (no @apply – CDN Tailwind) ===== */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #1e293b;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dark .form-input {
  border-color: #475569;
  background-color: #0f172a;
  color: #f1f5f9;
}
.form-input::placeholder {
  color: #94a3b8;
}
.dark .form-input::placeholder {
  color: #64748b;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.template-btn {
  font-size: 11px;
  padding: 8px 10px;

  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  transition: all 0.15s;
  cursor: pointer;
}
.dark .template-btn {
  font-size: 11px;
  padding: 8px 10px;

  border-color: #475569;
  background-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}
.template-btn:hover {
  background-color: #f1f5f9;
}
.dark .template-btn:hover {
  background-color: #334155;
}
.template-btn.active-template {
  background-color: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3);
}
.dark .template-btn.active-template {
  background-color: rgba(30, 58, 138, 0.3);
  border-color: #3b82f6;
  color: #93c5fd;
}

.step-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  background-color: #e2e8f0;
  color: #64748b;
}
.dark .step-dot {
  background-color: #334155;
  color: #94a3b8;
}
.step-dot.active {
  background-color: #2563eb;
  color: #ffffff;
}
.step-dot.completed {
  background-color: #bfdbfe;
  color: #1d4ed8;
}
.dark .step-dot.completed {
  background-color: #1e3a8a;
  color: #93c5fd;
}

/* Item cards */
.item-card {
  position: relative;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background-color: rgba(248, 250, 252, 0.6);
}
.dark .item-card {
  border-color: #475569;
  background-color: rgba(15, 23, 42, 0.4);
}
.item-card .remove-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
}
.item-card .remove-btn:hover {
  color: #ef4444;
  background-color: #fef2f2;
}
.dark .item-card .remove-btn:hover {
  background-color: rgba(127, 29, 29, 0.2);
}

/* ===== Resume Paper (Screen Preview) ===== */
.resume-preview-wrapper {
  scrollbar-width: thin;
}

.resume-paper {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 10.5pt;
  line-height: 1.45;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

/* Compact spacing */
.resume-paper.compact {
  font-size: 9.5pt;
  line-height: 1.35;
}
.resume-paper.compact .section {
  margin-bottom: 0.7rem;
}
.resume-paper.compact .section-title {
  margin-bottom: 0.35rem;
}

/* ===== Template: Executive ===== */
.template-executive {
  padding: 18mm 16mm;
}
.template-executive .header {
  text-align: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #1e40af;
}
.template-executive .header-name {
  font-size: 22pt;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 0.15rem;
}
.template-executive .header-title {
  font-size: 11.5pt;
  font-weight: 500;
  color: #2563eb;
  margin-bottom: 0.4rem;
}
.template-executive .header-contact {
  font-size: 8.5pt;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
}
.template-executive .header-contact span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.template-executive .photo-wrap {
  display: none;
}
.template-executive.with-photo .header {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 1.2rem;
}
.template-executive.with-photo .photo-wrap {
  display: block;
  flex-shrink: 0;
}
.template-executive.with-photo .photo-wrap img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #dbeafe;
}
.template-executive.with-photo .header-text {
  flex: 1;
}
.template-executive.with-photo .header-contact {
  justify-content: flex-start;
}
.template-executive .section {
  margin-bottom: 0.95rem;
}
.template-executive .section-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1e40af;
  border-bottom: 1.5px solid #bfdbfe;
  padding-bottom: 0.2rem;
  margin-bottom: 0.5rem;
}
.template-executive .item {
  margin-bottom: 0.55rem;
}
.template-executive .item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.template-executive .item-title {
  font-weight: 600;
  font-size: 10.5pt;
  color: #0f172a;
}
.template-executive .item-subtitle {
  font-size: 9.5pt;
  color: #475569;
}
.template-executive .item-date {
  font-size: 8.5pt;
  color: #64748b;
  white-space: nowrap;
}
.template-executive .item-desc {
  font-size: 9.5pt;
  color: #334155;
  margin-top: 0.2rem;
}
.template-executive .item-desc ul {
  margin: 0.15rem 0 0 1.1rem;
  padding: 0;
}
.template-executive .item-desc li {
  margin-bottom: 0.12rem;
}
.template-executive .skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.template-executive .skill-tag {
  background: #eff6ff;
  color: #1e40af;
  font-size: 8.5pt;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

/* ===== Template: Modern Minimalist ===== */
.template-minimalist {
  padding: 16mm 15mm;
}
.template-minimalist .header {
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #e2e8f0;
}
.template-minimalist .header-name {
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin: 0;
}
.template-minimalist .header-title {
  font-size: 10.5pt;
  color: #64748b;
  font-weight: 400;
  margin: 0.15rem 0 0.4rem;
}
.template-minimalist .header-contact {
  font-size: 8pt;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}
.template-minimalist .photo-wrap {
  display: none;
}
.template-minimalist.with-photo .header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.template-minimalist.with-photo .photo-wrap {
  display: block;
}
.template-minimalist.with-photo .photo-wrap img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}
.template-minimalist .section {
  margin-bottom: 0.85rem;
}
.template-minimalist .section-title {
  font-size: 9pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.template-minimalist .item {
  margin-bottom: 0.5rem;
}
.template-minimalist .item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.template-minimalist .item-title {
  font-weight: 600;
  font-size: 10pt;
}
.template-minimalist .item-subtitle {
  font-size: 9pt;
  color: #64748b;
}
.template-minimalist .item-date {
  font-size: 8pt;
  color: #94a3b8;
}
.template-minimalist .item-desc {
  font-size: 9pt;
  color: #475569;
  margin-top: 0.15rem;
}
.template-minimalist .item-desc ul {
  margin: 0.1rem 0 0 1rem;
  padding: 0;
}
.template-minimalist .skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  font-size: 9pt;
  color: #334155;
}
.template-minimalist .skill-tag {
  background: none;
  padding: 0;
  color: inherit;
}
.template-minimalist .skill-tag::after {
  content: "•";
  margin-left: 0.6rem;
  color: #cbd5e1;
}
.template-minimalist .skill-tag:last-child::after {
  content: none;
}

/* ===== Template: Creative ===== */
.template-creative {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.template-creative .header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff !important;
  padding: 14mm 14mm 10mm;
  position: relative;
}
.template-creative .header-name {
  font-size: 22pt;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: #fff !important;
}
.template-creative .header-title {
  font-size: 11pt;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  color: #e0e7ff !important;
}
.template-creative .header-contact {
  font-size: 8pt;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  opacity: 0.85;
  color: #c7d2fe !important;
}
.template-creative .photo-wrap {
  display: none;
}
.template-creative.with-photo .header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.template-creative.with-photo .photo-wrap {
  display: block;
}
.template-creative.with-photo .photo-wrap img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.4);
}
.template-creative .body {
  padding: 10mm 14mm 14mm;
}
.template-creative .section {
  margin-bottom: 0.9rem;
}
.template-creative .section-title {
  font-size: 10pt;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.template-creative .section-title::before {
  content: "";
  width: 4px;
  height: 14px;
  background: #3b82f6;
  border-radius: 2px;
}
.template-creative .item {
  margin-bottom: 0.5rem;
}
.template-creative .item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.template-creative .item-title {
  font-weight: 600;
  font-size: 10.5pt;
}
.template-creative .item-subtitle {
  font-size: 9.5pt;
  color: #475569;
}
.template-creative .item-date {
  font-size: 8.5pt;
  color: #64748b;
}
.template-creative .item-desc {
  font-size: 9.5pt;
  color: #334155;
  margin-top: 0.15rem;
}
.template-creative .item-desc ul {
  margin: 0.1rem 0 0 1.1rem;
  padding: 0;
}
.template-creative .skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.template-creative .skill-tag {
  background: #eff6ff;
  color: #1e40af;
  font-size: 8.5pt;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
}

/* ===== Template: Two-Column Professional ===== */
.template-twocolumn {
  padding: 0;
  display: grid;
  grid-template-columns: 68mm 1fr;
  min-height: 297mm;
}
.template-twocolumn .sidebar {
  background: #0f172a;
  color: #e2e8f0 !important;
  padding: 14mm 10mm;
}
.template-twocolumn .sidebar .header-name {
  font-size: 16pt;
  font-weight: 700;
  color: #fff !important;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}
.template-twocolumn .sidebar .header-title {
  font-size: 9.5pt;
  color: #93c5fd !important;
  margin-bottom: 1rem;
}
.template-twocolumn .photo-wrap {
  display: none;
  margin-bottom: 1rem;
}
.template-twocolumn.with-photo .photo-wrap {
  display: block;
}
.template-twocolumn.with-photo .photo-wrap img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #3b82f6;
  display: block;
  margin: 0 auto 0.8rem;
}
.template-twocolumn .sidebar-section {
  margin-bottom: 1.1rem;
}
.template-twocolumn .sidebar-title {
  font-size: 8.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #60a5fa !important;
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #334155;
}
.template-twocolumn .sidebar-contact {
  font-size: 8pt;
  line-height: 1.6;
  color: #cbd5e1 !important;
}
.template-twocolumn .sidebar-contact div {
  margin-bottom: 0.25rem;
  word-break: break-all;
}
.template-twocolumn .sidebar .skill-tag {
  display: block;
  font-size: 8.5pt;
  color: #e2e8f0 !important;
  margin-bottom: 0.25rem;
  padding-left: 0.6rem;
  position: relative;
}
.template-twocolumn .sidebar .skill-tag::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #60a5fa;
}
.template-twocolumn .main {
  padding: 14mm 12mm 14mm 11mm;
  background: #fff;
}
.template-twocolumn .main .section {
  margin-bottom: 0.85rem;
}
.template-twocolumn .main .section-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1e40af;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 0.2rem;
  margin-bottom: 0.45rem;
}
.template-twocolumn .item {
  margin-bottom: 0.5rem;
}
.template-twocolumn .item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
}
.template-twocolumn .item-title {
  font-weight: 600;
  font-size: 10pt;
}
.template-twocolumn .item-subtitle {
  font-size: 9pt;
  color: #475569;
}
.template-twocolumn .item-date {
  font-size: 8pt;
  color: #64748b;
  white-space: nowrap;
}
.template-twocolumn .item-desc {
  font-size: 9pt;
  color: #334155;
  margin-top: 0.12rem;
}
.template-twocolumn .item-desc ul {
  margin: 0.1rem 0 0 1rem;
  padding: 0;
}

/* ===== Print Styles ===== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body * {
    visibility: hidden;
  }

  .resume-preview-wrapper,
  .resume-preview-wrapper *,
  #resumePaper,
  #resumePaper * {
    visibility: visible !important;
  }

  .resume-preview-wrapper {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  #resumePaper {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .section, .item, .item-header {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  .template-creative .header,
  .template-twocolumn .sidebar {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  header,
  main > div:first-child,
  .xl\\:col-span-5,
  #themeToggle,
  #printBtn,
  #mobilePrintBtn,
  #toast {
    display: none !important;
  }
}

/* —— Extra premium templates —— */
.template-classic { font-family: Georgia, 'Times New Roman', serif; color: #111; }
.template-classic .header { border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 12px; }
.template-classic .header-name { font-size: 22pt; letter-spacing: 0.02em; }
.template-classic .header-title { font-style: italic; color: #444; }
.template-classic .section-title { font-size: 11pt; text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 1px solid #ccc; margin-bottom: 6px; }

.template-modern { }
.template-modern .header { background: #0f172a; color: #fff; padding: 18px 16px; margin: -16px -16px 14px; }
.template-modern .header-name { color: #fff; font-size: 20pt; font-weight: 800; }
.template-modern .header-title { color: #94a3b8; }
.template-modern .header-contact { color: #cbd5e1; }
.template-modern .section-title { color: #0f172a; border-left: 3px solid #f97316; padding-left: 8px; text-transform: uppercase; font-size: 10pt; letter-spacing: 0.08em; }

.template-elegant { font-family: Georgia, serif; }
.template-elegant .header { text-align: center; border-bottom: 1px solid #d4af37; padding-bottom: 12px; margin-bottom: 14px; }
.template-elegant .header-name { font-size: 24pt; font-weight: 400; letter-spacing: 0.08em; color: #1c1917; }
.template-elegant .header-title { color: #a16207; font-style: italic; }
.template-elegant .section-title { text-align: center; color: #a16207; font-size: 10pt; letter-spacing: 0.15em; text-transform: uppercase; margin: 12px 0 6px; }

.template-sidebar .tc-sidebar { background: #0f172a; color: #e2e8f0; padding: 14px; min-height: 100%; }
.template-sidebar .tc-main { padding: 8px 12px; }
.template-sidebar .header-name { color: #fff; }

/* —— 16-template system: ATS + role packs + one-page print —— */
.resume-paper.one-page {
  max-height: 297mm;
  overflow: hidden;
}
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden; }
  #resumePaper, #resumePaper * { visibility: visible; }
  #resumePaper {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none !important; border: none !important;
    max-height: none; overflow: visible;
  }
  .no-print, header, #rbLoginLock, #rbAuthBar, .template-btn {
  font-size: 11px;
  padding: 8px 10px;
 display: none !important; }
}

.template-ats { font-family: Arial, Helvetica, sans-serif; color: #111; font-size: 10.5pt; }
.template-ats .header-name { font-size: 18pt; font-weight: 700; color: #000; }
.template-ats .header-title { color: #333; font-size: 11pt; }
.template-ats .section-title {
  font-size: 11pt; font-weight: 700; text-transform: uppercase;
  border-bottom: 1px solid #333; margin: 10px 0 6px; letter-spacing: 0.04em;
}
.template-ats .skill-tag { border: 1px solid #ccc; background: #fff; color: #111; }

.template-fresher .header-name { color: #1d4ed8; }
.template-fresher .section-title { color: #1d4ed8; border-bottom-color: #93c5fd; }

.template-technical .tc-sidebar { background: #0f766e; }
.template-manager .header { border-bottom: 3px solid #1e3a8a; }
.template-manager .section-title { color: #1e3a8a; }

.template-academic { font-family: Georgia, serif; }
.template-academic .section-title { text-align: left; border-bottom: 1px solid #78716c; }

.template-navy .header { background: #1e3a8a; color: #fff; padding: 16px; margin: -16px -16px 12px; }
.template-navy .header-name, .template-navy .header-title { color: #fff; }
.template-navy .header-contact { color: #bfdbfe; }
.template-navy .section-title { color: #1e3a8a; }

.template-compact { font-size: 9.5pt; }
.template-compact .section { margin-bottom: 6px; }
.template-compact .header-name { font-size: 16pt; }

.template-timeline .tl-track { border-left: 2px solid #cbd5e1; margin-left: 8px; padding-left: 14px; }
.template-timeline .tl-item { position: relative; margin-bottom: 10px; }
.template-timeline .tl-dot {
  position: absolute; left: -19px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #f97316; border: 2px solid #fff; box-shadow: 0 0 0 1px #f97316;
}


/* —— Stronger visual differences when content is sparse —— */
.template-executive .header { border-left: 4px solid #1e3a8a; padding-left: 12px; }
.template-minimalist .header { text-align: center; }
.template-minimalist .header-contact { justify-content: center; }
.template-classic .header-name { font-variant: small-caps; }
.template-fresher .header { background: #eff6ff; padding: 12px; border-radius: 8px; margin-bottom: 10px; }
.template-manager .header-name { color: #1e3a8a; }
.template-academic .header { text-align: center; border-bottom: 1px solid #a8a29e; padding-bottom: 10px; }
.template-elegant .header { text-align: center; border: 1px solid #d4af37; padding: 14px; border-radius: 4px; }
.template-elegant .header-name { color: #92400e; }
.template-elegant .section-title { color: #b45309; text-align: center; border: none; letter-spacing: 0.14em; }
.template-navy .section-title { border-bottom: 2px solid #1e3a8a; }
.template-creative .header-name { color: #7c3aed; }
.template-creative .section-title { color: #7c3aed; border-bottom-color: #e9d5ff; }
