:root {
  --purple: #604B78;
  --purple-dark: #4A3A60;
  --purple-tint: #EFEAF3;
  --sage: #B5C5AD;
  --sage-dark: #8FA386;
  --ivory: #F7F3ED;
  --ink: #2B2430;
  --text-secondary: #6B6270;
  --white: #FFFFFF;
  --border: #E4DCE9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); text-decoration: underline; }

h1, h2, h3 { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; line-height: 1.15; margin: 0; }

p { line-height: 1.6; }

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

.btn-primary {
  background: var(--purple);
  color: #fff;
  padding: 16px 32px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
}
.btn-primary:hover { background: var(--purple-dark); color: #fff; text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--purple);
  padding: 15px 31px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  border: 1.5px solid var(--purple);
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
}
.btn-secondary:hover { background: var(--purple-tint); color: var(--purple-dark); text-decoration: none; }

.btn-sage {
  background: var(--sage-dark);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
}
.btn-sage:hover { background: #7a8d72; color: #fff; text-decoration: none; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.pill {
  display: inline-block;
  background: var(--purple-tint);
  color: var(--purple-dark);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 700;
  color: var(--sage-dark);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 40px;
}

/*
 * Responsive card grids. Use alongside class="rgrid rgrid-N" (N = 2/3/4) in
 * place of an inline `grid-template-columns: repeat(N, minmax(0,1fr))` —
 * keep any inline `gap`/`margin-top` etc, just drop the inline grid-template-
 * columns/display declarations so these media queries can take over at
 * narrow widths. Without this, a fixed column count plus .card's padding
 * leaves almost no room per card on a phone and text clips.
 */
.rgrid { display: grid; }
.rgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rgrid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
  flex-wrap: wrap;
}
.logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}
.logo span { color: var(--purple); }
.nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 15px;
}
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--purple); text-decoration: none; }
.nav-links a.active { color: var(--purple); }

.site-footer {
  background: var(--ink);
  color: #D9D2DE;
  margin-top: 96px;
}
.site-footer .wrap { padding-block: 56px 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.site-footer a { color: #C9C0D1; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom {
  border-top: 1px solid #453A52;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #9D92A6;
}
.footer-bottom a { color: #9D92A6; }

/*
 * Two themes only: the multi-column grid above is the desktop theme, and this
 * is the mobile theme. It triggers two ways, deliberately not by viewport
 * width alone: (pointer: coarse) catches real touch devices (phones/tablets)
 * even if the browser reports a wider "desktop site" viewport, so a phone
 * never ends up with the desktop theme; the plain max-width clause is a
 * safety net for anyone resizing a desktop browser window down narrow, so a
 * mouse/trackpad user never gets stuck between a multi-column grid with no
 * room per card and a single-column mobile layout — it falls to mobile,
 * same as it would on an actual phone.
 */
@media (max-width: 540px), (pointer: coarse) and (max-width: 1024px) {
  .wrap { padding-inline: 16px; }
  .card { padding: 20px; }
  .footer-grid, .rgrid-2, .rgrid-3, .rgrid-4 { grid-template-columns: 1fr; }
}

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 15px; padding: 12px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: #fff; color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--purple); outline-offset: 1px; }
.field-hint { font-size: 13px; color: var(--text-secondary); }
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

.alert {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14.5px;
  margin-bottom: 20px;
}
.alert-error { background: #FBEAEA; color: #8A2E2E; border: 1px solid #EFC9C9; }
.alert-success { background: #EAF3EC; color: #2E5A3A; border: 1px solid #C9E4CE; }

.price-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.price-table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); padding: 10px 14px; border-bottom: 2px solid var(--border); }
.price-table td { padding: 14px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.price-table tr:last-child td { border-bottom: none; }

/* ---- Admin ---- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--ink); color: #fff; padding: 24px 0; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #C9C0D1; padding: 10px 24px; font-size: 14.5px; font-weight: 700; }
.admin-sidebar a:hover, .admin-sidebar a.active { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.admin-sidebar .logo { color: #fff; padding: 0 24px 20px; display: block; border-bottom: 1px solid #453A52; margin-bottom: 12px; }
.admin-main { flex: 1; padding: 36px 40px; background: var(--ivory); }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.admin-table th { text-align: left; background: var(--purple-tint); color: var(--purple-dark); font-size: 13px; text-transform: uppercase; padding: 12px 16px; }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14.5px; vertical-align: top; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge-pending { background: #FFF2D9; color: #8A5A00; }
.badge-approved { background: #EAF3EC; color: #2E5A3A; }
.badge-rejected { background: #FBEAEA; color: #8A2E2E; }
.badge-free { background: var(--purple-tint); color: var(--purple-dark); }
