*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0221;
  --bg2:      #180438;
  --gold:     #e8c94b;
  --rose:     #ff6b9d;
  --text:     #f0e6ff;
  --muted:    #9b89b0;
  --card:     rgba(255,255,255,0.06);
  --border:   rgba(255,255,255,0.10);
  --radius:   16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
  color: var(--text);
}

/* ── Login ── */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  width: min(400px, 90vw);
  text-align: center;
  backdrop-filter: blur(12px);
}

.login-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 2rem;
  font-style: italic;
}

/* ── Forms & inputs ── */

.input-group {
  margin-bottom: 1rem;
}

input[type="password"],
input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--gold);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}

/* ── Buttons ── */

.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  background: var(--gold);
  color: #0d0221;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  width: 100%;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.3); }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; width: auto; }

.link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.link-btn:hover { opacity: 0.75; }

.error-msg {
  color: var(--rose);
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

/* ── Overlays / Modals ── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.overlay[hidden] { display: none; }

.modal {
  background: #1e0845;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: min(460px, 90vw);
  animation: pop-in 0.2s ease;
}

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

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.modal p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.modal p strong { color: var(--text); }
.modal p em { color: var(--rose); font-style: italic; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-actions .btn-primary { flex: 1; }
.modal-actions .btn-ghost { flex: 1; }

/* ── Celebration ── */

.celebration {
  text-align: center;
  padding: 3rem 2rem;
  animation: pop-in 0.3s ease;
}

.celebration-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.celebration-sub {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-weight: 300;
}

.celebration .btn-primary {
  width: auto;
  margin-top: 2rem;
  font-size: 1rem;
  padding: 0.8rem 2rem;
}

/* ── App layout ── */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}

.app-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Hero / Countdown ── */

.hero {
  text-align: center;
  padding: 3.5rem 0 2.5rem;
}

.msg-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.daily-message {
  flex: 1;
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  min-height: 4em;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.msg-timer {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.35;
}

.msg-timer-track {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 2.5;
}

.msg-timer-ring {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 62.83;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 12px 12px;
  transition: stroke-dashoffset 1s linear;
}

.countdown-label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.75rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 7.5rem; /* fixed — prevents layout shift as digits change */
}

.countdown-number {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.02em;
}

.countdown-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 0.4rem;
}

.countdown-sep {
  font-size: clamp(2rem, 8vw, 4rem);
  color: var(--border);
  font-weight: 300;
  line-height: 1.05;
  align-self: flex-start;
  padding-top: 0.1em;
}

.target-date-display {
  color: var(--muted);
  font-size: 0.9rem;
}

.date-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
}

.date-form input[type="date"] {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

/* ── Milestones ── */

.milestones-section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 400;
}

.milestone-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.milestone-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: pop-in 0.2s ease;
}

.milestone-item.past {
  opacity: 0.55;
}

.milestone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.milestone-item.past .milestone-dot {
  background: var(--muted);
}

.milestone-info {
  flex: 1;
  min-width: 0;
}

.milestone-name {
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.milestone-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.icon-btn:hover { color: var(--text); }
.icon-btn.delete:hover { color: var(--rose); }

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Footer ── */

.app-footer {
  margin-top: 3rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.app-footer .link-btn {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-danger {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--rose);
  border: 1px solid var(--rose);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-danger:hover {
  background: var(--rose);
  color: #fff;
}

.btn-go-back {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.4);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-go-back:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.5);
}

/* ── Checkbox ── */

.checkbox-row {
  margin: 1.25rem 0 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--gold);
  border-color: var(--gold);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #0d0221;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.freedom-day-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin-top: 0.6rem;
  margin-left: 2.25rem;
  font-style: italic;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .app-header { padding: 1rem; }
  .hero { padding: 2rem 0 1.5rem; }
  .countdown-unit { width: 4.5rem; }
  .modal { padding: 1.75rem 1.25rem; }
  .modal-actions { flex-direction: column; }
}
