/* Shared: terms validation toast + checkbox (alpha register, /register, LP forms) */
.sparkl-terms-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  width: min(22rem, calc(100vw - 2rem));
  box-sizing: border-box;
  /* Max 32-bit z-index; above CookieHub/WhatsApp/widget layers that sit on body */
  z-index: 2147483647 !important;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.06))
    drop-shadow(0 12px 40px rgba(0, 0, 0, 0.12));
}

.sparkl-terms-toast__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.875rem 0.75rem;
  background: linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 248, 249, 0.98) 100%
    ),
    rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 55, 68, 0.2);
  border-radius: 1rem;
  border-left: 4px solid #e23744;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

.sparkl-terms-toast__icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-top: 0.0625rem;
  border-radius: 0.625rem;
  background: rgba(226, 55, 68, 0.1);
  color: #c42f3b;
}

.sparkl-terms-toast__icon {
  display: block;
}

.sparkl-terms-toast__message {
  margin: 0;
  padding-top: 0.125rem;
  flex: 1;
  min-width: 0;
  color: #1a1a1a;
  font-family: Inter, Manrope, system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.sparkl-terms-toast:not(.hide-error) .sparkl-terms-toast__inner {
  animation: sparkl-terms-toast-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sparkl-terms-toast-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sparkl-terms-toast:not(.hide-error) .sparkl-terms-toast__inner {
    animation: none;
    opacity: 1;
  }
}

.sparkl-terms-toast.hide-error {
  display: none;
}

.terms-agree-label {
  user-select: none;
  -webkit-user-select: none;
  align-items: center;
}

.terms-agree-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0;
  flex-shrink: 0;
  align-self: center;
  border-radius: 0.3125rem;
  border: 2px solid #b6bbc0;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease;
}

.terms-agree-checkbox:hover {
  border-color: #8b939e;
}

/* Checked + focus: yellow accent (#f9c935 fill, yellow border/outline — no black rim) */
.terms-agree-checkbox:checked {
  background: #f9c935;
  border-color: #f9c935;
}

.terms-agree-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.0625rem;
  width: 0.25rem;
  height: 0.5rem;
  border: solid #1a1a1a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.terms-agree-checkbox:focus-visible {
  outline: 2px solid #f9c935;
  outline-offset: 2px;
}

/* JEE / NEET / CBSE: red fill + accent */
body.sparkl-terms-accent-red .terms-agree-checkbox:checked {
  background: #e23744;
  border-color: #e23744;
}

body.sparkl-terms-accent-red .terms-agree-checkbox:checked::after {
  border-color: #fff;
}

body.sparkl-terms-accent-red .terms-agree-checkbox:focus-visible {
  outline: 2px solid #e23744;
}

/* Terms toast open: emphasize checkbox border in stream accent colour */
html.sparkl-terms-toast-open .terms-agree-checkbox.sparkl-terms-toast-target {
  outline: none !important;
  box-shadow: none !important;
  border-color: #f9c935 !important;
  border-style: solid !important;
  border-width: 2px !important;
}

html.sparkl-terms-toast-open
  body.sparkl-terms-accent-red
  .terms-agree-checkbox.sparkl-terms-toast-target {
  border-color: #e23744 !important;
}

html.sparkl-terms-toast-open .terms-agree-checkbox.sparkl-terms-toast-target:focus,
html.sparkl-terms-toast-open .terms-agree-checkbox.sparkl-terms-toast-target:focus-visible {
  outline: none !important;
  border-color: #f9c935 !important;
  border-width: 2px !important;
}

html.sparkl-terms-toast-open
  body.sparkl-terms-accent-red
  .terms-agree-checkbox.sparkl-terms-toast-target:focus,
html.sparkl-terms-toast-open
  body.sparkl-terms-accent-red
  .terms-agree-checkbox.sparkl-terms-toast-target:focus-visible {
  border-color: #e23744 !important;
}
