/* ── Interview Answer Builder v1.0 ── */

:root {
  --iab-primary:  #4f6af0;
  --iab-primary-d:#3d58d8;
  --iab-s:        #4f6af0;   /* Situation  – blue   */
  --iab-t:        #e05a8a;   /* Task       – pink   */
  --iab-a:        #0faa6e;   /* Action     – green  */
  --iab-r:        #f5a623;   /* Result     – amber  */
  --iab-radius:   12px;
  --iab-shadow:   0 2px 16px rgba(0,0,0,0.07);
}

.iab-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 56px;
  color: #1a1a2e;
}

/* ── Hero ─────────────────────────────────────────────── */
.iab-hero {
  text-align: center;
  padding: 40px 24px 32px;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff5fb 100%);
  border-radius: 16px;
  border: 1px solid #e3e8f5;
  margin-bottom: 32px;
  position: relative;
}

.iab-hero-badge {
  display: inline-block;
  background: #e8f8f0;
  color: #0faa6e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.iab-hero h2 {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
  color: #1a1a2e;
}

.iab-hero p {
  font-size: 1.05rem;
  color: #5a6480;
  margin: 0;
  line-height: 1.6;
}

.iab-hero em {
  font-style: italic;
  color: #1a1a2e;
  font-weight: 500;
}

/* ── Steps ────────────────────────────────────────────── */
.iab-step { display: none; }
.iab-step--active { display: block; }

.iab-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.iab-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--iab-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.iab-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* ── Question grid ────────────────────────────────────── */
.iab-question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.iab-q-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border: 2px solid #e3e8f5;
  border-radius: var(--iab-radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.12s;
  box-shadow: var(--iab-shadow);
}

.iab-q-card:hover {
  border-color: var(--iab-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79,106,240,0.12);
}

.iab-q-icon  { font-size: 1.5rem; flex-shrink: 0; }

.iab-q-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.35;
}

.iab-q-arrow {
  color: var(--iab-primary);
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.iab-q-card:hover .iab-q-arrow { opacity: 1; }

/* ── Selected question display ────────────────────────── */
.iab-selected-q {
  background: #f4f6ff;
  border-left: 4px solid var(--iab-primary);
  border-radius: 0 var(--iab-radius) var(--iab-radius) 0;
  padding: 14px 18px;
  margin-bottom: 24px;
}

.iab-q-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--iab-primary);
  letter-spacing: 0.3px;
  display: block;
  margin-bottom: 6px;
}

.iab-q-quote {
  font-size: 1rem;
  font-style: italic;
  color: #1a1a2e;
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

/* ── Form fields ──────────────────────────────────────── */
.iab-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.iab-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.iab-field-group:first-child {
  grid-column: 1 / -1;
}

.iab-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.iab-required { color: var(--iab-t); }

.iab-input {
  padding: 11px 14px;
  border: 2px solid #dde3ec;
  border-radius: 9px;
  font-size: 0.95rem;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
  box-sizing: border-box;
}

.iab-input:focus {
  border-color: var(--iab-primary);
  box-shadow: 0 0 0 3px rgba(79,106,240,0.1);
}

.iab-input::placeholder { color: #aab0cc; }

.iab-field-group--error .iab-input {
  border-color: var(--iab-t);
  box-shadow: 0 0 0 3px rgba(224,90,138,0.1);
}

/* ── Buttons ──────────────────────────────────────────── */
.iab-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.iab-btn-primary {
  padding: 12px 28px;
  background: var(--iab-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.iab-btn-primary:hover {
  background: var(--iab-primary-d);
  transform: translateY(-1px);
}

.iab-btn-ghost {
  padding: 11px 20px;
  background: #fff;
  color: #555;
  border: 2px solid #dde3ec;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.iab-btn-ghost:hover {
  border-color: var(--iab-primary);
  color: var(--iab-primary);
}

.iab-btn-arrow { font-size: 1rem; }

/* ── Output intro ─────────────────────────────────────── */
.iab-output-intro {
  margin-bottom: 18px;
}

.iab-output-intro p {
  font-size: 0.95rem;
  color: #5a6480;
  margin: 0;
  line-height: 1.6;
}

.iab-output-intro mark {
  background: #fff3a3;
  border-radius: 3px;
  padding: 0 2px;
}

/* ── STAR label pills ─────────────────────────────────── */
.iab-star-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.iab-star-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  color: #fff;
}

.iab-star-pill.star-s { background: var(--iab-s); }
.iab-star-pill.star-t { background: var(--iab-t); }
.iab-star-pill.star-a { background: var(--iab-a); }
.iab-star-pill.star-r { background: var(--iab-r); }

/* ── Output card ──────────────────────────────────────── */
.iab-output-card {
  background: #fff;
  border: 1.5px solid #e3e8f5;
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--iab-shadow);
  margin-bottom: 20px;
}

.iab-output-text {
  outline: none;
  cursor: text;
}

.iab-output-text:focus-within {
  /* subtle cue that it's editable */
}

/* Segments */
.iab-segment {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
}

.iab-segment:last-child { margin-bottom: 0; }

.iab-segment.star-s { background: #f0f4ff; border-color: var(--iab-s); }
.iab-segment.star-t { background: #fdf0f7; border-color: var(--iab-t); }
.iab-segment.star-a { background: #eafaf3; border-color: var(--iab-a); }
.iab-segment.star-r { background: #fef9ed; border-color: var(--iab-r); }

.iab-segment-lbl {
  display: block;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.6;
}

.star-s .iab-segment-lbl { color: var(--iab-s); }
.star-t .iab-segment-lbl { color: var(--iab-t); }
.star-a .iab-segment-lbl { color: var(--iab-a); }
.star-r .iab-segment-lbl { color: var(--iab-r); }

.iab-segment p {
  font-size: 1rem;
  line-height: 1.7;
  color: #1a1a2e;
  margin: 0 0 6px;
}

.iab-segment p:last-child { margin-bottom: 0; }

.iab-segment mark {
  background: #fff3a3;
  border-radius: 3px;
  padding: 0 3px;
  font-style: normal;
}

/* ── Output actions ───────────────────────────────────── */
.iab-output-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.iab-output-actions--bottom {
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── Toast ────────────────────────────────────────────── */
.iab-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.iab-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── CTA box ──────────────────────────────────────────── */
.iab-cta-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3555 100%);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.iab-cta-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.iab-cta-text {
  flex: 1;
  min-width: 200px;
}

.iab-cta-text strong {
  display: block;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 4px;
}

.iab-cta-text p {
  font-size: 0.88rem;
  color: #b0b8d8;
  margin: 0;
  line-height: 1.5;
}

.iab-btn-cta {
  display: inline-block;
  padding: 12px 24px;
  background: #fff;
  color: #1a1a2e;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}

.iab-btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  text-decoration: none;
  color: #1a1a2e;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  .iab-hero h2           { font-size: 1.45rem; }
  .iab-hero              { padding: 28px 16px 24px; }
  .iab-question-grid     { grid-template-columns: 1fr; }
  .iab-fields            { grid-template-columns: 1fr; }
  .iab-field-group:first-child { grid-column: auto; }
  .iab-output-card       { padding: 18px 14px; }
  .iab-cta-box           { flex-direction: column; text-align: center; }
  .iab-form-actions      { flex-direction: column; }
  .iab-btn-primary,
  .iab-btn-ghost         { width: 100%; justify-content: center; text-align: center; }
}
