:root {
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-border: #ddd;
  --color-primary: #8558d9;
  --color-primary-hover: #6a46ae;
  --color-error-bg: #fde8e8;
  --color-error-text: #9b1c1c;
  --color-success-bg: #e6f4ea;
  --color-success-text: #1e6b3c;
  --color-info-bg: #eaf1fb;
  --color-info-text: #1e4e8c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: .5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.site-logo-icon {
  display: block;
  flex: none;
}

/* Matches the two-tone wordmark used on impactcollage.com: "Impact" in
   the near-black body text color, "Collage" in the brand purple. */
.site-logo-impact {
  color: var(--color-text);
}

.site-logo-collage {
  color: var(--color-primary);
}

.account-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.account-nav .org-name {
  font-weight: 600;
  color: var(--color-muted);
}

.account-nav a {
  color: var(--color-text);
  text-decoration: none;
}

.account-nav a:hover {
  text-decoration: underline;
}

/* Dashboard nav link styled as a button (2026-09-16, at the user's
   request) - needs its own color/hover overrides here since
   `.account-nav a` and `.account-nav a:hover` above are both more
   specific than the plain `.button`/`.button:hover` rules and would
   otherwise win (dark text, underline-on-hover) over the button look. */
.account-nav a.button {
  color: #fff;
}

.account-nav a.button:hover {
  color: #fff;
  text-decoration: none;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }

form {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.5rem;
}

label { font-weight: 600; font-size: .9rem; margin-top: .5rem; }

input {
  padding: .6rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}

/* Plain <select> elements (e.g. "Starting zoom" on update-collage.php,
   "Social platform" on add-donor-photos.php) had no rule of their own
   here at all - the "input" rule above only targets <input>, so a
   <select> fell back to the browser's bare-minimum default sizing,
   noticeably tighter/shorter than every text input next to it. Give it
   the same padding/border/font-size treatment for a consistent height
   and look. (The donor-photo-table's inline edit <select> further down
   this file already overrides this with its own smaller sizing, via a
   more specific selector, so it's unaffected.) */
select {
  padding: .6rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  background: #fff;
}

/* Radio/checkbox inputs shouldn't inherit the text-input sizing above
   (full width + padding) - that's what was pushing the "Starting
   position" radio buttons (update-collage.php) out of line with their
   label text. Reset them to their natural size and vertically center
   them against the text next to them instead. */
fieldset {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: .25rem 1rem 1rem;
  margin: .5rem 0 1rem;
}

fieldset legend {
  font-weight: 600;
  font-size: .9rem;
  padding: 0 .4rem;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 400;
  margin: .6rem 0 0;
}

fieldset input[type="radio"],
fieldset input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

button, .button {
  display: inline-block;
  padding: .7rem 1.1rem;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin-top: .5rem;
}

button:hover, .button:hover { background: var(--color-primary-hover); }

.button-disabled {
  background: #e2e2e2;
  color: var(--color-muted);
  cursor: not-allowed;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}

.photo-count {
  color: var(--color-muted);
  font-size: .95rem;
}

.collage-status {
  color: var(--color-muted);
  font-size: .95rem;
  margin-bottom: 1rem;
}

.coming-soon {
  color: var(--color-muted);
  font-size: .85rem;
  font-style: italic;
}

.alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .95rem;
}

.alert-error { background: var(--color-error-bg); color: var(--color-error-text); }
.alert-success { background: var(--color-success-bg); color: var(--color-success-text); }
.alert-info { background: var(--color-info-bg); color: var(--color-info-text); }

section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  main { padding: 1.5rem 1rem; }
}

/* Honeypot field (signup.php) - off-screen, never display:none, since
   some bots specifically skip fields hidden that way. Real visitors
   never see or tab into this. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* Admin approval interface (public/admin/*.php). */
main.admin-page {
  max-width: 960px;
}

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.admin-table th,
.admin-table td {
  padding: .6rem .6rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--color-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* admin/accounts.php: the nonprofit's website nested under its org name
   in the Organization column (2026-09-20, at the user's request), so it
   reads as secondary info rather than competing with the org name for
   attention. Deliberately no color override - keeps the browser's
   normal link color, same as the plain <a> already used for the
   Website column on admin/index.php's Pending Accounts table.
   white-space: normal overrides the parent <td>'s .nowrap, since a
   long website URL should wrap rather than force horizontal scroll. */
.org-website-link {
  font-size: .8rem;
  white-space: normal;
  margin-top: .2rem;
}

.row-flagged {
  background: #fff8e6;
}

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 4px;
  margin-left: .4rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-warning {
  background: #fdf0d5;
  color: #8a5a00;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

/* Added 2026-09-19 for admin/accounts.php's Actions column, once it
   started stacking two forms in one cell (Upgrade to Growth above
   Grant Lifetime Free) - .admin-actions above lays its children out in
   a row, which isn't what a single stacked cell wants, and plain
   sibling <form> elements have no margin between them (.inline-form
   sets margin: 0), so they were rendering flush against each other. */
.stacked-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin: 0;
}

.reject-form textarea {
  font-size: .8rem;
  padding: .35rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 200px;
  min-height: 2.4rem;
  font-family: inherit;
}

.button-small {
  padding: .4rem .7rem;
  font-size: .85rem;
  margin-top: 0;
}

.button-danger {
  background: #b3261e;
}

.button-danger:hover {
  background: #8f1e18;
}

.status-pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.status-approved {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.status-rejected {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

/* "Lifetime Free" subscription status (public/admin/accounts.php,
   added 2026-09-16) - the app's brand purple (--color-primary) rather
   than green/red/amber, since this isn't a pass/fail/warning state
   like the other status-pill variants, just a distinct account type
   worth visually calling out. */
.status-lifetime {
  background: #f0e9fb;
  color: #5a3d94;
}

/* Edit Collage Photos "Status" column (added 2026-09-16, at the user's
   request) - reuses the same amber tone as .badge-warning above, just
   shaped as a pill to sit alongside .status-approved/.status-rejected. */
.status-pending {
  background: #fdf0d5;
  color: #8a5a00;
}

/* Plan-tier pill (templates/header.php's account nav + admin/accounts.php's
   Plan column, added 2026-09-19 at the user's request to surface the
   current plan tier, highlighted, in the header). Free is a plain neutral
   pill - nothing to call out about being on it. Growth reuses the same
   amber as .status-pending above. Scale reuses the same brand-purple as
   .status-lifetime above - a deliberate echo, since a Lifetime Free grant
   (admin/accounts.php) always puts an account on plan_tier = 'scale' too,
   so purple already reads as "top tier" here. */
.status-plan-free {
  background: #ececec;
  color: var(--color-muted);
}

.status-plan-growth {
  background: #fdf0d5;
  color: #8a5a00;
}

.status-plan-scale {
  background: #f0e9fb;
  color: #5a3d94;
}

/* Add Donor Photos (public/add-donor-photos.php) - Cropper.js crop UI. */
button:disabled {
  background: #e2e2e2;
  color: var(--color-muted);
  cursor: not-allowed;
}

.crop-container {
  max-width: 100%;
  max-height: 400px;
  overflow: hidden;
  margin: .75rem 0;
  background: #000;
}

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

.crop-preview-wrap {
  margin: .75rem 0 1rem;
}

.crop-preview-wrap img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  display: block;
  margin-bottom: .5rem;
}

.field-hint {
  font-size: .8rem;
  color: var(--color-muted);
  margin: -.15rem 0 .75rem;
}

/* Edit Collage Photos (public/edit-collage-photos.php). */
main.edit-collage-page {
  max-width: 1100px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.inline-form-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
}

.inline-form-row label {
  margin: 0;
  white-space: nowrap;
}

.inline-form-row input {
  width: auto;
  min-width: 160px;
}

.donor-edit-table .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
}

/* Kept on one line rather than wrapping, at the user's request
   (2026-09-16) - .table-scroll already gives this table horizontal
   scroll for exactly this case, so a wide row here just scrolls
   instead of stacking awkwardly. */
.donor-edit-table .inline-form {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: .4rem;
}

/* Donor ID column on Edit Collage Photos (public/edit-collage-photos.php)
   - kept on one line rather than wrapping, at the user's request
   (2026-09-16). A small enough, reusable enough rule to be a plain
   utility class rather than something scoped to just this table. */
.nowrap {
  white-space: nowrap;
}

.donor-edit-table .inline-form input[type="text"],
.donor-edit-table .inline-form select {
  width: auto;
  min-width: 110px;
  padding: .4rem .5rem;
  font-size: .85rem;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 2rem;
}

.replace-photo-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

/* Highlights the exact slot a "jump to row/column" search landed on
   (public/edit-collage-photos.php). */
.row-highlighted {
  background: #fff4c2;
}

.row-highlighted:hover {
  background: #ffe98f;
}

/* Get Your Collage Code (public/get-collage-code.php). */
.embed-option h2 {
  margin-top: 0;
}

.embed-snippet {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.embed-snippet textarea {
  width: 100%;
  padding: .75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: .8rem;
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
}

.embed-snippet .copy-snippet-btn {
  align-self: flex-start;
  margin-top: 0;
}

/* "How to use this page" instructional blocks, shown near the bottom of
   each of the four dashboard feature pages (add-donor-photos.php,
   edit-collage-photos.php, update-collage.php, get-collage-code.php) so
   a non-technical nonprofit staffer never has to guess what an option
   does or leave the app to look it up. */
.page-help {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0 1.5rem;
}

.page-help h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.page-help p {
  font-size: .9rem;
  color: var(--color-muted);
  margin: 0 0 .75rem;
}

.page-help p:last-child {
  margin-bottom: 0;
}

.page-help ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.page-help li {
  font-size: .9rem;
  color: var(--color-muted);
  margin-bottom: .5rem;
}

.page-help li strong {
  color: var(--color-text);
}

/* Terms & Conditions and Privacy Policy (public/terms.php,
   public/privacy.php). margin set explicitly here (not just relying on
   the plain `main` rule above) so this block centers on the page
   regardless of cascade order - the title and "last updated" line are
   centered too, matching the common legal-page convention, while the
   body paragraphs below stay left-aligned for readability. */
main.legal-page {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

main.legal-page h1,
main.legal-page .legal-updated {
  text-align: center;
}

main.legal-page h2,
main.legal-page p,
main.legal-page ul {
  text-align: left;
}

main.legal-page h2 {
  font-size: 1rem;
}

.legal-updated {
  color: var(--color-muted);
  font-size: .85rem;
  margin-top: -.5rem;
}

/* Site-wide footer (templates/footer.php) - added alongside terms.php so
   the Terms & Conditions link is reachable from every page, signed-out
   (signup.php/login.php) and signed-in (dashboard.php and friends)
   alike, rather than needing a separate link added to each one. */
.site-footer {
  max-width: 640px;
  margin: 2rem auto 0;
  padding: 1rem 1.25rem 2rem;
  text-align: center;
  font-size: .85rem;
  color: var(--color-muted);
}

.site-footer a {
  color: var(--color-muted);
}
