/* ==========================================================================
   Love Counter — tool.css
   Styles for the flagship Love Counter tool that lives on the homepage.
   Premium glass panel, live ticking counters, milestone timeline.
   ========================================================================== */

.tool-section {
  position: relative;
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}

/* The tool sits in a raised panel that overlaps the hero above it. */
.counter {
  position: relative;
  margin-top: -3.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.counter__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(135deg, var(--rose-soft), var(--white));
  border-bottom: 1px solid var(--border);
}

.counter__intro { grid-column: 1 / -1; text-align: center; margin-bottom: 0.5rem; }
.counter__intro h2 { font-size: var(--fs-h3); margin-bottom: 0.3rem; }
.counter__intro p { color: var(--text-muted); font-size: 0.95rem; margin-inline: auto; }

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field__label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--plum);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.field__label svg { width: 17px; height: 17px; color: var(--rose-deep); }
.field__control {
  display: flex;
  gap: 0.5rem;
}
.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(231, 71, 126, 0.18);
}
.field__hint { font-size: 0.8rem; color: var(--text-muted); }

.counter__names { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: end; }
.counter__heart-join {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--wine));
  color: var(--white);
  margin-bottom: 0.15rem;
}
.counter__heart-join svg { width: 22px; height: 22px; }

.counter__controls {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Results panel */
.counter__result {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.result-headline {
  text-align: center;
  margin-bottom: 1.75rem;
}
.result-headline__couple {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 2vw, 2.2rem);
  color: var(--plum);
  margin-bottom: 0.35rem;
}
.result-headline__couple .amp { color: var(--rose-deep); }
.result-headline__since { color: var(--text-muted); font-size: 0.95rem; }

/* Big live numbers */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.time-cell {
  text-align: center;
  padding: 1.1rem 0.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--plum), var(--wine));
  color: var(--white);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.time-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% -20%, rgba(231, 71, 126, 0.5), transparent 70%);
  pointer-events: none;
}
.time-cell__num {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1rem + 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.time-cell__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  position: relative;
}

/* Secondary live stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.stat {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--rose-soft);
  border: 1px solid var(--border);
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 0.82rem; color: var(--text-muted); }

/* Countdown to next anniversary */
.next-anniv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, var(--rose-mist), var(--rose-soft));
  border: 1px solid var(--border);
  margin-bottom: 1.75rem;
}
.next-anniv__label { font-weight: 600; color: var(--plum); display: flex; align-items: center; gap: 0.5rem; }
.next-anniv__label svg { width: 20px; height: 20px; color: var(--rose-deep); }
.next-anniv__value { font-family: var(--font-display); font-weight: 700; color: var(--rose-deep); font-size: 1.1rem; }

/* Result actions */
.counter__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
/* Equal widths so the pair reads as one balanced control, not two
   different-sized pills. */
.counter__actions .btn { min-width: min(13.5rem, 100%); }

.counter__note {
  max-width: 52ch;
  margin: 1rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Empty / prompt state */
.counter__empty {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem);
  color: var(--text-muted);
}
.counter__empty svg { width: 54px; height: 54px; color: var(--rose); margin-inline: auto; margin-bottom: 0.75rem; }
.counter__empty p { margin-inline: auto; }

/* Milestone timeline */
.milestones { margin-top: 2rem; }
.milestones h3 { text-align: center; font-size: var(--fs-h4); margin-bottom: 1.25rem; }
.milestone-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.milestone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.milestone.is-passed { background: var(--rose-soft); border-color: var(--rose); }
.milestone__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  background: var(--rose-mist);
  color: var(--rose-deep);
  font-weight: 700;
  font-size: 0.8rem;
}
.milestone.is-passed .milestone__mark { background: linear-gradient(135deg, var(--rose), var(--wine)); color: var(--white); }
.milestone__body strong { display: block; color: var(--plum); font-family: var(--font-display); }
.milestone__body span { font-size: 0.8rem; color: var(--text-muted); }

/* Floating hearts animation layer */
.hearts-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.floating-heart {
  position: absolute;
  bottom: -30px;
  color: var(--rose);
  opacity: 0;
  animation: floatUp linear forwards;
}
.floating-heart svg { width: 100%; height: 100%; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.6) rotate(0deg); }
  15% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-120px) scale(1) rotate(25deg); }
}
@media (prefers-reduced-motion: reduce) {
  .floating-heart { display: none; }
}

/* The keepsake sheet exists only for printing — see print.css. */
.print-sheet { display: none; }

/* Toast for copy feedback */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 12px);
  max-width: min(30rem, calc(100vw - 2rem));
  text-align: center;
  background: var(--plum);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  z-index: 200;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* On narrow screens a centred toast runs straight into the scroll-to-top
   button, so lift it clear of that button's corner. */
@media (max-width: 560px) {
  .toast { bottom: 5.25rem; }
}

@media (max-width: 768px) {
  .counter__top { grid-template-columns: 1fr; }
  .time-grid { grid-template-columns: repeat(2, 1fr); }
  .counter__names { grid-template-columns: 1fr; }
  .counter__heart-join { display: none; }
}
