/* StudMatch Cookie Consent Banner & Preferences Modal */
.sm-cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  max-width: 780px;
  margin: 0 auto;
  background: #FFFFFF;
  color: #18181B;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.18), 0 4px 14px -4px rgba(15, 23, 42, 0.08);
  padding: 18px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
}

.sm-cookie-banner.sm-visible {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.sm-cookie-banner-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sm-cookie-banner-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #18181B;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.sm-cookie-banner-text {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  margin: 0;
}

.sm-cookie-banner-text a {
  color: #6C5CE7;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sm-cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.sm-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #18181B;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.sm-cookie-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.sm-cookie-btn:active {
  transform: scale(0.98);
}

.sm-cookie-btn--primary {
  background: #6C5CE7;
  border-color: #6C5CE7;
  color: #FFFFFF;
}

.sm-cookie-btn--primary:hover {
  background: #5B4BDB;
  border-color: #5B4BDB;
  color: #FFFFFF;
}

.sm-cookie-btn--ghost {
  background: #F8FAFC;
  color: #475569;
}

/* Modal Backdrop */
.sm-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sm-cookie-modal.sm-open {
  display: flex;
}

.sm-cookie-dialog {
  width: 100%;
  max-width: 560px;
  max-height: min(88dvh, 720px);
  background: #FFFFFF;
  color: #18181B;
  border: 1px solid #E2E8F0;
  border-radius: 22px;
  box-shadow: 0 28px 60px -16px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: smCookiePop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smCookiePop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sm-cookie-dialog-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sm-cookie-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #18181B;
  margin: 0 0 4px;
  line-height: 1.25;
}

.sm-cookie-dialog-sub {
  font-size: 13px;
  color: #64748B;
  margin: 0;
  line-height: 1.45;
}

.sm-cookie-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #475569;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.sm-cookie-close:hover {
  background: #E2E8F0;
  color: #18181B;
}

.sm-cookie-dialog-body {
  padding: 16px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sm-cookie-cat {
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #F8FAFC;
}

.sm-cookie-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sm-cookie-cat-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #18181B;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sm-cookie-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.sm-cookie-pill--muted {
  background: #EEF2FF;
  color: #4F46E5;
  border-color: #C7D2FE;
}

.sm-cookie-cat-desc {
  font-size: 12.8px;
  line-height: 1.5;
  color: #475569;
  margin: 0;
}

.sm-cookie-cat-keys {
  margin-top: 8px;
  font-size: 11.5px;
  color: #64748B;
  line-height: 1.45;
}

.sm-cookie-cat-keys code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 1px 5px;
  color: #18181B;
}

/* Toggle Switch */
.sm-cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.sm-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.sm-cookie-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.sm-cookie-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-cookie-switch input:checked + .sm-cookie-slider {
  background: #6C5CE7;
}

.sm-cookie-switch input:checked + .sm-cookie-slider::before {
  transform: translateX(20px);
}

.sm-cookie-switch input:disabled + .sm-cookie-slider {
  background: #10B981;
  opacity: 0.78;
  cursor: not-allowed;
}

.sm-cookie-switch input:focus-visible + .sm-cookie-slider {
  outline: 2px solid #6C5CE7;
  outline-offset: 2px;
}

.sm-cookie-meta-note {
  font-size: 12px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.sm-cookie-meta-note a {
  color: #6C5CE7;
  font-weight: 600;
  text-decoration: underline;
}

.sm-cookie-dialog-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sm-cookie-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Subtle Toast */
.sm-cookie-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9999;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: #18181B;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  transition: transform 0.22s ease, opacity 0.22s ease;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sm-cookie-toast.sm-show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 720px) {
  .sm-cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }
  .sm-cookie-banner-actions {
    width: 100%;
  }
  .sm-cookie-banner-actions .sm-cookie-btn {
    flex: 1 1 auto;
  }
  .sm-cookie-dialog-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .sm-cookie-footer-right {
    width: 100%;
  }
  .sm-cookie-dialog-footer .sm-cookie-btn {
    flex: 1 1 auto;
  }
}
