/* StudyBuddy Newsletter Styles */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Popup overlay ── */
.sbmail-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: sbmail-fadein 0.3s ease;
}
.sbmail-overlay.sbmail-hide {
  animation: sbmail-fadeout 0.3s ease forwards;
}

/* ── Popup box ── */
.sbmail-popup {
  background: #fff; border-radius: 24px;
  padding: 40px 36px; max-width: 460px; width: 100%;
  text-align: center; position: relative;
  box-shadow: 0 20px 60px rgba(124,58,237,0.2);
  animation: sbmail-slideup 0.4s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'Nunito', sans-serif;
}

.sbmail-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 1.4rem;
  color: #9ca3af; cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.sbmail-close:hover { color: #374151; }

.sbmail-popup-icon { font-size: 3rem; margin-bottom: 12px; display: block; }

.sbmail-popup-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.5rem; font-weight: 900;
  color: #1e1b4b; margin: 0 0 10px;
}

.sbmail-popup-desc {
  color: #6b7280; font-size: 0.95rem; font-weight: 600;
  line-height: 1.6; margin: 0 0 24px;
}

/* ── Forms ── */
.sbmail-form {
  display: flex; flex-direction: column; gap: 10px;
}

.sbmail-input {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid #e5e7eb; background: #f9fafb;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem;
  font-weight: 600; color: #1e1b4b;
  transition: border-color 0.2s; box-sizing: border-box;
}
.sbmail-input:focus {
  outline: none; border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.08);
  background: #fff;
}

.sbmail-btn {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #7c3aed, #ff6b35);
  color: #fff; font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 900; cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.25);
}
.sbmail-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,0.35); }
.sbmail-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.sbmail-result {
  font-size: 0.9rem; font-weight: 700; min-height: 20px;
  border-radius: 8px; padding: 0;
  transition: all 0.3s;
}
.sbmail-result.success {
  color: #065f46; background: #d1fae5;
  border: 1px solid #6ee7b7; padding: 10px 14px;
}
.sbmail-result.error {
  color: #991b1b; background: #fee2e2;
  border: 1px solid #fca5a5; padding: 10px 14px;
}

.sbmail-privacy {
  font-size: 0.78rem; color: #9ca3af;
  font-weight: 600; margin: 8px 0 0;
}

.sbmail-dismiss {
  background: none; border: none; color: #9ca3af;
  font-size: 0.82rem; font-family: 'Nunito', sans-serif;
  font-weight: 700; cursor: pointer; margin-top: 6px;
  text-decoration: underline; transition: color 0.2s;
}
.sbmail-dismiss:hover { color: #6b7280; }

/* ── Embedded form ── */
.sbmail-embed {
  background: linear-gradient(135deg, #faf5ff, #fff7ed);
  border: 2px solid #e9d5ff; border-radius: 20px;
  padding: 36px; margin: 24px 0;
  font-family: 'Nunito', sans-serif;
}
.sbmail-embed-inner { max-width: 480px; margin: 0 auto; text-align: center; }
.sbmail-embed-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.sbmail-embed-title {
  font-size: 1.4rem; font-weight: 900; color: #1e1b4b;
  margin: 0 0 8px;
}
.sbmail-embed-desc {
  color: #6b7280; font-size: 0.92rem; font-weight: 600;
  line-height: 1.6; margin: 0 0 20px;
}

/* ── Animations ── */
@keyframes sbmail-fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sbmail-fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes sbmail-slideup {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .sbmail-popup { padding: 32px 24px; }
  .sbmail-popup-title { font-size: 1.3rem; }
  .sbmail-embed { padding: 24px 20px; }
}
