/*
 * Add Student Modal — full-screen unified plan builder (Increment 5b).
 * Shell chrome + Step 1 (about) + Step 2 (goal/IEP) styles, ported from mock v6
 * (frontend/plan-builder-scratch.html), asm- namespaced. Steps 3 & 4 reuse the existing
 * component CSS (plan-builder-suggest.css pbm-chips / plan-builder-modal.css pbm-srow).
 */
.asm-backdrop {
  position: fixed; inset: 0; background: rgba(18,28,18,.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 46px 16px 18px; z-index: 10000;
}
.asm-backdrop.asm-open { display: flex; }
.asm-modal {
  width: min(1060px, 96vw); height: calc(100vh - 74px); background: #F4F7F3;
  border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.42);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1A2718;
}
.asm-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 24px;
  background: #fff; border-bottom: 1px solid #E6EAE6;
}
.asm-mh-title { font-size: 18px; font-weight: 800; }
.asm-mh-sub { font-size: 12.5px; color: #5b6b5c; margin-top: 1px; }
.asm-x {
  margin-left: auto; font: inherit; font-size: 15px; width: 34px; height: 34px;
  border-radius: 9px; border: 1px solid #E6EAE6; background: #fff; color: #5b6b5c; cursor: pointer;
}
.asm-x:hover { background: #EFF2EF; }
.asm-body { flex: 1; overflow: auto; }
.asm-wrap { max-width: 760px; margin: 0 auto; padding: 20px 20px 40px; }

/* progress rail */
.asm-rail { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 18px; }
.asm-dot {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; background: #e1e6e1; color: #8a958b;
}
.asm-dot.asm-on { background: #44A148; color: #fff; box-shadow: 0 0 0 4px rgba(68,161,72,.10); }
.asm-dot.asm-done { background: #2D6A2F; color: #fff; }
.asm-rail .asm-bar { width: 26px; height: 2px; background: #dde2dd; }

/* collapsible step panels */
.asm-panel { background: #fff; border: 1px solid #E6EAE6; border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.asm-panel.asm-popen { box-shadow: 0 1px 8px rgba(20,40,20,.05); }
.asm-phead { display: flex; align-items: center; gap: 11px; padding: 14px 16px; cursor: pointer; user-select: none; }
.asm-phead:hover { background: #EFF2EF; }
.asm-panel.asm-popen .asm-phead { border-bottom: 1px solid #EFF2EF; }
.asm-pnum {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: #EAF5EA;
  color: #2D6A2F; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.asm-panel.asm-popen .asm-pnum { background: #44A148; color: #fff; }
.asm-ptitle { font-weight: 700; font-size: 14.5px; }
.asm-psum {
  margin-left: auto; font-size: 13px; color: #5b6b5c; font-weight: 600; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%;
}
.asm-psum.asm-empty { color: #929d92; font-weight: 500; font-style: italic; }
.asm-pchev { margin-left: 8px; color: #b6c0b6; font-size: 12px; }
.asm-panel.asm-popen .asm-pchev { margin-left: auto; }
.asm-pbody { padding: 6px 16px 18px; }
.asm-desc { color: #5b6b5c; font-size: 13px; margin: 2px 0 14px; }

/* Step 1 — identity + scales */
.asm-q { background: #F7F9F7; border: 1px solid #E6EAE6; border-radius: 12px; padding: 13px 14px; margin-top: 12px; }
.asm-qh { font-weight: 700; font-size: 13.5px; color: #1A2718; }
.asm-qd { color: #5b6b5c; font-size: 12.5px; margin: 3px 0 9px; }
.asm-frow { display: grid; grid-template-columns: 1fr 1fr 88px; gap: 10px; }
.asm-fld label { display: block; font-size: 12px; font-weight: 700; color: #1A2718; margin-bottom: 5px; }
.asm-fld input { width: 100%; font: inherit; border: 1.5px solid #E6EAE6; border-radius: 10px; padding: 9px 11px; background: #fff; color: #1A2718; }
.asm-fld input:focus { outline: none; border-color: #44A148; box-shadow: 0 0 0 3px rgba(68,161,72,.10); }
.asm-seg { display: inline-flex; border: 1.5px solid #bcd3bc; border-radius: 9px; overflow: hidden; }
.asm-seg-wide { display: flex; width: 100%; }
.asm-seg-btn {
  font: inherit; font-size: 13px; font-weight: 700; border: none; background: #fff; color: #1A2718;
  padding: 8px 0; cursor: pointer; border-left: 1px solid #bcd3bc; flex: 1; text-align: center;
}
.asm-seg-btn:first-child { border-left: none; }
.asm-seg-btn:hover { background: rgba(68,161,72,.10); }
.asm-seg-btn.asm-on { background: #44A148; color: #fff; }
.asm-scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: #1A2718; font-weight: 600; margin-top: 4px; }
.asm-scale-desc { font-size: 12px; color: #5b6b5c; line-height: 1.4; margin-top: 8px; padding-top: 8px; border-top: 1px solid #EFF2EF; }
.asm-scale-desc b { font-weight: 800; color: #1A2718; }

/* Step 2 — goal picker + IEP */
.asm-optlist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.asm-opt {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1.5px solid #E6EAE6;
  border-radius: 10px; cursor: pointer; background: #fff; transition: .12s; font-size: 13.5px; font-weight: 600;
}
.asm-opt:hover { border-color: #bcd3bc; }
.asm-opt .asm-optbox { flex-shrink: 0; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #cbd5cb; display: flex; align-items: center; justify-content: center; }
.asm-opt.asm-sel { border-color: #44A148; background: rgba(68,161,72,.10); }
.asm-opt.asm-sel .asm-optbox { background: #44A148; border-color: #44A148; }
.asm-opt.asm-sel .asm-optbox::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.asm-iep {
  width: 100%; font-family: inherit; font-size: 13px; color: #1A2718; border: 1.5px solid #E6EAE6;
  border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 150px; resize: vertical; line-height: 1.5;
}
.asm-iep:focus { outline: none; border-color: #44A148; box-shadow: 0 0 0 3px rgba(68,161,72,.10); }
.asm-hint { font-size: 12px; color: #929d92; margin-top: 7px; }

/* Continue button (in-step) */
.asm-continue {
  font: inherit; font-weight: 700; border: none; border-radius: 10px; padding: 9px 18px; margin-top: 14px;
  cursor: pointer; background: linear-gradient(to bottom, #6DBB70, #43A047); color: #fff;
}
.asm-continue:disabled { background: #cbd5cb; cursor: not-allowed; }

/* sticky footer */
.asm-foot { background: #fff; border-top: 1px solid #E6EAE6; box-shadow: 0 -2px 12px rgba(0,0,0,.05); padding: 11px 20px; }
.asm-foot-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.asm-plan-sum { font-size: 13px; color: #5b6b5c; font-weight: 600; }
.asm-plan-sum b { color: #1A2718; }
.asm-foot-btns { margin-left: auto; display: flex; gap: 9px; align-items: center; }
.asm-saved { font-size: 12px; color: #2D6A2F; font-weight: 600; }
.asm-btn { font: inherit; font-weight: 700; border: none; border-radius: 10px; padding: 11px 20px; cursor: pointer; }
.asm-btn.asm-primary { background: linear-gradient(to bottom, #6DBB70, #43A047); color: #fff; }
.asm-btn.asm-primary:disabled { background: #cbd5cb; color: #fff; cursor: not-allowed; }
.asm-btn.asm-ghost { background: #fff; border: 1.5px solid #E6EAE6; color: #1A2718; }
.asm-btn.asm-del { background: #fff; border: 1px solid #E6EAE6; color: #b42318; padding: 9px 13px; font-size: 12.5px; }
.asm-btn.asm-del:hover { background: #fef2f2; border-color: #f3c4c0; }

/* The embedded Step-4 level picker (pbm- classes) lives inside this shell's flex context —
 * keep its segmented control from collapsing and re-assert the selected-segment fill. */
.asm-modal .pbm-seg-btn { flex: 0 0 auto; white-space: nowrap; }
.asm-modal .pbm-seg-btn.pbm-on { background: #44A148; color: #fff; }
