/* HSLG Job Seeker — Resume Builder UI (S01)
 * Styles for /jobs/resume-builder/ (entry) and /jobs/resume-builder/result/.
 * Mobile-first. Targets 360px viewports first, scales up.
 * css_version: 90
 */

/* ── Layout ───────────────────────────────────────────────────────────── */
.rb-builder-wrap { max-width: 1080px; margin: 0 auto; padding-top: 1.5rem; padding-bottom: 3rem; }

.rb-hero { margin-bottom: 1.5rem; }
.rb-hero h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.rb-hero__sub {
  color: var(--body-light);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}
.rb-hero__chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 0.5rem;
}
.rb-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-alt);
  color: var(--body);
  border: 1px solid var(--border-col);
}
.rb-chip--free {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
  font-weight: 600;
}
.rb-hero__sponsor {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--body-light);
}
.rb-hero__sponsor a { color: var(--teal); text-decoration: none; font-weight: 600; }

.rb-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .rb-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; }
}

/* ── Builder card ─────────────────────────────────────────────────────── */
.rb-builder {
  background: #fff;
  border: 1px solid var(--border-col);
  border-radius: 14px;
  padding: 1.5rem;
  min-width: 0;
}

.rb-progress {
  position: relative;
  height: 6px;
  background: #f1f1f1;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}
.rb-progress__bar {
  position: absolute;
  inset: 0;
  width: 20%;
  background: linear-gradient(to right, var(--teal), #4FB7C2);
  border-radius: 99px;
  transition: width 0.25s ease;
}
.rb-progress__steps {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-9px);
}
.rb-progress__step {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d8d8d8;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  display: flex; align-items: center; justify-content: center;
}
.rb-progress__step.is-done {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
.rb-progress__step.is-active {
  border-color: var(--teal); color: var(--teal);
}

/* Steps */
.rb-step {
  display: none;
  border: 0;
  padding: 0;
  margin: 0;
}
.rb-step.is-active { display: block; }
.rb-step__legend {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--headline);
  margin-bottom: 0.4rem;
}
.rb-step__hint {
  color: var(--body-light);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

/* Chips */
.rb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.rb-chip-btn {
  background: #fff;
  border: 1px solid var(--border-col);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 0.92rem;
  color: var(--body);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.rb-chip-btn:hover { border-color: var(--teal); }
.rb-chip-btn.is-selected {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.rb-chips--multi .rb-chip-btn.is-selected { background: var(--teal); color: #fff; }

/* Free-text fields */
.rb-other {
  display: block;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--body-light);
}
.rb-other span { display: block; margin-bottom: 4px; }
.rb-other input,
.rb-field input,
.rb-field textarea,
#rb-narrative {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--border-col);
  border-radius: 8px;
  background: #fff;
  color: var(--body);
}
.rb-other input:focus,
.rb-field input:focus,
.rb-field textarea:focus,
#rb-narrative:focus {
  outline: 2px solid var(--teal);
  outline-offset: 0;
  border-color: var(--teal);
}

#rb-narrative { line-height: 1.6; }
.rb-charcount {
  font-size: 0.78rem;
  color: var(--body-light);
  text-align: right;
  margin-top: 4px;
}

.rb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 600px) {
  .rb-grid { grid-template-columns: 1fr 1fr; }
}
.rb-field { display: block; }
.rb-field span {
  display: block;
  font-size: 0.88rem;
  color: var(--body-light);
  margin-bottom: 4px;
}
.rb-field span em { color: #b91c1c; font-style: normal; font-weight: 600; }
.rb-field span small { color: var(--body-light); font-size: 0.78rem; font-weight: 400; }

.rb-privacy {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--body-light);
  background: var(--bg-alt);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--teal);
}

.rb-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 1.25rem;
}
.rb-actions .btn { flex: 1 1 auto; min-width: 140px; }
@media (max-width: 480px) {
  .rb-actions .btn { width: 100%; }
}

/* Status / error */
.rb-status, .rb-error {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 1rem;
  border-radius: 8px;
}
.rb-status {
  background: var(--bg-alt);
  color: var(--body);
}
.rb-status p { margin: 0.5rem 0 0; font-size: 0.95rem; }
.rb-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.rb-error a { color: #991B1B; text-decoration: underline; }

.rb-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e5e5e5;
  border-top-color: var(--teal);
  border-radius: 50%;
  margin: 0 auto;
  animation: rb-spin 0.8s linear infinite;
}
@keyframes rb-spin { to { transform: rotate(360deg); } }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.rb-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.rb-sidebar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-col);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}
.rb-sidebar-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--headline);
}
.rb-sidebar-card p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
}
.rb-sidebar-card--quote {
  background: #FFFBF5;
  border-color: #F1E0C4;
}
.rb-sidebar-card--quote p {
  font-style: italic;
  color: var(--body);
  margin-bottom: 0.5rem;
}
.rb-sidebar-card--quote small {
  font-size: 0.82rem;
  color: var(--body-light);
}
.rb-sidebar-links { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.rb-sidebar-links li { margin: 0 0 6px; }
.rb-sidebar-links a {
  color: var(--teal);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.rb-sidebar-links a:hover { text-decoration: underline; }

/* ── Result page ──────────────────────────────────────────────────────── */
.rb-result-wrap { max-width: 920px; margin: 0 auto; padding-top: 1.5rem; padding-bottom: 3rem; }

.rb-result__h1 { font-size: 1.7rem; margin-bottom: 0.25rem; }
.rb-result__sub { color: var(--body-light); margin-bottom: 1.25rem; }
.rb-result__downloads {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.rb-result__downloads .btn { flex: 1 1 220px; min-height: 48px; }
.rb-result__sponsor {
  font-size: 0.82rem;
  color: var(--body-light);
  margin: 0 0 1rem;
}
.rb-result__sponsor a { color: var(--teal); text-decoration: none; }

.rb-resume-preview {
  background: #f5f5f5;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.rb-resume-page {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Action stack */
.rb-actions-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 700px) {
  .rb-actions-stack { grid-template-columns: 1fr 1fr; }
}
.rb-action-card {
  border: 1px solid var(--border-col);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  background: #fff;
}
.rb-action-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--headline);
}
.rb-action-card p {
  font-size: 0.9rem;
  color: var(--body);
  line-height: 1.5;
  margin: 0 0 0.85rem;
}
.rb-action-card--accent { background: #F0FBFB; border-color: #B0E2E8; }
.rb-action-card--danger { background: #FFFBFB; border-color: #FCD8D8; }

.rb-save-form { display: flex; gap: 8px; flex-wrap: wrap; }
.rb-save-form input {
  flex: 1 1 200px;
  padding: 10px 12px;
  border: 1px solid var(--border-col);
  border-radius: 8px;
  font-size: 0.95rem;
}
.rb-save-form button { flex-shrink: 0; }
.rb-save-status, .rb-delete-status {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
}
.rb-save-status.is-ok, .rb-delete-status.is-ok { color: #065F46; }
.rb-save-status.is-error, .rb-delete-status.is-error { color: #991B1B; }

.is-disabled { pointer-events: none; opacity: 0.55; cursor: not-allowed; }
.rb-noprint { /* JS toggles display:none in print mode if needed */ }

/* ── Dark theme overrides ─────────────────────────────────────────────── */
[data-theme="dark"] .rb-builder {
  background: var(--bg-alt);
}
[data-theme="dark"] .rb-progress {
  background: var(--border-col);
}
[data-theme="dark"] .rb-progress__step {
  background: var(--bg-alt);
  border-color: var(--border-col);
  color: var(--body-light);
}
[data-theme="dark"] .rb-chip-btn {
  background: var(--bg-alt);
  color: var(--body);
  border-color: var(--border-col);
}
[data-theme="dark"] .rb-other input,
[data-theme="dark"] .rb-field input,
[data-theme="dark"] .rb-field textarea,
[data-theme="dark"] #rb-narrative {
  background: var(--bg);
  color: var(--body);
  border-color: var(--border-col);
}
[data-theme="dark"] .rb-chip--free {
  background: rgba(6, 95, 70, 0.25);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34D399;
}
[data-theme="dark"] .rb-sidebar-card--quote {
  background: rgba(241, 224, 196, 0.04);
  border-color: var(--border-col);
}
[data-theme="dark"] .rb-resume-preview {
  background: var(--border-col);
}
[data-theme="dark"] .rb-resume-page {
  background: var(--bg-alt);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .rb-action-card {
  background: var(--bg-alt);
}
[data-theme="dark"] .rb-action-card--accent {
  background: rgba(43, 123, 136, 0.1);
  border-color: rgba(43, 123, 136, 0.3);
}
[data-theme="dark"] .rb-action-card--danger {
  background: rgba(153, 27, 27, 0.1);
  border-color: rgba(252, 216, 216, 0.15);
}
[data-theme="dark"] .rb-error {
  background: rgba(153, 27, 27, 0.2);
  border-color: rgba(252, 202, 202, 0.25);
  color: #FCA5A5;
}
[data-theme="dark"] .rb-error a {
  color: #FCA5A5;
}
[data-theme="dark"] .rb-spinner {
  border-color: var(--border-col);
  border-top-color: var(--teal);
}
[data-theme="dark"] .rb-save-form input {
  background: var(--bg);
  color: var(--body);
  border-color: var(--border-col);
}
