/* ------------------------------------------------------------------ colors */
:root {
  color-scheme: light;

  /* palette */
  --color-primary: #A1B3A1;    /* header bar and card edges; too light for text */
  --color-secondary: #3B413B;  /* footer and headings */
  --color-background: #FAF6ED;
  --color-surface: #EDF1ED;    /* cards */
  --color-accent: #BC9360;     /* buttons and highlights; too light for text on the light background */
  --color-text: #29352D;

  /* uses of the palette, plus shades of it where text or outlines need more contrast */
  --heading: var(--color-secondary);
  --link: #7A5A32;             /* darker accent */
  --muted: #566258;
  --line: #D3DCD3;
  --field-line: #6F816F;       /* darker primary */
  --field-bg: #FFFDF8;
  --tint: #F3E9DA;             /* pale accent */
  --check: var(--color-secondary);
  --action-hover: #C9A576;
  --action-edge: #8F6D40;
  --good: #3F6E4A;
  --bad: #9B4237;
  --info: #4A6272;
  --error-text: #8F2F25;

  --bg: var(--color-background);
  --card: var(--color-surface);
  --text: var(--color-text);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font: 16px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 0.75rem; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.25rem; }
p:last-child, ul:last-child { margin-bottom: 0; }
a { color: var(--link); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.lead { font-size: 1.15rem; }
.small { font-size: 0.875rem; color: var(--muted); }

/* ------------------------------------------------------------------ header and footer */
.site-header {
  background: var(--color-primary);
  color: var(--color-text);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.bar { width: min(100% - 2rem, 66rem); margin: 0 auto; }
.site-header .bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 0;
}
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; font-size: 1.17rem; font-weight: 700; }
nav form { margin: 0; }
.site-header a, .site-header button.link { color: var(--color-text); text-decoration: none; }
.site-header a:hover, .site-header button.link:hover { text-decoration: underline; }
.site-header :focus-visible { outline-color: var(--color-text); }
.site-footer :focus-visible { outline-color: var(--color-background); }
.site-footer { margin-top: auto; padding: 1.5rem 0; background: var(--color-secondary); color: var(--color-background); font-size: 0.875rem; }
.site-footer a { color: var(--color-background); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ page widths */
main { width: min(100% - 2rem, var(--width)); margin: 2.5rem auto 3rem; }
main.wide { --width: 66rem; }
main.medium { --width: 40rem; }
main.narrow { --width: 28rem; }
main.narrow .panel { padding: 1.75rem 1.5rem; }
main.narrow .panel h1 { font-size: 1.5rem; }
main.narrow .panel > .small { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ cards */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--color-primary);
  border-radius: 6px;
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card-head h2 { margin: 0; }
.pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--field-line);
  color: var(--muted);
}
.pill.on { background: var(--good); border-color: var(--good); color: var(--color-background); }
.pill.off { background: var(--bad); border-color: var(--bad); color: var(--color-background); }

/* ------------------------------------------------------------------ buttons */
.button, button {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  padding: 0.6rem 1.4rem;
  background: var(--color-accent);
  color: var(--color-text);
  text-align: center;
  text-decoration: none;
  border: 0;
  border-bottom: 3px solid var(--action-edge);
  border-radius: 5px;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--action-hover); }
button.secondary {
  background: transparent;
  color: var(--link);
  border: 1px solid var(--link);
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}
button.secondary:hover { background: var(--tint); }
button.link, button.link:hover {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
button.link { color: var(--link); text-decoration: underline; }

/* ------------------------------------------------------------------ forms */
label { font-weight: 700; }
input[type="email"], input[type="password"], input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--field-line);
  border-radius: 5px;
  background: var(--field-bg);
  color: var(--text);
}
input:focus-visible { outline: 3px solid var(--link); outline-offset: 0; }
input[type="radio"], input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; accent-color: var(--check); }
fieldset { border: 0; padding: 0; margin: 0 0 0.75rem; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 0.5rem; }
.choices label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  padding: 0.55rem 0.75rem;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}
.choices label:hover { border-color: var(--color-accent); }
.choices label:has(input:checked) { border-color: var(--color-accent); background: var(--tint); font-weight: 700; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.helptext { display: block; margin-top: 0.4rem; font-size: 0.875rem; color: var(--muted); }
/* Django's password rules are a list that the browser moves outside the surrounding paragraph and .helptext. */
form ul:not(.errorlist) { font-size: 0.875rem; color: var(--muted); }
.errorlist { color: var(--error-text); list-style: none; padding: 0; margin: 0 0 0.75rem; font-weight: 700; font-size: 0.9rem; }
.message {
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--color-accent);
  border-radius: 5px;
}
.message.success { border-left-color: var(--good); }
.message.error { border-color: var(--bad); border-left-color: var(--bad); color: var(--error-text); }

/* ------------------------------------------------------------------ home page */
.hero { display: grid; gap: 2.5rem; align-items: center; margin-bottom: 3.5rem; }
.hero > * { min-width: 0; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
@media (min-width: 56rem) {
  .hero { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
}
.section { margin-bottom: 3.5rem; }
.section-title {
  color: var(--heading);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
}
.hero .section-title { font-size: 1.17rem; text-align: left; margin-bottom: 0.75rem; }

.alert {
  --type: var(--info);
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--type);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin: 0 0 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow-wrap: anywhere;
}
.alert.appointment { --type: var(--good); }
.alert.exit { --type: var(--bad); }
.alert p { margin: 0.35rem 0 0; }
.alert p:first-child { margin-top: 0; }
.tag {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.05rem 0.45rem;
  background: var(--type);
  color: var(--color-background);
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.alert .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-size: 0.85rem; color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; list-style: none; padding: 0; }
.features li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.25rem; }
.features strong { display: block; margin-bottom: 0.3rem; }
.audience { max-width: 40rem; margin-left: auto; margin-right: auto; text-align: center; }

.pricing { max-width: 34rem; margin-left: auto; margin-right: auto; text-align: center; scroll-margin-top: 1rem; }
.pricing .panel { padding: 1.75rem 1.5rem; }
.pricing .button { display: block; margin-top: 0.5rem; }

/* the price choices, on the home and account pages: side by side, stacked when narrow */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin-bottom: 1rem; text-align: center; }
.plans:last-child { margin-bottom: 0; }
.plan .plan-button {
  display: block;
  width: 100%;
  padding: calc(1rem + 2px);   /* makes up for the thinner border, so both buttons are the same height */
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  background: var(--field-bg);
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--field-line);
  border-radius: 6px;
}
.plan a.plan-button:hover { background: var(--tint); }
.plan.best .plan-button { padding: 1rem; background: var(--color-accent); border: 3px solid var(--color-secondary); }
.plan.best a.plan-button:hover { background: var(--action-hover); }
.plan .plan-button:disabled { opacity: 0.65; cursor: default; }
.plan-label { margin: 0.4rem 0 0; font-weight: 700; color: var(--link); }

.limits { background: var(--tint); border-left: 5px solid var(--color-accent); border-radius: 6px; padding: 1.25rem 1.5rem; }
.limits li { margin-bottom: 0.5rem; }
