/* ============================================================
 * IT LEARN — Registration modal styles
 * Reusable across pages. Tự cung cấp giá trị mặc định và đồng thời
 * dùng CSS variable của trang nếu có (var(--name, fallback)).
 * ============================================================ */

.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal[aria-hidden="false"] { display: flex; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 13, 31, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a1230 0%, #0e1024 100%);
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: var(--r-lg, 24px);
  padding: 32px 28px;
  box-shadow: var(--shadow-red, 0 20px 60px -20px rgba(220, 38, 38, .55));
  animation: modal-in .3s ease;
  font-family: var(--body, "Plus Jakarta Sans", system-ui, sans-serif);
  color: var(--text, #f1f5f9);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 0;
  font-size: 22px; line-height: 1;
  color: var(--text-dim, #94a3b8);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, .12);
  color: var(--text, #f1f5f9);
}

.modal-header { margin-bottom: 22px; padding-right: 32px; }
.modal-header h3 {
  margin: 8px 0 0;
  font-family: var(--display, "Bricolage Grotesque", sans-serif);
  font-size: 22px; line-height: 1.3;
  font-weight: 600;
  color: var(--text, #f1f5f9);
}

/* ----- Form ----- */
.reg-form { display: flex; flex-direction: column; gap: 14px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 13px;
  color: var(--text-dim, #94a3b8);
  font-weight: 500;
}
.field > span em {
  color: var(--red-bright, #f87171);
  font-style: normal;
}
.field b {
  color: var(--red-bright, #f87171);
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-weight: 600;
}
.field input,
.field textarea {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-strong, rgba(255, 255, 255, .14));
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text, #f1f5f9);
  width: 100%;
  transition: border-color .2s, background .2s;
}
.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-mute, #64748b); }
.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--red-bright, #f87171);
  background: rgba(255, 255, 255, .06);
}

/* ----- Feedback ----- */
.form-feedback {
  font-size: 13px; line-height: 1.5;
  padding: 0;
  transition: padding .2s;
}
.form-feedback:not(:empty) {
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 2px;
}
.form-feedback.error {
  background: rgba(220, 38, 38, .12);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, .3);
}
.form-feedback.success {
  background: rgba(16, 185, 129, .12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, .3);
}

.reg-form .btn { margin-top: 6px; width: 100%; }
.reg-form .btn[disabled] { opacity: .6; cursor: wait; }

.form-note {
  font-size: 12px;
  color: var(--text-mute, #64748b);
  margin: 8px 0 0;
  text-align: center;
  line-height: 1.5;
}

/* Khoá scroll body khi modal mở */
body.modal-open { overflow: hidden; }
