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

html {
  /* Fills status bar + bottom nav bar safe areas with the warm background tint */
  background-color: #fff1f2;
}

:root {
  --primary: #e11d48;
  --primary-alt: #ec4899;
  --primary-light: #fce7ed;
  --primary-dark: #be123c;
  --text-primary: #1c1917;
  --text-secondary: #78716c;
  --surface: #ffffff;
  --bg: #fafaf9;
  --bg-home: linear-gradient(160deg, #fff1f2 0%, #fff7ed 50%, #fdf2f8 100%);
  --border: #e7e5e4;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-home);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

/* ── Header ── */
header {
  padding: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ── Progress bar ── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label span:first-child {
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-label strong {
  font-size: 13px;
  color: var(--primary);
}

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* ── Main content ── */
main {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  padding-top: 5px;
}

.instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: item;
}

.instructions-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}

.instructions-list li::before {
  content: counter(item);
  counter-increment: item;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

/* ── Footer navigation ── */
footer {
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button:disabled:active {
  transform: none;
}

.btn-prev {
  flex: 1;
  background: var(--bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-next {
  flex: 2;
  background: var(--primary);
  color: white;
}

.btn-next:not(:disabled):hover {
  background: var(--primary-dark);
}

.btn-reset {
  width: 100%;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
}

/* ── Completion screen ── */
.completion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.completion-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.completion-title {
  font-size: 22px;
  font-weight: 700;
}

.completion-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Install banner ── */
.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-alt);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.install-banner:active {
  background: #fecdd3;
}

.install-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
}

.install-banner-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.install-banner-text span {
  font-size: 12px;
  color: var(--primary);
}

.install-banner-dismiss {
  font-size: 18px;
  color: var(--primary-alt);
  padding: 4px;
  flex-shrink: 0;
}

/* ── Install instructions modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  line-height: 1.4;
}

.modal-step-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.btn-modal-close {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

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

/* ── Transitions ── */
.step-card, .completion-card {
  animation: fadeSlideIn 0.25s ease both;
}

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

/* ── Home header ── */
.home-header {
  text-align: center;
  padding: 20px 0 8px;
}

.home-title {
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--primary), var(--primary-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.title-line-top {
  display: block;
  white-space: nowrap;
  font-size: clamp(40px, calc(14.8vw - 5.9px), 137px);
  color: var(--primary);
}

.home-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Home footer message ── */
.home-footer-msg {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius);
  padding: 14px 16px;
  line-height: 1.5;
}

/* ── Home view ── */
body.home {
  max-width: 960px;
}

body.home header {
  background: transparent;
}


/* ── Section home grid ── */
.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 600px) {
  .section-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.section-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  cursor: pointer;
}

.section-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
}

.section-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: overlay;
}

.section-card-title {
  font-size: 22px;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 1;
}

/* Bottom gradient scrim — darkens the area behind the title */
.section-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
  pointer-events: none;
}

.section-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.section-card-cta {
  color: var(--primary);
  font-weight: 600;
}

/* ── WIP card ── */
.wip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.wip-title {
  font-size: 22px;
  font-weight: 700;
}

.wip-sub {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Back button ── */
.btn-back {
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
}

/* ── Version tag ── */
#app-version {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.5;
  padding-top: 8px;
}

/* ── Typography ── */
.home-title,
.section-card-title,
.step-title,
.completion-title,
.wip-title,
.modal-title {
  font-family: 'Nunito', sans-serif;
}

/* ── "Dating" word ── */
.title-word-dating {
  display: block;
  font-family: 'Gorditas', cursive;
  font-size: clamp(80px, calc(29.1vw - 13.7px), 265px);
  margin-top: -0.55em;
  margin-bottom: -0.15em;
  padding: 0.4em 0 0.28em;
  background: linear-gradient(90deg, #e11d48, #e11dad, #e11d48);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow-shift 5s linear infinite;
}

@keyframes rainbow-shift {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}
