@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Courier+Prime:wght@400;700&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #F1E9D4;
  --bg-deep: #D9C39C;
  --ink: #3B2E20;
  --ink-soft: #7A6B52;
  --card: #FBF8F1;
  --line: #E4DCC9;
  --sad: #7A5C6E;
  --sad-soft: #EFE4EA;
  --glad: #B1592E;
  --glad-soft: #F3DCC8;
  --good: #5F7A5A;
  --good-soft: #E6EBE1;
  --warn: #9C7A2E;
  --warn-soft: #EFE3C9;
  --font-display: 'Special Elite', 'Courier New', monospace;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'Courier Prime', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 84px;
}

/* ---------- Top bar ---------- */
.topbar {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
  position: sticky;
  top: 0;
  z-index: 20;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.wordmark .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--glad);
}
.wordmark .tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  font-style: italic;
}
.topbar h1 {
  font-family: var(--font-display);
  font-weight: normal;
  font-size: 21px;
  margin: 0;
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 4px;
  z-index: 30;
}
.bottomnav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 6px 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
}
.bottomnav button.active {
  color: var(--glad);
  font-weight: 700;
}
.bottomnav svg { width: 20px; height: 20px; }

/* ---------- Content ---------- */
.content { padding: 16px; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  background-image:
    radial-gradient(ellipse 40px 32px at 88% 15%, rgba(177,89,46,0.08), transparent 70%),
    radial-gradient(ellipse 26px 20px at 10% 92%, rgba(122,107,82,0.06), transparent 70%);
}
.card h3 {
  font-family: var(--font-display);
  font-weight: normal;
  font-size: 15px;
  margin: 0 0 2px;
}
.card .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.card .mono { font-family: var(--font-mono); }

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink-soft);
}
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.sad { background: var(--sad-soft); color: var(--sad); }
.pill.glad { background: var(--glad-soft); color: var(--glad); }

.btn-primary, .btn-secondary {
  width: 100%;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--ink); color: var(--card); }
.btn-primary:disabled { opacity: 0.55; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 11px 16px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: block;
}
input[type=text], input[type=number], input[type=email], input[type=password],
select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 14px;
  color: var(--ink);
}
textarea { resize: none; }

.tabrow { display: flex; gap: 6px; margin-bottom: 14px; }
.tabrow button {
  flex: 1;
  padding: 9px 4px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.tabrow button.active { background: var(--ink); color: var(--card); border-color: var(--ink); }

.photo-slot {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-deep);
  cursor: pointer;
  position: relative;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast {
  position: fixed;
  bottom: 78px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--card);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  white-space: nowrap;
  z-index: 50;
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); font-size: 13.5px; }

.fold-track { display: flex; gap: 6px; margin-bottom: 10px; }
.fold-step {
  flex: 1; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep); color: var(--ink-soft);
  font-weight: 700; font-size: 13px;
}
.fold-step.done { background: var(--good); color: #fff; }

.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.auth-screen .wordmark-lg {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--glad);
}
.auth-screen .tagline-lg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 24px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 320px;
  text-align: left;
}
.auth-switch { margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.auth-switch button { background: none; border: none; color: var(--glad); font-weight: 600; cursor: pointer; padding: 0; }

.loading-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 14px;
}
