/* ============================================
   LessonEye — Modals (Email Gate + Feedback)
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5,5,10,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  background: linear-gradient(180deg, var(--onyx), var(--coal));
  border: 1px solid rgba(212,175,55,.3);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
  position: relative;
  transform: translateY(24px) scale(.96);
  transition: transform .35s var(--ease);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(212,175,55,.1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(212,175,55,.5), transparent 50%, rgba(212,175,55,.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: var(--plat3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: .2s;
  cursor: pointer;
}
body.ar .modal-close { right: auto; left: 16px; }
.modal-close:hover { background: rgba(212,175,55,.15); color: var(--gold); }

.modal-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 8px 20px rgba(212,175,55,.35));
}

.modal h2 {
  font-family: 'Fraunces', 'Tajawal', serif;
  font-size: 1.55rem;
  font-weight: 600;
  text-align: center;
  color: var(--plat);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
body.ar .modal h2 { font-family: 'Tajawal', serif; font-weight: 800; }
.modal h2 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.ar .modal h2 em { font-style: normal; }
.modal-sub {
  text-align: center;
  color: var(--plat3);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 26px;
}

.modal-field { margin-bottom: 14px; }
.modal-field label {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  color: var(--plat2);
  margin-bottom: 6px;
}
.modal-field input, .modal-field textarea, .modal-field select {
  width: 100%;
  padding: 13px 15px;
  background: var(--obsidian);
  border: 1px solid rgba(212,175,55,.18);
  border-radius: 10px;
  color: var(--plat);
  font-size: .92rem;
  transition: .2s;
  font-family: inherit;
}
.modal-field input:focus, .modal-field textarea:focus, .modal-field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}

/* Honeypot — hidden from humans, visible to bots */
.hp-field {
  position: absolute !important;
  left: -99999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold), var(--gold-lo));
  color: var(--obsidian);
  font-size: .95rem;
  font-weight: 700;
  border-radius: var(--r);
  transition: .25s var(--ease);
  margin-top: 10px;
  cursor: pointer;
  font-family: inherit;
}
.modal-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(212,175,55,.4); }
.modal-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.modal-skip {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: .82rem;
  color: var(--plat3);
  text-decoration: underline;
  cursor: pointer;
  transition: color .2s;
}
.modal-skip:hover { color: var(--gold); }

.modal-benefits {
  list-style: none;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(212,175,55,.05);
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,.12);
}
.modal-benefits li {
  padding: 5px 0;
  font-size: .85rem;
  color: var(--plat2);
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.modal-benefits li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}

.modal-privacy {
  font-size: .72rem;
  color: var(--plat4);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}
.modal-privacy a { color: var(--gold); }

.modal-error {
  padding: 10px 14px;
  background: rgba(239,64,96,.1);
  border: 1px solid rgba(239,64,96,.3);
  border-radius: 8px;
  color: #ffb3c0;
  font-size: .82rem;
  margin-bottom: 14px;
  display: none;
}
.modal-error.show { display: block; }

/* Feedback rating stars */
.rating-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 22px;
}
.star {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: .2s;
  color: var(--plat4);
}
.star:hover, .star.active { color: var(--gold); background: var(--gold-soft); }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--coal);
  color: var(--plat);
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.3);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  z-index: 1100;
  opacity: 0;
  transition: .3s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--ok); }
.toast.error { border-color: var(--err); }
