/* ============================================================
   stillwithus — Shared Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:           #FAFAF8;
  --surface:      #FFFFFF;
  --sage:         #7C9A7E;
  --sage-mid:     #9CB69E;
  --sage-light:   #ECF2EC;
  --sage-dark:    #5A7A5C;
  --text:         #2A2A27;
  --text-muted:   #8A8A85;
  --text-light:   #B8B8B2;
  --border:       #E5E8E5;
  --border-light: #F0F2F0;
  --candle:       #C4773A;
  --candle-light: #FDF3EB;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow:       0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.10);
  --radius-sm:    8px;
  --radius:       16px;
  --radius-lg:    24px;
  --radius-xl:    32px;
  --transition:   all 0.2s ease;
  --font-serif:   'Lora', Georgia, serif;
  --font-sans:    'Inter', system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* ── Typography ───────────────────────────────────────────── */
.font-serif   { font-family: var(--font-serif); }
.font-sans    { font-family: var(--font-sans); }

h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.25;
  font-weight: 500;
  color: var(--text);
}

h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
h3 { font-size: 1.125rem; }

p {
  color: var(--text-muted);
  line-height: 1.7;
}

.text-muted   { color: var(--text-muted); }
.text-light   { color: var(--text-light); }
.text-sage    { color: var(--sage); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.text-center  { text-align: center; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 640px;
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack--sm  { gap: 8px; }
.stack--md  { gap: 16px; }
.stack--lg  { gap: 24px; }
.stack--xl  { gap: 40px; }

.row {
  display: flex;
  align-items: center;
}

.row--between { justify-content: space-between; }
.row--center  { justify-content: center; }
.row--gap-sm  { gap: 8px; }
.row--gap-md  { gap: 12px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  padding: 16px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--sage);
  color: #fff;
}
.btn--primary:hover  { background: var(--sage-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover { border-color: var(--sage); color: var(--sage); }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 12px 20px;
}
.btn--ghost:hover { color: var(--text); }

.btn--candle {
  background: var(--candle-light);
  color: var(--candle);
  border: 1.5px solid rgba(196, 119, 58, 0.25);
}
.btn--candle:hover { background: #fde8d5; }

.btn--full { width: 100%; }

.btn--sm {
  font-size: 0.875rem;
  padding: 10px 20px;
}

.btn--lg {
  font-size: 1.0625rem;
  padding: 18px 36px;
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.15s ease;
  outline: none;
  width: 100%;
}

.form-input::placeholder { color: var(--text-light); }
.form-input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(124, 154, 126, 0.12); }

.form-input--lg {
  font-size: 1.375rem;
  font-family: var(--font-serif);
  padding: 18px 20px;
  border-radius: var(--radius);
  text-align: center;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card--bordered {
  border-color: var(--border);
}

/* ── Navigation / App Bar ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  position: sticky;
  top: 0;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span {
  color: var(--sage);
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--sage);
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ── Photo Card ───────────────────────────────────────────── */
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.02) saturate(0.9) sepia(0.08);
}

.photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(30,25,20,0.4) 100%);
  pointer-events: none;
}

/* ── Candle ───────────────────────────────────────────────── */
.candle-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.candle-icon:active { transform: scale(0.92); }

.candle-flame {
  width: 10px;
  height: 14px;
  background: radial-gradient(ellipse at 50% 70%, #f5c842 0%, #f0882a 60%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  margin-bottom: -1px;
  animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 1; }
  30%       { transform: scaleY(0.92) scaleX(1.06); opacity: 0.96; }
  60%       { transform: scaleY(1.04) scaleX(0.96); opacity: 1; }
}

.candle-body {
  width: 14px;
  height: 28px;
  background: linear-gradient(to bottom, #f9f5ee, #ede8dc);
  border-radius: 3px 3px 2px 2px;
}

/* ── Utility ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-light);
  border: none;
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--sage-light);
  color: var(--sage-dark);
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.pill--sage { background: var(--sage-light); color: var(--sage-dark); }
.pill--warm { background: var(--candle-light); color: var(--candle); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fadeup  { animation: fadeUp 0.45s ease both; }
.animate-fadein  { animation: fadeIn 0.3s ease both; }
.animate-scalein { animation: scaleIn 0.35s ease both; }

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .container { padding: 0 32px; }
  h1 { font-size: 2.5rem; }
}
