:root{
  --sm-primary: #1f2a4d;
  --sm-secondary: #e3c46b;
  --sm-border: #d9dde5;
  --sm-muted: #7f8798;
  --sm-bg: rgba(19, 26, 43, 0.45);
  --sm-white: #ffffff;
  --sm-soft: #f7f8fb;
  --sm-blue: #4a86e8;
  --sm-blue-dark: #3b78db;
  --sm-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  --sm-radius: 26px;
  --sm-radius-sm: 14px;
  --sm-transition: all .28s ease;
}

.service-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--sm-transition);
}

.service-modal.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 99999;
}

.service-modal-backdrop{
  position: absolute;
  inset: 0;
  background: var(--sm-bg);
  backdrop-filter: blur(6px);
}

.service-modal-dialog{
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: calc(100vh - 60px);
  overflow: auto;
  background: var(--sm-white);
  border-radius: var(--sm-radius);
  box-shadow: var(--sm-shadow);
  z-index: 2;
}

.service-modal-close{
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f7;
  color: var(--sm-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--sm-transition);
}

.service-modal-close:hover{
  background: #e6eaf1;
}

.service-modal-inner{
  padding: 0;
}

.service-wizard-head{
  padding: 42px 42px 28px;
  border-bottom: 1px solid var(--sm-border);
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-start;
}

.service-wizard-head h2{
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.1;
  font-weight: 800;
  color: var(--sm-primary);
}

.service-wizard-head p{
  margin: 0;
  font-size: 1.15rem;
  color: #5e6575;
}

.service-step-status{
  min-width: 220px;
  padding-top: 8px;
}

.service-step-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--sm-primary);
  font-size: 1rem;
  font-weight: 600;
}

.service-step-dots{
  display: flex;
  gap: 8px;
}

.service-step-dots i{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b9c0cd;
  display: block;
}

.service-step-dots i.is-active{
  background: var(--sm-secondary);
}

.service-step-bars{
  display: flex;
  gap: 8px;
}

.service-step-bars span{
  height: 7px;
  flex: 1;
  border-radius: 999px;
  background: #c6ccd6;
  display: block;
}

.service-step-bars span.is-active{
  background: var(--sm-secondary);
}

.wizard-step{
  display: none;
}

.wizard-step.is-active{
  display: block;
}

.wizard-accordion{
  border-bottom: 1px solid var(--sm-border);
}

.wizard-accordion-head{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 28px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--sm-primary);
}

.wizard-accordion-head i{
  font-size: 1.2rem;
  color: #7f8798;
}

.wizard-accordion-body{
  padding: 6px 42px 34px;
}

.student-card,
.emergency-card{
  background: #fbfbfd;
  border: 1px solid var(--sm-border);
  border-radius: 16px;
  padding: 18px;
}

.student-card + .student-card,
.emergency-card + .emergency-card{
  margin-top: 14px;
}

.student-card-title{
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--sm-primary);
  margin-bottom: 14px;
}

.subsection-title{
  font-size: 1rem;
  font-weight: 800;
  color: var(--sm-primary);
  margin: 20px 0 14px;
}

.subsection-title small{
  color: var(--sm-muted);
  font-weight: 600;
}

.form-grid{
  display: grid;
  gap: 18px;
}

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

.form-grid-2{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.form-group label{
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #4a5264;
}

.form-group input,
.form-group select,
.form-group textarea{
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--sm-border);
  border-radius: 12px;
  background: #fff;
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--sm-primary);
  outline: none;
  transition: var(--sm-transition);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus{
  border-color: #8db4f3;
  box-shadow: 0 0 0 4px rgba(74, 134, 232, 0.10);
}

.link-add,
.link-remove{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: #2f6fcf;
}

.link-remove{
  color: #4e5566;
}

.wizard-actions{
  padding: 28px 42px 36px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.btn-wizard{
  min-width: 220px;
  min-height: 60px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid var(--sm-border);
  transition: var(--sm-transition);
}

.btn-wizard-light{
  background: #fff;
  color: #808899;
}

.btn-wizard-light:hover{
  background: #f7f8fb;
}

.btn-wizard-primary{
  background: var(--sm-blue);
  color: #fff;
  border-color: var(--sm-blue);
}

.btn-wizard-primary:hover{
  background: var(--sm-blue-dark);
  border-color: var(--sm-blue-dark);
}

body.service-modal-open{
  overflow: hidden;
}

@media (max-width: 991.98px){
  .service-modal{
    padding: 16px;
  }

  .service-wizard-head{
    padding: 30px 22px 22px;
    flex-direction: column;
  }

  .wizard-accordion-head,
  .wizard-accordion-body,
  .wizard-actions{
    padding-left: 22px;
    padding-right: 22px;
  }

  .form-grid-2,
  .form-grid-3{
    grid-template-columns: 1fr;
  }

  .service-step-status{
    min-width: auto;
    width: 100%;
  }

  .btn-wizard{
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 767.98px){
  .service-modal-dialog{
    max-height: calc(100vh - 32px);
  }

  .service-wizard-head h2{
    font-size: 2rem;
  }

  .service-wizard-head p{
    font-size: 1rem;
  }

  .wizard-actions{
    flex-direction: column;
  }

  .wizard-accordion-head{
    font-size: 1rem;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea{
    min-height: 54px;
  }
}