
.klas-form {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f9f9f9;
}

.klas-form h2 {
  margin-bottom: 15px;
}

.module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.module-item {
  border: 1px solid #ccc;
  padding: 10px;
  width: 150px;
  text-align: center;
  border-radius: 6px;
  background: #fff;
}

.module-item input {
  margin-right: 5px;
}

.student-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.student-row input {
  flex: 1 1 180px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.remove-student {
  background: #e74c3c;
  color: #fff;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#add-student {
  background: #3498db;
  color: #fff;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 15px;
}

button[type="submit"] {
  background: #2ecc71;
  color: #fff;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.error-msg {
  font-size: 0.9em;
  color: red;
  display: block;
  margin-top: 3px;
}

#totalPrice {
  font-weight: bold;
  font-size: 18px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .student-row input {
    flex: 1 1 100%;
  }
  .module-item {
    width: 100%;
  }
}


/* Stronger visual for selected module cards */
label.module-card.is-selected .card-body {
  background: #eaf2ff !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15) inset !important;
  border-color: #2563eb !important;
}


/* Divider between students */
#students .student-row {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  margin-top: 12px;
}
#students .student-row:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Field errors */
.field-error {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 4px;
}
.student-row input.invalid,
.student-row select.invalid,
.student-row textarea.invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220,38,38,.15);
}

/* Ensure selected module stays visibly blue even if theme overrides */
label.module-card.is-selected .card-body {
  background: #eaf2ff !important;
  border: 2px solid #2563eb !important;
}


/* Strong, visible divider between students */
#students .student-row + .student-row {
  border-top: 2px solid #d1d5db; /* stronger gray */
  margin-top: 14px;
  padding-top: 14px;
}

/* Make whole module card visibly selected (border and slight glow) */
label.module-card.is-selected {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18) inset !important;
}


/* === Strong selected visuals (override theme) === */
#kaa-wrap label.module-card.is-selected,
#kaa-wrap label.module-card.is-selected .card-body {
  background: #e8f1ff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25) inset !important;
}

#kaa-wrap label.module-card.is-selected .module-title,
#kaa-wrap label.module-card.is-selected .module-price {
  color: #1e40af !important;
  font-weight: 700;
}

/* Divider between students (clear separation) */
#students > .student-row + .student-row {
  border-top: 2px solid #d1d5db;
  margin-top: 14px;
  padding-top: 14px;
}


/* Extra-safe divider: any student row after the first gets a line */
#students .student-row { position: relative; }
#students .student-row:not(:first-child) { 
  border-top: 2px solid #d1d5db;
  margin-top: 14px;
  padding-top: 14px;
}


/* PURE CSS selected state */
label.module-card input.module-check:checked + .card-body {
  background: #eaf2ff !important;
  border: 2px solid #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15) inset !important;
}
/* If :has is supported, also color the parent border */
label.module-card:has(input.module-check:checked) {
  border-color: #2563eb !important;
}

/* Divider between students (CSS-only) */
#students .student-row + .student-row {
  border-top: 2px solid #d1d5db;
  margin-top: 14px;
  padding-top: 14px;
}
