/* CookieShift — Email verification: top banner + premium modal overlay */

/* ── Top banner (dashboard only) ─────────────────────────────────────────── */
.cs-ev-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--cs-warn-bg, #fef3c7);
  border-bottom: 1px solid var(--cs-warn-border, #fcd34d);
  color: var(--cs-warn-text, #92400e);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

.cs-ev-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 100%;
  margin: 0 auto;
  padding: 15px 20px;
}

.cs-ev-banner__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid var(--cs-warn-border, #fcd34d);
  font-size: 19px;
}

.cs-ev-banner__copy { flex: 1; min-width: 0; }

.cs-ev-banner__title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.cs-ev-banner__text {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: #a16207;
}

.cs-ev-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cs-ev-banner__cta {
  height: 35px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #2562ff;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cs-ev-banner__cta:hover {
  background: #0f172a;
}

.cs-ev-banner__close {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.cs-ev-banner__close:hover {
  background: #ffffff80;
  border-color: var(--cs-warn-border, #fcd34d);
}

/* ── Modal overlay (portal on document.body) ─────────────────────────────── */
.cs-ev-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cs-ev-fade-in 0.22s ease-out;
}

.cs-ev-dialog {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: 540px;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 32px 64px -16px rgba(15, 23, 42, 0.18),
    0 16px 32px -12px rgba(59, 130, 246, 0.14);
  padding: 40px 36px 32px;
  text-align: center;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  animation: cs-ev-scale-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  isolation: isolate;
}

.cs-ev-overlay .cs-ev-dialog {
  border-radius: 28px;
}

.cs-ev-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 8% 0%, rgba(191, 219, 254, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 92% 8%, rgba(199, 210, 254, 0.35) 0%, transparent 50%),
    radial-gradient(circle at 50% 0%, rgba(239, 246, 255, 0.9) 0%, transparent 42%);
}

.cs-ev-dialog::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 160px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image: radial-gradient(circle, rgba(147, 197, 253, 0.55) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.cs-ev-dialog > * {
  position: relative;
  z-index: 1;
}

.cs-ev-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  z-index: 2;
}

.cs-ev-close:hover {
  background: #fff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.cs-ev-dialog__icon {
  position: relative; 
  width: 88px;
  height: 88px;
  margin: 4px auto 22px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 48%, #e0e7ff 100%);
  color: #2563eb;
  box-shadow: none;
}

.cs-ev-dialog__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Cpath d='M6 14a3 3 0 013-3h30a3 3 0 013 3v20a3 3 0 01-3 3H9a3 3 0 01-3-3V14z' fill='%233B82F6'/%3E%3Cpath d='M6 16l18 12L42 16' stroke='%232563EB' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6 14l18 12L42 14' fill='%2360A5FA'/%3E%3Crect x='11' y='28' width='26' height='5' rx='2.5' fill='%23DBEAFE'/%3E%3Ccircle cx='15' cy='30.5' r='1.35' fill='%232563EB'/%3E%3Ccircle cx='19.5' cy='30.5' r='1.35' fill='%232563EB'/%3E%3Ccircle cx='24' cy='30.5' r='1.35' fill='%232563EB'/%3E%3Ccircle cx='28.5' cy='30.5' r='1.35' fill='%232563EB'/%3E%3Ccircle cx='33' cy='30.5' r='1.35' fill='%232563EB'/%3E%3Ccircle cx='37.5' cy='30.5' r='1.35' fill='%232563EB'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.18));
}

.cs-ev-dialog__icon::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #2563eb
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2l2.8 2.8 6.2-6.4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px 12px no-repeat;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.cs-ev-dialog__icon svg {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cs-ev-dialog__title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.2;
}

.cs-ev-dialog__desc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 0 29px;
  font-size: 16px;
  line-height: 1.55;
  color: #64748b;
}

.cs-ev-dialog__email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 6px 22px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  word-break: break-all;
  max-width: 100%;
}

.cs-ev-dialog__email::after {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.75;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='9' y='9' width='12' height='12' rx='2' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='9' y='9' width='12' height='12' rx='2' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── 6-box OTP input ─────────────────────────────────────────────────────── */
.cs-ev-otp-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
}

.cs-ev-otp-box {
  width: 56px;
  height: 56px;
  border: 1.5px solid #e1e1e1;
  border-radius: 12px;
  background: #fff;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  padding: 0;
  -moz-appearance: textfield;
}

.cs-ev-otp-box:not(.is-filled):not(:focus) {
  color: transparent;
  caret-color: #2563eb;
  background-color: #fff;
  background-image: linear-gradient(#cbd5e1, #cbd5e1);
  background-size: 14px 2px;
  background-position: center;
  background-repeat: no-repeat;
}

.cs-ev-otp-box::-webkit-outer-spin-button,
.cs-ev-otp-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cs-ev-otp-box:focus {
  border-color: #3b82f6;
  background: #fff;
  background-image: none;
  color: #0f172a;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.cs-ev-otp-box.is-filled {
  border-color: #93c5fd;
  background: #fff;
  background-image: none;
  color: #0f172a;
}

/* Info banner (shown when no error) / error banner (when visible) */
.cs-ev-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
}

.cs-ev-error:not([hidden])::before,
.cs-ev-error:not([hidden])::after {
  display: none;
  content: none;
}

.cs-ev-error[hidden] {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-align: left;
}

.cs-ev-error[hidden]::before {
  content: "i";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  line-height: 18px;
  text-align: center;
}

.cs-ev-error[hidden]::after {
  content: "Check your inbox and spam folder if you don't see the email.";
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #1e40af;
}

/* ── Primary button (token: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%)) ─ */
.cs-ev-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin: 0 0 8px;
  border: none;
  border-radius: 12px;
  background-color: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.cs-ev-btn-primary:hover {
  background-color: #0f172a;
}
.cs-ev-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.38);
}

.cs-ev-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.cs-ev-btn-primary .cs-ev-btn-text::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -2px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3.2 8.7-7 9-3.8-.3-7-4.5-7-9V6l7-3z' stroke='black' stroke-width='2'/%3E%3Cpath d='M9.5 12.5l1.8 1.8 3.5-3.6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3l7 3v6c0 4.5-3.2 8.7-7 9-3.8-.3-7-4.5-7-9V6l7-3z' stroke='black' stroke-width='2'/%3E%3Cpath d='M9.5 12.5l1.8 1.8 3.5-3.6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cs-ev-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cs-ev-spin 0.7s linear infinite;
}

.cs-ev-spinner[hidden] {
  display: none !important;
}

/* ── Secondary actions ─────────────────────────────────────────────────────── */
.cs-ev-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid #e2e8f0;
  position: relative;
}

.cs-ev-secondary::before {
  content: "Didn't receive the code?";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 14px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.cs-ev-link-btn {
  border: none;
  background: none;
  padding: 6px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cs-ev-link-btn[data-cs-ev-resend] {
  padding-right: 18px;
  border-right: 1px solid #dbeafe;
}

.cs-ev-link-btn[data-cs-ev-change-email] {
  padding-left: 18px;
}

.cs-ev-link-btn[data-cs-ev-resend]::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='2.5' y='5.5' width='13' height='10.5' rx='1.5' stroke='black' stroke-width='1.75'/%3E%3Cpath d='M2.5 7.5l6.5 4.5L15.5 7.5' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17.5 13.5h2.75a1.25 1.25 0 001.25-1.25V9.25' stroke='black' stroke-width='1.75' stroke-linecap='round'/%3E%3Cpath d='M21.5 9.25l-2.75-2.75M21.5 9.25l-2.75 2.75' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='2.5' y='5.5' width='13' height='10.5' rx='1.5' stroke='black' stroke-width='1.75'/%3E%3Cpath d='M2.5 7.5l6.5 4.5L15.5 7.5' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17.5 13.5h2.75a1.25 1.25 0 001.25-1.25V9.25' stroke='black' stroke-width='1.75' stroke-linecap='round'/%3E%3Cpath d='M21.5 9.25l-2.75-2.75M21.5 9.25l-2.75 2.75' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cs-ev-link-btn[data-cs-ev-change-email]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4 12.5-12.5z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4 12.5-12.5z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cs-ev-link-btn:hover:not(:disabled) {
  color: #1d4ed8;
  text-decoration: none;
}

.cs-ev-link-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}

.cs-ev-cooldown {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  min-height: 1.2em;
}

.cs-ev-cooldown:empty {
  display: none;
}

/* ── Body lock ───────────────────────────────────────────────────────────── */
body.cs-ev-modal-open {
  overflow: hidden !important;
}

.cs-ev-toast {
  z-index: 100100;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes cs-ev-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cs-ev-scale-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cs-ev-spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .cs-ev-banner__inner {
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .cs-ev-banner__actions {
    width: 100%;
    justify-content: space-between;
  }

  .cs-ev-banner__cta { flex: 1; }

  .cs-ev-overlay .cs-ev-dialog,
  .cs-ev-dialog {
    padding: 28px 20px 22px;
    border-radius: 18px;
  }

  .cs-ev-dialog__icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .cs-ev-dialog__icon::before {
    width: 40px;
    height: 40px;
  }

  .cs-ev-dialog__icon svg {
    width: 1px;
    height: 1px;
  }

  .cs-ev-dialog__title {
    font-size: 22px;
  }

  .cs-ev-otp-row { gap: 8px; }

  .cs-ev-otp-box {
    width: 46px;
    height: 50px;
    font-size: 20px;
    border-radius: 10px;
  }

  .cs-ev-secondary {
    flex-direction: column;
    gap: 10px;
    padding-top: 24px;
  }

  .cs-ev-link-btn[data-cs-ev-resend] {
    border-right: none;
    padding-right: 16px;
  }

  .cs-ev-link-btn[data-cs-ev-change-email] {
    padding-left: 16px;
  }
}

@media (max-width: 380px) {
  .cs-ev-otp-row { gap: 6px; }

  .cs-ev-otp-box {
    width: 40px;
    height: 46px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-ev-banner,
  .cs-ev-overlay,
  .cs-ev-dialog,
  .cs-ev-toast,
  .cs-ev-spinner {
    animation: none !important;
    transition: none !important;
  }
}
