/* ════════════════════════════════════════════════════════
   OUR LITTLE PLANS — style.css
   Soft dreamy pastel × glassmorphism × micro-animations
════════════════════════════════════════════════════════ */

/* ── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(145deg, #FFF0F7 0%, #F3EAFF 45%, #FFE8F4 100%);
  min-height: 100vh;
  color: #2A2A3C;
  overflow-x: hidden;
}

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Brand colours */
  --pink:           #FF6B9D;
  --pink-dark:      #E84C87;
  --purple:         #9B5DE5;
  --purple-light:   #C4A8FF;
  --purple-faint:   rgba(155, 93, 229, 0.12);
  --yellow:         #FFD166;
  --green:          #06D6A0;
  --green-bg:       rgba(6, 214, 160, 0.10);
  --red:            #FF4757;
  --red-bg:         rgba(255, 71, 87, 0.10);

  /* Text */
  --text:           #2A2A3C;
  --text-muted:     #8892A4;
  --text-light:     #B8C2CC;

  /* Surfaces */
  --glass:          rgba(255, 255, 255, 0.75);
  --glass-strong:   rgba(255, 255, 255, 0.90);
  --glass-border:   rgba(255, 255, 255, 0.85);
  --shadow-sm:      rgba(155, 93, 229, 0.12);
  --shadow-md:      rgba(155, 93, 229, 0.20);
  --shadow-lg:      rgba(155, 93, 229, 0.28);

  /* Easing */
  --ease-bounce:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:       cubic-bezier(0, 0, 0.2, 1);
}

/* ── UTILITIES ─────────────────────────────────────────── */
.hidden { display: none !important; }


/* ══════════════════════════════════════════════════════════
   FLOATING BACKGROUND EMOJIS
══════════════════════════════════════════════════════════ */
.gate-bg,
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-emoji {
  position: absolute;
  bottom: -60px;
  left: var(--x, 50%);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  animation: floatUp var(--dur, 16s) var(--delay, 0s) ease-in-out infinite;
  opacity: 0;
  user-select: none;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0%   { transform: translateY(0)      rotate(0deg)   scale(1);   opacity: 0;   }
  6%   {                                                            opacity: 0.55; }
  88%  {                                                            opacity: 0.55; }
  100% { transform: translateY(-108vh) rotate(380deg) scale(0.4); opacity: 0;   }
}


/* ══════════════════════════════════════════════════════════
   PASSWORD GATE
══════════════════════════════════════════════════════════ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(145deg, #FFF0F7 0%, #EDE0FF 50%, #FFE0F0 100%);
  transition: opacity 0.55s var(--ease-smooth), transform 0.55s var(--ease-smooth);
}

.gate.unlocking {
  opacity: 0;
  transform: scale(1.04) translateY(-16px);
  pointer-events: none;
}

/* ── Gate card ── */
.gate-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2px solid var(--glass-border);
  border-radius: 32px;
  padding: 48px 36px 40px;
  text-align: center;
  box-shadow:
    0 8px 32px var(--shadow-md),
    0 32px 64px var(--shadow-sm),
    inset 0 1px 0 rgba(255,255,255,0.9);
  animation: gateCardIn 0.7s var(--ease-bounce) both;
}

@keyframes gateCardIn {
  from { opacity: 0; transform: scale(0.78) translateY(32px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* Lock icon */
.gate-icon {
  display: block;
  font-size: 3.2rem;
  margin-bottom: 18px;
  animation: bobFloat 3.2s ease-in-out infinite;
  will-change: transform;
}

@keyframes bobFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}

.gate.unlocking .gate-icon {
  animation: lockBounce 0.55s var(--ease-bounce) forwards;
}

@keyframes lockBounce {
  0%   { transform: scale(1)    rotate(0deg);   }
  35%  { transform: scale(0.55) rotate(-18deg); }
  70%  { transform: scale(1.3)  rotate(12deg);  }
  100% { transform: scale(1)    rotate(0deg);   }
}

/* Gate typography */
.gate-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  color: var(--purple);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gate-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 36px;
}

/* Gate form */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid rgba(155, 93, 229, 0.22);
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.gate-input::placeholder {
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

.gate-input:focus {
  border-color: var(--purple);
  background: white;
  box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.14);
}

.gate-input.shake {
  animation: shake 0.52s var(--ease-smooth);
  border-color: var(--red);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-10px); }
  30%       { transform: translateX( 10px); }
  45%       { transform: translateX(-7px);  }
  60%       { transform: translateX( 7px);  }
  75%       { transform: translateX(-4px);  }
  90%       { transform: translateX( 4px);  }
}

.gate-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 24px rgba(155, 93, 229, 0.38);
  transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s;
}

.gate-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 32px rgba(155, 93, 229, 0.5);
}

.gate-btn:active {
  transform: scale(0.96);
}

/* Gate error */
.gate-error {
  margin-top: 14px;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}


/* ══════════════════════════════════════════════════════════
   MAIN APP
══════════════════════════════════════════════════════════ */
.app {
  min-height: 100vh;
  position: relative;
}

.app.entering {
  animation: appReveal 0.5s var(--ease-out) both;
}

@keyframes appReveal {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}


/* ── STICKY TOP BLOCK ──────────────────────────────────── */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 24px var(--shadow-sm);
}


/* ── HEADER ────────────────────────────────────────────── */
.app-header {
  padding: 0 clamp(16px, 5vw, 36px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  color: var(--purple);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.app-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-chip {
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--purple-faint);
  color: var(--purple);
  transition: transform 0.2s;
}

.stat-chip.stat-done {
  background: var(--green-bg);
  color: var(--green);
}

.sync-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(155, 93, 229, 0.25);
  background: rgba(255,255,255,0.7);
  color: var(--purple);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, transform 0.25s, background 0.2s;
}

.sync-btn:hover {
  border-color: var(--purple);
  background: rgba(155, 93, 229, 0.08);
  transform: rotate(40deg) scale(1.08);
}

.sync-icon.spinning {
  animation: spin 0.75s linear infinite;
}

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


/* ── CONTROLS BAR ──────────────────────────────────────── */
.controls-bar {
  padding: 10px clamp(16px, 5vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.55);
  border-radius: 14px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.9);
}

.tab {
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease-bounce), color 0.2s, transform 0.2s var(--ease-bounce), box-shadow 0.2s;
}

.tab:not(.active):hover {
  color: var(--purple);
  background: rgba(155, 93, 229, 0.09);
}

.tab.active {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  box-shadow: 0 3px 14px rgba(155, 93, 229, 0.38);
  transform: scale(1.04);
}

/* Sort select */
.sort-select {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(155, 93, 229, 0.22);
  background: rgba(255,255,255,0.82);
  font-family: 'Nunito', sans-serif;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.13);
}


/* ══════════════════════════════════════════════════════════
   PLANS AREA
══════════════════════════════════════════════════════════ */
.plans-area {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) clamp(16px, 5vw, 36px) 100px;
}

/* ── Loading state ── */
.loading-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.loader {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(155, 93, 229, 0.16);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  animation: fadeSlideIn 0.4s ease;
}

.empty-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 18px;
  animation: bobFloat 3s ease-in-out infinite;
}

.empty-state h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.65rem;
  color: var(--purple);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

/* ── Plans grid ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}


/* ══════════════════════════════════════════════════════════
   PLAN CARD
══════════════════════════════════════════════════════════ */
.plan-card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow-sm);
  transition:
    transform  0.25s var(--ease-bounce),
    box-shadow 0.25s,
    background 0.35s;
  animation: cardIn 0.4s var(--ease-bounce) both;
  will-change: transform;
}

.plan-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px var(--shadow-md);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(0.91); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Coloured top accent based on heart rating */
.plan-card::before {
  content: '';
  display: block;
  height: 5px;
}
.plan-card[data-hearts="1"]::before { background: linear-gradient(90deg, #C4A8FF, #A78BFA); }
.plan-card[data-hearts="2"]::before { background: linear-gradient(90deg, #FFB3D9, #F472B6); }
.plan-card[data-hearts="3"]::before { background: linear-gradient(90deg, #FFC9A0, #FB923C); }
.plan-card[data-hearts="4"]::before { background: linear-gradient(90deg, #FFB0C0, #F43F5E); }
.plan-card[data-hearts="5"]::before { background: linear-gradient(90deg, var(--pink), #C11574); }

/* Done state */
.plan-card.done {
  background: rgba(232, 252, 245, 0.85);
  border-color: rgba(6, 214, 160, 0.28);
}
.plan-card.done::before {
  background: linear-gradient(90deg, #6EE7C7, #06D6A0);
}

/* Shake on delete confirm */
.plan-card.shaking {
  animation: cardShake 0.5s var(--ease-smooth);
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0)   rotate(0deg);    }
  20%       { transform: translateX(-8px) rotate(-1.2deg); }
  40%       { transform: translateX( 8px) rotate( 1.2deg); }
  60%       { transform: translateX(-5px) rotate(-0.6deg); }
  80%       { transform: translateX( 5px) rotate( 0.6deg); }
}

/* Delete exit animation */
.plan-card.deleting {
  animation: cardOut 0.38s var(--ease-smooth) forwards;
  pointer-events: none;
}

@keyframes cardOut {
  0%   { opacity: 1; transform: scale(1)    rotate(0deg);  }
  60%  { opacity: 0.4; transform: scale(0.85) rotate(2deg); }
  100% { opacity: 0; transform: scale(0.65) rotate(4deg);  }
}

/* Card layout */
.card-body {
  padding: 16px 18px 12px;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-word;
  transition: color 0.25s, text-decoration 0.25s;
}

.plan-card.done .card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.card-desc {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 6px;
  word-break: break-word;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-hearts {
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  line-height: 1;
}

.card-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
}

.plan-card.done .card-date {
  color: var(--green);
}

/* Card action buttons */
.card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.card-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  transition: all 0.2s var(--ease-bounce);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.card-btn:hover   { transform: scale(1.18); }
.card-btn:active  { transform: scale(0.92); }

/* Done button */
.card-btn-done {
  color: var(--green);
  border-color: rgba(6, 214, 160, 0.28);
}
.card-btn-done:hover {
  background: var(--green-bg);
  border-color: rgba(6, 214, 160, 0.5);
}

/* Edit button */
.card-btn-edit {
  color: var(--purple);
  border-color: rgba(155, 93, 229, 0.2);
}
.card-btn-edit:hover {
  background: var(--purple-faint);
  border-color: rgba(155, 93, 229, 0.4);
}

/* Delete button */
.card-btn-delete {
  color: var(--text-muted);
}
.card-btn-delete:hover {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(255, 71, 87, 0.3);
}

/* Confirm state (second click to delete) */
.card-btn-delete.confirm {
  color: white;
  background: var(--red);
  border-color: var(--red);
  animation: confirmPop 0.3s var(--ease-bounce);
}

@keyframes confirmPop {
  0%   { transform: scale(1); box-shadow: 0 0 0 0   rgba(255,71,87,0.5); }
  50%  { transform: scale(1.2);                                           }
  100% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255,71,87,0);   }
}


/* ══════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON
══════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 60;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  cursor: pointer;
  box-shadow: 0 6px 26px rgba(155, 93, 229, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s;
  animation: fabIdle 3.5s ease-in-out infinite;
}

.fab:hover {
  transform: scale(1.13) rotate(90deg);
  box-shadow: 0 12px 36px rgba(155, 93, 229, 0.58);
  animation: none;
}

.fab:active {
  transform: scale(0.93);
}

.fab-plus {
  font-size: 2rem;
  line-height: 1;
  font-weight: 300;
  transition: transform 0.25s;
}

@keyframes fabIdle {
  0%, 100% { box-shadow: 0 6px 26px rgba(155,93,229,0.48); }
  50%       { box-shadow: 0 6px 36px rgba(155,93,229,0.68), 0 0 0 10px rgba(155,93,229,0.09); }
}


/* ══════════════════════════════════════════════════════════
   MODAL (BOTTOM SHEET ON MOBILE)
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 20, 50, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.28s ease;
}

.modal-overlay.closing {
  animation: overlayOut 0.28s ease forwards;
}

@keyframes overlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: white;
  border-radius: 28px 28px 0 0;
  padding: 12px 24px 44px;
  max-height: 93vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: modalUp 0.38s var(--ease-bounce);
}

.modal-overlay.closing .modal {
  animation: modalDown 0.28s var(--ease-smooth) forwards;
}

@keyframes modalUp   { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes modalDown { from { transform: translateY(0);    } to { transform: translateY(100%); } }

/* Drag handle */
.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
  margin: 0 auto 22px;
}

/* Close button */
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.modal-close:hover {
  background: rgba(0,0,0,0.11);
  transform: rotate(90deg);
}

/* Modal heading */
.modal-heading {
  font-family: 'Fredoka One', cursive;
  font-size: 1.65rem;
  color: var(--purple);
  margin-bottom: 26px;
}


/* ══════════════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════════════ */
.form-group {
  position: relative;
  margin-bottom: 26px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 9px;
  letter-spacing: 0.2px;
}

.optional {
  font-weight: 500;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid rgba(155, 93, 229, 0.2);
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(248, 245, 255, 0.7);
  outline: none;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--purple);
  background: white;
  box-shadow: 0 0 0 3.5px rgba(155, 93, 229, 0.13);
}

.char-count {
  position: absolute;
  bottom: -18px;
  right: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
}


/* ══════════════════════════════════════════════════════════
   HEART SELECTOR
══════════════════════════════════════════════════════════ */
.heart-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
}

.heart-opt {
  font-size: 1.85rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  border-radius: 8px;
  transition: transform 0.15s var(--ease-bounce), filter 0.15s;
}

.heart-opt:hover {
  transform: scale(1.24) rotate(-8deg);
}

.heart-opt:active {
  transform: scale(0.88);
}

.heart-opt.popping {
  animation: heartPop 0.35s var(--ease-bounce);
}

@keyframes heartPop {
  0%   { transform: scale(1);    }
  45%  { transform: scale(1.55) rotate(-12deg); }
  100% { transform: scale(1);    }
}

.heart-label {
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pink);
  min-height: 22px;
  transition: all 0.22s var(--ease-smooth);
  animation: fadeSlideIn 0.25s ease;
}


/* ══════════════════════════════════════════════════════════
   MODAL SUBMIT BUTTON
══════════════════════════════════════════════════════════ */
.modal-submit {
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--pink) 100%);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 5px 22px rgba(155, 93, 229, 0.38);
  transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s, opacity 0.22s;
  margin-top: 6px;
}

.modal-submit:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 30px rgba(155, 93, 229, 0.5);
}

.modal-submit:active:not(:disabled) {
  transform: scale(0.97);
}

.modal-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}


/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */
.toast-wrap {
  position: fixed;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 48px);
}

.toast {
  background: rgba(30, 20, 50, 0.88);
  color: white;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  white-space: nowrap;
  animation: toastIn 0.3s var(--ease-bounce);
}

.toast.success { background: rgba(6, 214, 160, 0.92); }
.toast.error   { background: rgba(255, 71, 87, 0.92); }
.toast.hiding  { animation: toastOut 0.28s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(12px) scale(0.88); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: scale(1);  } to { opacity: 0; transform: scale(0.88); } }


/* ══════════════════════════════════════════════════════════
   CONFETTI
══════════════════════════════════════════════════════════ */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 600;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  will-change: transform;
}

@keyframes confettiFall {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
  85%  {                                               opacity: 1; }
  100% { transform: translateY(105vh) rotate(740deg); opacity: 0; }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════════════════ */

/* ── Tablet & up: centre modal as popup ── */
@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }

  .modal {
    border-radius: 28px;
    max-height: 88vh;
  }

  .modal-handle { display: none; }

  @keyframes modalUp {
    from { opacity: 0; transform: scale(0.88) translateY(18px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
  }
  @keyframes modalDown {
    from { opacity: 1; transform: scale(1);    }
    to   { opacity: 0; transform: scale(0.88); }
  }
}

/* ── Desktop ── */
@media (min-width: 800px) {
  .plans-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* ── Small mobile tweaks ── */
@media (max-width: 380px) {
  .tab          { padding: 6px 10px; font-size: 0.78rem; }
  .heart-opt    { font-size: 1.55rem; }
  .gate-card    { padding: 36px 24px 32px; }
  .modal        { padding: 12px 18px 36px; }
  .modal-heading { font-size: 1.45rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
