/* Shared design tokens and base styles for every app/*.html page.
   Values from DESIGN.md, pulled from the live site's own CSS. */
:root {
  --purple: #2E1B47;
  --purple-2: #3A2558;
  --gold: #C9A84C;
  --cream: #FAF6F0;
  --cream-dim: #D9CFC0;
  --ink: #241537;
}

* { box-sizing: border-box; }

html {
  /* This page has its own deliberate purple/cream theme, not the system
     one -- without this, some browsers apply a dark-mode tint to form
     controls (autofill included) that fights the actual design. */
  color-scheme: light;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--purple);
  color: var(--cream);
  font-family: Lora, Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

a { color: var(--gold); }

.screen {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 40px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .02em;
}
.wordmark b { color: var(--gold); }
.wordmark .sm { font-size: 1em; }

h1, h2 {
  font-family: Cinzel, serif;
  margin: 0;
}
h1 { font-weight: 700; font-size: 28px; color: var(--gold); line-height: 1.2; }
h2 { font-weight: 600; font-size: 22px; color: var(--cream); }

p { margin: 0; line-height: 1.6; }

input, textarea, button { font-family: Inter, sans-serif; }

input[type=email], input[type=password], input[type=text], textarea {
  width: 100%;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid var(--cream-dim);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  font-family: Inter, sans-serif;
}
input:focus, textarea:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* Overrides the browser's own autofill background (often a dark or
   yellow tint) so a filled/suggested field stays the same cream as
   every other input, instead of announcing itself with a different
   color the moment autofill kicks in. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--cream) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

button {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 22px;
  border-radius: 6px;
  border: 0;
}
button.primary { background: var(--gold); color: var(--purple); }
button.primary:disabled { background: var(--cream-dim); opacity: .6; cursor: default; }
button.secondary { background: transparent; color: var(--cream); border: 1px solid var(--cream-dim); }

.card {
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 18px;
  background: var(--purple-2);
}

.notice {
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 16px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cream-dim);
}
.notice.strong { background: rgba(201,168,76,.08); }
.notice .label {
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 6px;
  display: block;
}

.error-text {
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: #E6A2A2;
}

.step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.step-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(217,207,192,.3);
}
.step-dots .dot.active { background: var(--gold); }

.step-label {
  font-family: Cinzel, serif;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .05em;
}

.opt {
  cursor: pointer;
  border: 1px solid var(--cream-dim);
  border-radius: 8px;
  padding: 16px;
  font-family: Inter, sans-serif;
  font-weight: 500;
}
.opt:hover { border-color: var(--gold); }
.opt.selected { border-color: var(--gold); }

.button-row { display: flex; gap: 12px; margin-top: 24px; }
.button-row button.secondary { flex: 1; }
.button-row button.primary { flex: 2; }

.chk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--cream-dim);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-size: 14px;
}
.chk-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.chk-box.checked { background: var(--gold); }

/* Persistent bottom nav for the app's main "hub" screens (Home, My
   Protocol). Drill-in screens reached from a card (like a single
   recipe) use a plain "< Home" link instead, not this bar. */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  background: var(--purple);
  border-top: 1px solid rgba(217,207,192,.15);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--cream-dim);
  font-family: Inter, sans-serif;
  font-size: 11px;
}
.nav-item.active { color: var(--gold); }
.nav-item svg { display: block; }
.screen-with-nav { padding-bottom: 84px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: var(--cream);
}
.chip button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row input { flex: 1; }
.add-row button { padding: 0 18px; font-size: 14px; }
