.modal-overlay.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  width: 534px;
  height: 380px;
  padding: 28px;
  gap: 24px;
  border-radius: 16px;
}

/* =========================
   Teacher Create Modal
========================= */

.teacher-modal {
  width: min(432px, calc(100vw - 32px));
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
}

.teacher-modal.teacher-modal--success {
  justify-content: center;
  padding: 28px 20px 24px;
}

.teacher-modal.teacher-modal--success .modal-header {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal h3 {
  font-size: 24px;
  font-family: "Satoshi", sans-serif;
  font-weight: 500;
  color: #0c0c0a;
}

.modal-close-btn {
  border: none;
  background-color: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-textarea {
  resize: none;
  width: 100%;
  height: 100%;
  background-color: #eeebe5;
  padding: 20px 12px;
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: #0c0c0a;
  line-height: 1.69;
}

.modal-textarea::placeholder {
  color: #918d8a;
  font-size: 13px;
  font-weight: 400;
}

.modal-textarea:focus {
  outline: none;
  border: 1px solid #0c0c0a;
  color: #0c0c0a;
  caret-color: #0c0c0a;
}

.modal-save-btn {
  background-color: #0c0c0a;
  color: #ffffff;
  border-radius: 9999px;
  font-size: 16px;
  padding: 20px 12px;
  width: 100%;
  font-weight: 500;
  border: none;
  margin-top: 12px;
}

.modal-save-btn:hover {
  background: #222222f6;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.teacher-modal-form.is-hidden {
  display: none !important;
}

.teacher-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 13px;
  font-weight: 500;
  color: #0c0c0a;
}

.modal-select {
  width: 100%;
  background-color: #eeebe5;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  color: #0c0c0a;
  line-height: 1.5;
  outline: none;
}

.modal-select:focus {
  border-color: #0c0c0a;
}

.modal-checkbox-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  max-height: 180px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 12px;
  background: #eeebe5;
}

.modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #0c0c0a;
}

.modal-error {
  min-height: 18px;
  font-size: 13px;
  color: #f5395e;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .primary-button {
  flex: 1;
}

.teacher-modal-actions {
  display: flex;
  gap: 12px;
}

.teacher-modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 4px 0 0;
}

.teacher-modal-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.teacher-modal-success__title {
  margin: 0;
  font-family: "Satoshi", sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #0c0c0a;
  text-align: center;
}

.teacher-modal-success__description {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #0c0c0a;
  text-align: center;
  max-width: 280px;
}

.teacher-modal-success__email {
  color: #ff5501;
}

.teacher-modal-success__actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
}

.teacher-modal-btn {
  flex: 1;
  height: 56px;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-family: "Satoshi", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.teacher-modal-success__actions .teacher-modal-btn {
  flex: 0 0 188px;
}

.teacher-modal-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.teacher-modal-btn--primary {
  background: #0c0c0a;
  color: #ffffff;
}

.teacher-modal-btn--primary:hover:enabled {
  background: #222222f6;
}

.teacher-modal-btn--secondary {
  background: #eeebe5;
  color: #0c0c0a;
}

.teacher-modal-btn--secondary:hover {
  border-color: #0c0c0a;
}

.teacher-modal .subject-multi-select {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-modal .subject-multi-select__header {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.teacher-modal .subject-multi-select__label {
  font-family: "Satoshi", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #0c0c0a;
}

.teacher-modal .modal-header h3 {
  font-family: "Satoshi", sans-serif;
  font-weight: 400;
}

.teacher-modal .subject-multi-select__helper {
  margin: 0;
  font-size: 13px;
  color: #f5395e;
  display: none;
}

.teacher-modal .subject-multi-select__helper.is-error {
  display: block;
}

.teacher-modal .subject-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.teacher-modal .subject-options.is-error {
  padding: 4px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px #f5395e inset;
}

.teacher-modal .subject-btn {
  font-family: "Inter", sans-serif;
  padding: 10px 12px;
  min-height: 40px;
  background-color: #eeebe5;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 400;
  color: #0c0c0a;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.teacher-modal .subject-btn:hover {
  border-color: #0c0c0a;
}

.teacher-modal .subject-btn.active {
  background-color: #0c0c0a;
  border-color: #0c0c0a;
  color: #ffffff;
}

@media (max-width: 640px) {
  .teacher-modal-actions {
    flex-direction: column;
  }

  .teacher-modal-success__actions {
    flex-direction: column;
  }
}
