:root {
  --bg: #0b1220;
  --card: #111a2b;
  --text: #e6edf7;
  --muted: #9fb0c9;
  --line: #24324a;
  --accent: #3b82f6;
  --accent-2: #38bdf8;
  --card-2: #0d1524;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1e3460 0%, transparent 65%),
    radial-gradient(900px 500px at 100% 0%, #12344d 0%, transparent 65%),
    linear-gradient(145deg, #0b1220 0%, #070d17 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
.container {
  width: min(1100px, 100% - 32px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero { margin-bottom: 16px; }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}
.sub { color: var(--muted); margin: 0 0 12px; font-size: 1.05rem; }
.progress { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: #2b3a55; transition: all .2s ease; }
.dot.active { background: var(--accent-2); }
.slide { display: none; animation: fade .24s ease; }
.slide.active { display: block; }
@keyframes fade { from { opacity: .2; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card {
  background: linear-gradient(180deg, #111a2b 0%, #0d1626 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}
.card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -0.02em;
}
.mode-cards, .tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.mode-card, .tier-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: left;
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mode-card:hover, .tier-card:hover { transform: translateY(-1px); border-color: #3a597c; }
.mode-card.active, .tier-card.active {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-2), 0 0 0 4px rgba(47, 184, 217, 0.14);
}
.mode-card small { display: block; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-size: 14px; margin: 10px 0; }
input, textarea, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}
input, textarea, select {
  background: #0c1525;
  color: var(--text);
}
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7fc4ff 50%),
    linear-gradient(135deg, #7fc4ff 50%, transparent 50%),
    linear-gradient(to right, #1b2a43, #1b2a43);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 40px) 0.4em;
  background-size: 6px 6px, 6px 6px, 1px 2.1em;
  background-repeat: no-repeat;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: #2fb8d9;
  box-shadow: 0 0 0 3px rgba(47, 184, 217, 0.16);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #7f92af; }
button { border: none; cursor: pointer; }
.btn {
  border-radius: 12px;
  min-height: 50px;
  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  color: #eaf3ff;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(14, 165, 233, 0.3); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-ghost {
  color: #d6e4f7;
  background: #101c31;
  border: 1px solid #2f4566;
}
.btn-ghost:hover { background: #13233d; border-color: #3d5b86; }
.nav button {
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  min-height: 58px;
}
.nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.panel { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; background: #0e1728; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.free-flow { margin-top: 12px; }
.local-load {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #2f4566;
  border-radius: 10px;
  background: #0f1930;
}
.local-load-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.local-load-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #1b2a43;
  border: 1px solid #304a70;
}
.local-load-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  transition: width 0.18s ease;
}
.local-load-bar.indeterminate .local-load-fill {
  width: 35% !important;
  animation: localLoadSweep 1.2s ease-in-out infinite;
}
@keyframes localLoadSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.howto {
  display: grid;
  gap: 8px;
  margin: 0 0 14px 0;
}
.howto-item {
  background: #0f1930;
  border: 1px solid #2c3f61;
  border-radius: 10px;
  padding: 9px 11px;
  color: #c8d9ee;
  font-size: 0.96rem;
}
.howto-item span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  margin-right: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00142c;
  background: #7dd3fc;
}
.error {
  display: none;
  white-space: pre-wrap;
  background: #2b1218;
  color: #ffbdc6;
  border: 1px solid #6b2a36;
  border-radius: 8px;
  padding: 10px;
}
.error.show {
  display: block;
}
.preview #resumeView { background: #0c1525; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.preview #resumeView h3 { border-bottom: 1px solid #31425f; padding-bottom: 4px; margin-bottom: 4px; }
.resume-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.resume-head-text { flex: 1; min-width: 0; }
.resume-photo {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #31425f;
  background: #0b1323;
  flex: 0 0 auto;
}
.resume-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#resumeView.editing .editable {
  outline: 1px dashed #7fc4ff;
  outline-offset: 2px;
  border-radius: 4px;
  background: rgba(127, 196, 255, 0.08);
}
#resumeView.editing .editable:focus {
  outline: 2px solid #2fb8d9;
}
.nav { display: flex; gap: 10px; margin-top: 14px; }
.hidden { display: none !important; }
a { color: #7fc4ff; }
#toastRoot.toast-root {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 9999;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
}
.toast {
  border: 1px solid var(--line);
  background: #101b2f;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  animation: toastIn .18s ease;
}
.toast.info { border-color: #2f4e74; }
.toast.success { border-color: #2a7b64; }
.toast.error { border-color: #8a3344; background: #2a1218; color: #ffd3da; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) translateX(4px); }
  to { opacity: 1; transform: translateY(0) translateX(0); }
}
#tier1Fields .grid-2 label {
  margin-top: 2px;
}
.upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px dashed #2f4566;
  border-radius: 12px;
  background: #0f1930;
}
.upload-name {
  color: #a9bdd8;
  font-size: 0.95rem;
}
.sr-only-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 700px) {
  .container { width: calc(100% - 20px); padding: 18px 0; justify-content: flex-start; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .nav { flex-direction: column; }
  #toastRoot.toast-root { right: 10px; top: 10px; width: calc(100vw - 20px); }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; }
  .hero, .nav, .slide:not([data-step="3"]), #toastRoot, #exportPdf { display: none !important; }
  .container {
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }
  #preview {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: #fff !important;
  }
  #preview > h2 { display: none !important; } /* hide "Resume Preview" */
  #resumeView {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 12pt !important;
    line-height: 1.35 !important;
  }
  #resumeView h2 { margin: 0 0 4mm 0 !important; }
  #resumeView h3 {
    margin-top: 6mm !important;
    border-bottom: 1px solid #222 !important;
    padding-bottom: 1.5mm !important;
    break-after: avoid;
  }
  #resumeView p, #resumeView ul { break-inside: avoid; }
}
