.school-form-backdrop,
.school-form-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 9400;
}

.school-form-modal,
.school-form-preview-modal {
  position: fixed;
  z-index: 9401;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.school-form-modal {
  inset: 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.school-form-header,
.school-form-footer,
.school-form-preview-modal header,
.school-form-preview-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.school-form-footer,
.school-form-preview-modal footer {
  border-top: 1px solid #e5e7eb;
  border-bottom: 0;
}

.school-form-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.school-form-header span,
.school-form-eyebrow,
.school-form-field em,
.school-form-report-main span,
.school-form-report-main em {
  color: #64748b;
}

.school-form-eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.school-form-close,
.school-form-preview-modal header button {
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.school-form-shell {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.school-form-stepper {
  margin: 0;
  padding: 18px;
  list-style: none;
  border-right: 1px solid #e5e7eb;
  background: #f8fafc;
  overflow: auto;
}

.school-form-stepper li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  color: #64748b;
}

.school-form-stepper span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-weight: 700;
}

.school-form-stepper strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.school-form-stepper .is-current {
  color: #0f172a;
}

.school-form-stepper .is-current span {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.school-form-stepper .is-done span {
  border-color: #0f766e;
  color: #0f766e;
}

.school-form-main {
  padding: 20px;
  min-width: 0;
  overflow: auto;
  background: #ffffff;
}

.school-form-upload-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.school-form-upload-box,
.school-form-file-card,
.school-form-section-card,
.school-form-report-row {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.school-form-upload-box {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  min-height: 220px;
  padding: 22px;
  cursor: pointer;
}

.school-form-upload-box input {
  display: none;
}

.school-form-upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.school-form-file-card {
  padding: 12px;
}

.school-form-file-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.school-form-original-preview,
.school-form-pdf-preview {
  width: 100%;
  min-height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.school-form-original-preview--empty,
.school-form-pdf-preview--empty {
  display: grid;
  place-items: center;
  color: #64748b;
}

.school-form-section-card {
  padding: 18px;
  margin-bottom: 16px;
}

.school-form-section-card h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.school-form-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.school-form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.school-form-field--full {
  grid-column: 1 / -1;
}

.school-form-field span {
  font-weight: 700;
  font-size: 0.9rem;
}

.school-form-field b {
  color: #b91c1c;
  margin-left: 3px;
}

.school-form-field input,
.school-form-field select,
.school-form-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}

.school-form-field textarea {
  resize: vertical;
}

.school-form-field em {
  font-size: 0.75rem;
  font-style: normal;
}

.school-form-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.school-form-signature-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.school-form-signature-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.school-form-signature-card-head strong {
  font-size: 0.92rem;
}

.school-form-signature-pill,
.school-form-report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.school-form-signature-pill.is-applied,
.school-form-report-badge {
  background: #dcfce7;
  color: #166534;
}

.school-form-signature-preview {
  display: grid;
  place-items: center;
  min-height: 74px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.school-form-signature-preview--blank {
  color: #64748b;
  font-size: 0.82rem;
}

.school-form-signature-preview img {
  max-width: 100%;
  max-height: 68px;
  object-fit: contain;
}

.school-form-signature-preview-text {
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.8rem;
  line-height: 1;
  color: #111827;
}

.school-form-initials-preview-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
}

.school-form-signature-date {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: #334155;
}

.school-form-signature-date span {
  font-weight: 700;
}

.school-form-signature-date input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.school-form-signature-actions,
.school-form-signature-modal-actions,
.school-form-signature-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.school-form-signature-actions button:disabled,
.school-form-signature-modal-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.school-form-signature-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(15, 23, 42, 0.46);
}

.school-form-signature-modal {
  position: fixed;
  z-index: 9501;
  inset: 48px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.school-form-signature-modal header,
.school-form-signature-modal footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.school-form-signature-modal footer {
  align-items: flex-end;
  border-top: 1px solid #e5e7eb;
  border-bottom: 0;
}

.school-form-signature-tabs {
  padding: 12px 18px 0;
}

.school-form-signature-tabs button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}

.school-form-signature-tabs button.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.school-form-signature-modal-body {
  display: grid;
  gap: 12px;
  padding: 18px;
  min-height: 0;
  overflow: auto;
}

.school-form-signature-canvas-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.school-form-signature-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
}

.school-form-signature-consent {
  display: grid;
  gap: 2px;
  max-width: 480px;
}

.school-form-signature-muted,
.school-form-report-main small {
  color: #64748b;
  font-size: 0.78rem;
}

.school-form-segment {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eef2f7;
}

.school-form-segment button,
.school-form-report-actions button {
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  cursor: pointer;
  color: #334155;
  font-weight: 700;
}

.school-form-segment button.is-active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.school-form-status,
.school-form-alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.school-form-status--ok,
.school-form-alert--ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.school-form-status--error,
.school-form-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.school-form-status--warn,
.school-form-alert--warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.school-form-alert strong,
.school-form-alert span {
  display: block;
}

.school-form-alert ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.school-form-checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  color: #334155;
}

.school-form-save-medical {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #475569;
}

.school-form-save-medical input {
  margin-top: 2px;
}

.school-form-save-medical-note {
  display: block;
  margin-top: 6px;
  color: #92400e;
  font-size: 0.76rem;
}

.school-form-muted {
  margin: -4px 0 10px;
  color: #64748b;
  font-size: 0.86rem;
}

.school-form-calendar-card {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.school-form-calendar-fields.is-disabled {
  opacity: 0.58;
}

.school-form-calendar-child,
.school-form-calendar-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #334155;
  font-size: 0.86rem;
}

.school-form-calendar-child span {
  color: #0f172a;
}

.school-form-calendar-status {
  margin-top: 10px;
  color: #0f766e;
  font-weight: 700;
}

.school-form-review-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}

.school-form-footer-main {
  display: flex;
  gap: 10px;
}

.school-form-reports-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.school-form-reports-head h3 {
  margin: 0;
}

.school-form-report-list {
  display: grid;
  gap: 10px;
}

.school-form-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.school-form-report-main {
  display: grid;
  gap: 3px;
}

.school-form-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.school-form-report-actions button {
  background: #f1f5f9;
}

.school-form-preview-modal {
  inset: 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.school-form-preview-modal iframe {
  flex: 1;
  min-height: 0;
  border: 0;
}

.school-form-preview-modal footer {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .school-form-modal,
  .school-form-preview-modal {
    inset: 8px;
    border-radius: 10px;
  }

  .school-form-shell,
  .school-form-upload-grid,
  .school-form-report-row,
  .school-form-signature-grid {
    grid-template-columns: 1fr;
  }

  .school-form-stepper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .school-form-stepper li {
    min-width: 150px;
  }

  .school-form-field-grid {
    grid-template-columns: 1fr;
  }

  .school-form-header,
  .school-form-footer,
  .school-form-signature-modal footer {
    align-items: stretch;
    flex-direction: column;
  }

  .school-form-signature-modal {
    inset: 10px;
  }

  .school-form-footer-main,
  .school-form-report-actions {
    width: 100%;
    justify-content: stretch;
  }

  .school-form-footer-main button,
  .school-form-report-actions button {
    flex: 1;
  }
}
