/* ================================================
   SMART POPUP — Reusable CSS
   To customise: change the variables at the top only
   ================================================ */

:root {
  --sp-accent:       #1a3a5c;   /* Main button / hero color        */
  --sp-accent-light: #e8f0f8;   /* Light tint for perks / badges   */
  --sp-accent-text:  #ffffff;   /* Text on accent background       */
  --sp-radius:       14px;      /* Corner rounding                 */
  --sp-font:         inherit;   /* Matches your site font          */
}

/* Overlay */
#smartpopup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: var(--sp-font);
}

#smartpopup.sp-visible {
  opacity: 1;
  pointer-events: all;
}

/* Box */
.sp-box {
  background: #ffffff;
  border-radius: var(--sp-radius);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.35s ease;
}

#smartpopup.sp-visible .sp-box {
  transform: translateY(0) scale(1);
}

/* Hero strip */
.sp-hero {
  background: var(--sp-accent);
  padding: 1.75rem 1.5rem 1.25rem;
  text-align: center;
  position: relative;
}

.sp-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.sp-percent {
  font-size: 68px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  margin: 0;
  letter-spacing: -2px;
}

.sp-percent sup {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: super;
}

.sp-percent sub {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: baseline;
}

.sp-hero-sub {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin: 6px 0 0;
}

/* Close button */
.sp-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}

.sp-close-btn:hover {
  background: rgba(255,255,255,0.28);
}

/* Body */
.sp-body {
  padding: 1.4rem 1.6rem 1.6rem;
}

.sp-title {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin: 0 0 4px;
  text-align: center;
}

.sp-subtitle {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 0 0 1.1rem;
  line-height: 1.5;
}

/* Perks */
.sp-perks {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.sp-perk {
  font-size: 11.5px;
  color: var(--sp-accent);
  background: var(--sp-accent-light);
  border-radius: 20px;
  padding: 4px 11px;
  font-weight: 500;
}

/* Inputs */
.sp-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--sp-font);
}

.sp-input:focus {
  border-color: var(--sp-accent);
}

/* Submit button */
.sp-btn {
  width: 100%;
  padding: 11px;
  background: var(--sp-accent);
  color: var(--sp-accent-text);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--sp-font);
  margin-top: 2px;
}

.sp-btn:hover { opacity: 0.88; }
.sp-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Error */
.sp-error {
  display: none;
  color: #c0392b;
  font-size: 12px;
  margin: 4px 0 6px;
  text-align: center;
}

/* Footer links */
.sp-footer {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: #999;
}

.sp-footer a {
  color: #999;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  font-size: 12px;
  font-family: var(--sp-font);
  padding: 0;
  margin: 0 6px;
}

.sp-footer a:hover { color: #555; }

.sp-fine {
  font-size: 11px;
  color: #bbb;
  text-align: center;
  margin: 10px 0 0;
}

/* Success state */
#sp-success-state {
  display: none;
  text-align: center;
  padding: 1.5rem 1.6rem 2rem;
}

.sp-success-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--sp-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 24px;
}

.sp-success-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin: 0 0 6px;
}

.sp-success-sub {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 480px) {
  .sp-percent { font-size: 52px; }
  .sp-box { border-radius: 10px; }
  .sp-body { padding: 1.2rem 1.2rem 1.4rem; }
}