/* ---- Modal backdrop ---- */
#myModal .modal-dialog {
  max-width: 500px;
  margin: 40px auto;
}
#myModal .modal-content {
  border: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.32), 0 4px 16px rgba(0,0,0,.16);
}

/* ---- Modal header ---- */
#myModal .modal-header {
  background: #1a3a6b;
  border: none;
  padding: 24px 28px 20px;
  position: relative;
}
#myModal .modal-header .close {
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(255,255,255,.7);
  opacity: 1;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  text-shadow: none;
  transition: color .15s;
}
#myModal .modal-header .close:hover { color: #fff; }

#modal_title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
#modal_title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: #e53e3e;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ---- Modal body ---- */
#myModal .modal-body {
  padding: 24px 28px 20px;
  background: #f8fafd;
}

/* ---- Error message ---- */
#mes1 {
  margin-bottom: 4px;
}
#mes1 p {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#mes1 p::before {
  content: '\f071';
  font-family: FontAwesome;
  font-size: 14px;
  flex-shrink: 0;
}

/* ---- Form section card ---- */
.modal-form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 22px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* ---- Field ---- */
.ml-field { margin-bottom: 16px; }
.ml-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.ml-field input.form-control,
.ml-field input[type=text],
.ml-field input[type=email],
.ml-field input[type=password] {
  width: 100% !important;
  padding: 10px 13px !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  background: #fafbfc !important;
  color: #111827 !important;
  transition: border-color .2s, box-shadow .2s;
  height: auto !important;
  box-shadow: none !important;
}
.ml-field input.form-control:focus,
.ml-field input[type=text]:focus,
.ml-field input[type=email]:focus,
.ml-field input[type=password]:focus {
  outline: none !important;
  border-color: #1a3a6b !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(26,58,107,.10) !important;
}

/* ---- Checkbox row ---- */
.ml-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}
.ml-check-row label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  font-weight: 500;
  margin: 0;
}
.ml-check-row input[type=checkbox] {
  width: 15px !important;
  height: 15px !important;
  cursor: pointer;
  vertical-align: middle;
}
.ml-forgot {
  color: #1a3a6b;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ml-forgot:hover { text-decoration: underline; color: #2b6cb0; }

/* ---- Buttons ---- */
.ml-btn-primary {
  width: 100%;
  background: #1a3a6b;
  color: #fff !important;
  border: none;
  padding: 12px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(26,58,107,.28);
  transition: opacity .2s, transform .1s;
  display: block;
  text-align: center;
  text-decoration: none;
}
.ml-btn-primary:hover { opacity: .9; transform: translateY(-1px); color:#fff; }
.ml-btn-danger {
  width: 100%;
  background: #e53e3e;
  color: #fff !important;
  border: none;
  padding: 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(229,62,62,.25);
  transition: opacity .2s, transform .1s;
  display: block;
  text-align: center;
  text-decoration: none;
}
.ml-btn-danger:hover { opacity: .9; transform: translateY(-1px); color:#fff; }

/* ---- Divider ---- */
.ml-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
  color: #9ca3af;
  font-size: 12px;
}
.ml-divider::before,
.ml-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* ---- Signup switch link ---- */
.ml-switch {
  font-size: 13px;
  color: #6b7280;
  margin-top: 14px;
  text-align: center;
}
.ml-switch a {
  color: #1a3a6b;
  font-weight: 600;
  text-decoration: none;
}
.ml-switch a:hover { text-decoration: underline; }

/* ---- dl table (legacy override) ---- */
.dl_table { width: 100%; }
.dl_table dl { margin-bottom: 14px; }
.dl_table dl dt {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.dl_table dl dd { margin: 0; }

/* ---- Modal footer ---- */
#myModal .modal-footer {
  background: #f8fafd;
  border-top: 1px solid #edf0f5;
  padding: 12px 28px;
  text-align: right;
}
#myModal .modal-footer .btn-default {
  background: #fff;
  border: 1.5px solid #d1d5db;
  color: #374151;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 20px;
  transition: background .15s, border-color .15s;
}
#myModal .modal-footer .btn-default:hover {
  background: #f1f5f9;
  border-color: #9ca3af;
}

@media (max-width: 540px) {
  #myModal .modal-header { padding: 18px 20px 14px; }
  #myModal .modal-body   { padding: 18px 20px 16px; }
  .modal-form-card       { padding: 16px 16px 14px; }
}
