/**
 * lesson-slp.css   (Phase 3.4 — Batch C / D4.A, 2026-05-24)
 *
 * Styles for:
 *   • js/builder/lesson-editor-slp.js  — author surface (modal +
 *                                         step rows + topbar pill)
 *   • js/runtime/use-lesson-slp.js     — learner surface (per-step
 *                                         prompt + Listen/Next/Skip)
 *
 * Namespace: .lpslp-*  (LessonPlan-SLP — kept distinct from
 * lesson-editor.css's .lesson-* namespace so the two editors can
 * coexist on the same page without rule bleed).
 *
 * A11y contract:
 *   - Buttons hit the 44×44 tap-target floor.
 *   - Inputs stay at 16px so iOS Safari does not zoom on focus.
 *   - Prompt text scales with prefers-larger-text via REM.
 */

/* ── Topbar pill ─────────────────────────────────────────────── */

#lessonModeSlpPill {
  /* Inherits .topbar-btn from builder.css. These overrides nudge the
     pill apart from the other topbar tools so it reads as an editor
     (not a setting). */
  margin-left: 6px;
}

/* ── Editor modal host ───────────────────────────────────────── */

.lpslp-editor-host {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8500;
}

.lpslp-editor-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  width: min(620px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

.lpslp-editor-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lpslp-editor-title {
  font-size: 22px;
  margin: 0 0 4px 0;
  color: #0f172a;
}

.lpslp-editor-help {
  font-size: 13px;
  color: #475569;
  margin: 0;
}

.lpslp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #1e293b;
}

.lpslp-field input,
.lpslp-field select {
  font-size: 16px;             /* iOS zoom floor */
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  min-height: 44px;
}

.lpslp-field input:focus,
.lpslp-field select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

/* ── Step rows ───────────────────────────────────────────────── */

.lpslp-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.lpslp-step-row {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lpslp-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lpslp-step-num {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}

.lpslp-step-del {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 16px;
  color: #b91c1c;
  cursor: pointer;
}

.lpslp-step-del:hover { background: #fee2e2; }

/* ── Add / actions ───────────────────────────────────────────── */

.lpslp-add-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 4px;
}

.lpslp-add-btn {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
}

.lpslp-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lpslp-editor-actions button {
  min-height: 44px;
  min-width: 88px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  cursor: pointer;
}

.lpslp-editor-actions .lpslp-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.lpslp-editor-actions .lpslp-primary:hover { background: #1d4ed8; }

.lpslp-editor-actions .lpslp-clear {
  margin-right: auto;          /* pin to the left */
  color: #b91c1c;
}

/* ── Learner surface (use.html) ──────────────────────────────── */

.lpslp-root {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(560px, 96vw);
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 14px;
  padding: 16px 18px;
  z-index: 7000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lpslp-counter {
  font-size: 12px;
  color: #475569;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lpslp-prompt {
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

.lpslp-hint {
  font-size: 14px;
  color: #b45309;
  background: #fef3c7;
  border-radius: 8px;
  padding: 6px 10px;
}

.lpslp-listen-btn,
.lpslp-next-btn {
  min-height: 56px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.lpslp-listen-btn {
  background: #2563eb;
  color: #ffffff;
}

.lpslp-listen-btn:hover { background: #1d4ed8; }

.lpslp-next-btn {
  background: #16a34a;
  color: #ffffff;
}

.lpslp-next-btn:hover { background: #15803d; }

.lpslp-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.lpslp-skip-btn,
.lpslp-abort-btn {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

.lpslp-skip-btn:hover { background: #f1f5f9; }

.lpslp-abort-btn { color: #b91c1c; }
.lpslp-abort-btn:hover { background: #fee2e2; }

/* ── Reduced motion ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .lpslp-root,
  .lpslp-editor-host {
    transition: none !important;
    animation: none !important;
  }
}
