/* ============================================
   Resume Builder Wizard — Styles
   ============================================ */

/* --- Progress Bar --- */
.rb-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.rb-step {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.rb-step.completed,
.rb-step.active { opacity: 1; }

.rb-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.rb-step.active .rb-step-circle {
  background: var(--color-brand);
  color: #fff;
}

.rb-step.completed .rb-step-circle {
  background: var(--color-success);
  color: #fff;
}

.rb-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.rb-step.active .rb-step-label { color: var(--color-brand); font-weight: 600; }
.rb-step.completed .rb-step-label { color: var(--color-success); }

.rb-step-line {
  width: 32px;
  height: 2px;
  background: var(--color-border);
  margin: 0 4px;
  flex-shrink: 0;
}

.rb-step-line.completed { background: var(--color-success); }

/* --- Section Panel --- */
.rb-panel {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px var(--color-shadow);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto 24px;
}

.rb-panel h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.rb-panel .rb-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* --- Form Elements --- */
.rb-form-group {
  margin-bottom: 16px;
}

.rb-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.rb-form-group label .optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.rb-form-group input,
.rb-form-group textarea,
.rb-form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-family);
  transition: border var(--transition);
}

.rb-form-group input:focus,
.rb-form-group textarea:focus,
.rb-form-group select:focus {
  border-color: var(--color-brand);
  outline: none;
}

.rb-form-group textarea { min-height: 100px; resize: vertical; }

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

/* --- Buttons --- */
.rb-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.rb-btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-family);
}

.rb-btn-primary {
  background: var(--color-brand);
  color: #fff;
}

.rb-btn-primary:hover { background: var(--color-brand-hover); }
.rb-btn-primary:disabled { background: #93b5f1; cursor: not-allowed; }

.rb-btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.rb-btn-secondary:hover { background: var(--color-border); }

.rb-btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.rb-btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.rb-btn-danger:hover { opacity: 0.9; }

.rb-btn-link {
  background: none;
  border: none;
  color: var(--color-brand);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  font-family: var(--font-family);
}

.rb-btn-link:hover { text-decoration: underline; }

/* --- Saved Role Cards --- */
.rb-role-cards {
  margin-bottom: 20px;
}

.rb-role-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rb-role-card-info h4 {
  font-size: 14px;
  margin-bottom: 2px;
}

.rb-role-card-info .meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.rb-role-card-actions {
  display: flex;
  gap: 8px;
}

/* --- Bullet Editor --- */
.rb-bullets {
  margin: 16px 0;
}

.rb-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.rb-bullet-item .bullet-dot {
  margin-top: 10px;
  font-weight: bold;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.rb-bullet-item textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  min-height: 38px;
  word-wrap: break-word;
}

.rb-bullet-item textarea:focus {
  border-color: var(--color-brand);
  outline: none;
}

.rb-bullet-item .rb-btn-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}

/* --- Loading Spinner --- */
.rb-loading {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
}

.rb-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: rb-spin 0.8s linear infinite;
  margin-bottom: 8px;
}

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

/* --- AI Questions --- */
.rb-questions {
  background: #ECFDF5;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
}

.rb-questions h4 {
  font-size: 14px;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.rb-questions ol {
  margin: 0 0 12px 20px;
  font-size: 13px;
  color: var(--color-text);
}

.rb-questions li { margin-bottom: 6px; }

/* --- Competencies Editor --- */
.rb-competencies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.rb-competency-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
}

.rb-competency-tag .rb-btn-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* --- Repeatable Groups (certifications, languages, awards) --- */
.rb-repeatable-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.rb-repeatable-item input {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-family);
}

/* --- Payment Card --- */
.rb-payment-card {
  text-align: center;
  padding: 48px 24px;
  max-width: 480px;
  margin: 60px auto;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 12px var(--color-shadow);
}

.rb-payment-card h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.rb-payment-card p {
  color: var(--color-text-muted);
  margin-bottom: 20px;
  font-size: 15px;
}

.rb-payment-card .rb-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 24px;
}

/* --- Review Preview --- */
.rb-preview {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto 24px;
  font-family: 'Calibri', 'Segoe UI', sans-serif;
}

.rb-preview h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 4px;
}

.rb-preview .contact-line {
  text-align: center;
  color: #555;
  font-size: 13px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-brand);
}

.rb-preview h2 {
  font-size: 14px;
  text-transform: uppercase;
  border-bottom: 1px solid #999;
  padding-bottom: 4px;
  margin: 20px 0 8px;
  letter-spacing: 0.5px;
}

.rb-preview .role-title { font-weight: 700; font-size: 14px; margin-bottom: 0; }
.rb-preview .role-meta { color: #666; font-style: italic; font-size: 13px; margin-bottom: 6px; }
.rb-preview .bullet-list { margin: 0 0 12px 18px; font-size: 13px; }
.rb-preview .bullet-list li { margin-bottom: 3px; }
.rb-preview .competencies-line { text-align: center; font-size: 13px; margin-bottom: 12px; }
.rb-preview .skills-line { font-size: 13px; margin-bottom: 4px; }

/* --- Toast --- */
.rb-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  animation: rb-toast-in 0.3s ease;
  max-width: 360px;
}

.rb-toast.success { background: var(--color-success); }
.rb-toast.error { background: var(--color-danger); }

@keyframes rb-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Voice Input Mic Button --- */
.rb-mic-wrap {
  position: relative;
}
.rb-mic-wrap textarea {
  padding-right: 44px;
}
.rb-mic-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface, #f5f5f5);
  border: 1px solid var(--color-border, #ddd);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  color: var(--color-text-muted, #666);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.rb-mic-btn:hover {
  background: var(--color-primary-bg, #e8f0fe);
  color: var(--color-primary, #065F46);
}
.rb-mic-btn.recording {
  background: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
  animation: rb-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes rb-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .rb-panel { padding: 20px 16px; }
  .rb-form-row { grid-template-columns: 1fr; }
  .rb-step-label { display: none; }
  .rb-step-line { width: 16px; }
  .rb-repeatable-item { grid-template-columns: 1fr; }
  .rb-preview { padding: 20px 16px; }
}
