:root {
  --bg: #09101c;
  --bg-soft: #111a2c;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.11);
  --text: #eef4ff;
  --muted: #9eabc7;
  --primary: #6ea8fe;
  --primary-strong: #3d82ff;
  --accent: #9dd5ff;
  --success: #8fe7b7;
  --warning: #ffd66b;
  --danger: #ff8b8b;
  --paper: #ffffff;
  --paper-text: #151b27;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  --radius: 18px;
  --radius-lg: 24px;
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(71, 120, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 200, 255, 0.10), transparent 25%),
    linear-gradient(180deg, #08101b 0%, #0d1322 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 76px 0;
}

.section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 32px;
}

.section-head h2 {
  margin: 10px 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 700;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(8, 13, 24, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #5a8cff, #4fd1ff);
  box-shadow: 0 10px 24px rgba(79, 151, 255, 0.30);
}

.brand-name {
  font-weight: 800;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
}

.nav a:hover {
  color: white;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.mini-btn:hover,
.template-btn:hover,
.remove-btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 28px rgba(61, 130, 255, 0.28);
}

.btn-secondary {
  color: white;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.btn-dark {
  color: white;
  background: #111827;
  border: 1px solid #26314f;
}

.full {
  width: 100%;
}

.mt12 {
  margin-top: 12px;
}

.mt16 {
  margin-top: 16px;
}

.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

.hero {
  padding: 86px 0 52px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 30px;
  align-items: center;
}

.hero-copy h1 {
  margin: 14px 0;
  line-height: 1.02;
  font-size: clamp(2.5rem, 5vw, 4.9rem);
}

.hero-copy p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 18px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points span {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.hero-card {
  display: flex;
  justify-content: center;
}

.hero-score-card {
  width: min(100%, 430px);
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-score-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.hero-score-top strong {
  font-size: 2rem;
}

.mini-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-score-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.hero-score-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
}

.hero-score-item span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.feature-grid,
.tips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card,
.tip-card,
.form-card,
.matcher-card,
.match-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.feature-card h3,
.tip-card h3,
.form-card h3,
.matcher-card h3,
.match-box h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.feature-card p,
.tip-card p {
  margin: 0;
  color: var(--muted);
}

.builder-layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  align-items: start;
}

.builder-panel {
  display: grid;
  gap: 16px;
}

.preview-panel {
  min-width: 0;
}

.sticky-top {
  position: sticky;
  top: 92px;
  z-index: 5;
}

.panel-actions {
  display: grid;
  gap: 10px;
}

.form-grid,
.two-col {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: 1fr 1fr;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #dde5f6;
}

input,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8, 12, 24, 0.72);
  color: white;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8d98b5;
}

input:focus,
textarea:focus {
  border-color: rgba(110,168,254,0.82);
  box-shadow: 0 0 0 4px rgba(110,168,254,0.15);
}

.template-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.template-btn,
.mini-btn,
.remove-btn {
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.template-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: white;
}

.template-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
}

.mini-btn {
  color: white;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}

.remove-btn {
  color: #ffc0c0;
  background: rgba(255, 86, 86, 0.15);
  border: none;
}

.card-title-row,
.repeat-head,
.repeat-actions,
.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeat-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.helper-text {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.score-card {
  display: grid;
  gap: 14px;
}

.score-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.score-number {
  font-size: 2.5rem;
  font-weight: 800;
}

.score-label {
  color: var(--muted);
  font-weight: 600;
}

.score-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5a8cff, #4fd1ff);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.score-82 {
  width: 82%;
}

.score-breakdown {
  display: grid;
  gap: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #dbe4f7;
}

.resume-paper {
  background: var(--paper);
  color: var(--paper-text);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  padding: 42px;
  min-height: 1100px;
}

.resume-paper.modern .resume-header {
  padding-bottom: 18px;
  border-bottom: 3px solid #dbe7ff;
}

.resume-paper.classic .resume-header {
  padding-bottom: 18px;
  border-bottom: 1px solid #999;
}

.resume-paper.minimal .resume-header {
  padding-bottom: 8px;
  border-bottom: none;
}

.resume-header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.resume-header h2 {
  margin: 6px 0 14px;
  font-size: 1.08rem;
  font-weight: 600;
  color: #345;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #526275;
  font-size: 0.95rem;
}

.resume-section {
  margin-top: 26px;
}

.resume-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1f3d73;
}

.resume-paper.classic .resume-section h3 {
  color: #111;
  border-bottom: 1px solid #bbb;
  padding-bottom: 6px;
}

.resume-paper.minimal .resume-section h3 {
  color: #000;
  letter-spacing: 0.03em;
}

.skills-wrap,
.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag,
.match-tag,
.missing-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-tag {
  background: #eef4ff;
  color: #20478a;
}

.match-tag {
  background: rgba(143, 231, 183, 0.18);
  border: 1px solid rgba(143, 231, 183, 0.35);
  color: #b9ffd1;
}

.missing-tag {
  background: rgba(255, 214, 107, 0.12);
  border: 1px solid rgba(255, 214, 107, 0.30);
  color: #ffe697;
}

.resume-paper.classic .skill-tag,
.resume-paper.minimal .skill-tag {
  background: #f2f2f2;
  color: #222;
}

.entry {
  margin-bottom: 18px;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.entry-title {
  font-weight: 800;
  font-size: 1rem;
}

.entry-sub {
  font-weight: 600;
  color: #506078;
}

.entry-date {
  color: #5b6b80;
  font-size: 0.95rem;
}

.entry-desc {
  margin: 0;
  color: #293241;
  line-height: 1.6;
  white-space: pre-line;
}

.bullet-list {
  padding-left: 18px;
  margin: 0;
  line-height: 1.7;
}

.matcher-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.matcher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.match-badge {
  min-width: 88px;
  height: 88px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.empty-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 10, 18, 0.76);
  padding: 26px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-inner p {
  margin: 4px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .builder-layout,
  .matcher-layout,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .sticky-top {
    position: static;
  }

  .feature-grid,
  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }

  .form-grid,
  .two-col,
  .feature-grid,
  .tips-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .header-inner,
  .footer-inner,
  .match-top,
  .card-title-row,
  .repeat-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-paper {
    padding: 24px;
  }

  .resume-header h1 {
    font-size: 1.8rem;
  }

  .hero {
    padding-top: 44px;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .hero,
  .features,
  .tips,
  .matcher,
  .coverletter,
  .site-footer,
  .builder-panel,
  .section-head {
    display: none !important;
  }

  .builder-layout {
    display: block;
  }

  .resume-paper {
    box-shadow: none;
    border-radius: 0;
    min-height: auto;
    padding: 16px;
  }
}

/* ── Utility ─────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── AI Button Styles ────────────────────────────────────── */

.btn-ai {
  color: white;
  background: linear-gradient(135deg, #a855f7, #6366f1, #3b82f6);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.30);
  border: none;
}

.btn-ai:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-ai:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ai-mini {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.btn-ai-key {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(139, 92, 246, 0.40);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn-ai-key:hover {
  background: rgba(139, 92, 246, 0.22);
  transform: translateY(-1px);
}

.key-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.key-dot.on {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
}

.key-dot.off {
  background: #f87171;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── AI Hint Toast ───────────────────────────────────────── */

.ai-hint-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(139, 92, 246, 0.92);
  backdrop-filter: blur(12px);
  color: white;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 100;
  white-space: nowrap;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

.ai-hint-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── AI Modal ────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: #111827;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 24px;
  padding: 32px;
  width: min(100%, 500px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.ai-spark-icon {
  font-size: 1.4rem;
}

.modal-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: rgba(255,255,255,0.15);
}

.modal-desc {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.modal-steps {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.modal-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.modal-step a {
  color: #a5b4fc;
  text-decoration: underline;
}

.modal-label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.ai-key-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.ai-key-status.success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.30);
  color: #86efac;
}

/* ── AI Loading Spinner ──────────────────────────────────── */

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

.ai-spin {
  display: inline-block;
  animation: ai-spin 0.8s linear infinite;
}

/* ── Feature Icon ────────────────────────────────────────── */

.feature-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* ── Score 92 hero ───────────────────────────────────────── */

.score-92 {
  width: 92%;
}

/* ── Select Style ────────────────────────────────────────── */

select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 24, 0.72);
  color: white;
  padding: 12px 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239eabc7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select:focus {
  border-color: rgba(110, 168, 254, 0.82);
  box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.15);
}

/* ── Optional Badge ──────────────────────────────────────── */

.optional-badge {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Cover Letter Section ────────────────────────────────── */

.coverletter-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.coverletter-settings {
  display: grid;
  gap: 16px;
}

.coverletter-settings h3 {
  margin: 0 0 4px;
}

.cl-requirements {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.cl-requirements h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cl-req-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.req-item {
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.req-item::before {
  content: '○';
  font-size: 0.85rem;
}

.req-item.req-done::before {
  content: '✓';
  color: #4ade80;
}

.req-item.req-done {
  color: #86efac;
}

.req-item.req-empty {
  color: var(--muted);
}

.coverletter-output {
  display: grid;
  gap: 16px;
}

.cl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cl-head h3 {
  margin: 0;
}

.cl-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cl-result {
  min-height: 320px;
}

.cl-placeholder {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  padding: 24px;
  border: 2px dashed rgba(255,255,255,0.10);
  border-radius: 14px;
  text-align: center;
}

.cl-textarea {
  width: 100%;
  min-height: 400px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8, 12, 24, 0.72);
  color: white;
  padding: 18px;
  outline: none;
  resize: vertical;
  line-height: 1.8;
  font-size: 0.95rem;
  font-family: Georgia, 'Times New Roman', serif;
}

.cl-textarea:focus {
  border-color: rgba(139, 92, 246, 0.60);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

@media (max-width: 1180px) {
  .coverletter-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile tweaks for new elements ─────────────────────── */

@media (max-width: 760px) {
  .header-right {
    flex-direction: row;
  }

  .btn-ai-key {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}
