/* Gift Certificates on Demand: site stylesheet.
   Plain CSS and system fonts only. Nothing is loaded from another host. */

/* Palette (design 7.4), drawn from the logo: navy, teal and coral on a mist page. */
:root {
  --navy: #103058;
  --teal: #58a8a8;
  --coral: #f05840;
  --ink: #1b2a3d;
  --muted: #5b6b7c;
  --line: #d3dbe2;
  --surface: #ffffff;
  --page: #eef4f4;
  --tint: #f5f9f9;
  --link: #1e7676;
  --primary: #e5503a;
  --danger: #b91c1c;
  --focus: #58a8a8;
  --success-bg: #ecfdf5;
  --success-ink: #065f46;
  --info-bg: #eff6ff;
  --info-ink: #1e40af;
  --warning-bg: #fffbeb;
  --warning-ink: #92400e;
  --error-bg: #fef2f2;
  --error-ink: #991b1b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--navy);
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
  color: var(--navy);
}

p {
  margin: 0 0 1rem;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- Header and navigation ------------------------------------------------ */

.site-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 3px solid var(--coral);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.625rem 1rem;
}

.nav a {
  color: #ffffff;
  text-decoration: none;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  margin-right: auto;
}

.brand-mark {
  width: 2.25rem;
  height: auto;
  flex-shrink: 0;
}

.brand-accent {
  color: #f6a08e;
  white-space: nowrap;
}

.nav-business {
  color: #cfe3e3;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-balance {
  padding: 0.125rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* --- Page ----------------------------------------------------------------- */

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.muted {
  color: var(--muted);
}

/* --- Messages ------------------------------------------------------------- */

.messages {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.messages li {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--info-ink);
  border-radius: 0.375rem;
  background: var(--info-bg);
  color: var(--info-ink);
}

.messages li.success {
  border-color: var(--success-ink);
  background: var(--success-bg);
  color: var(--success-ink);
}

.messages li.warning {
  border-color: var(--warning-ink);
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.messages li.error {
  border-color: var(--error-ink);
  background: var(--error-bg);
  color: var(--error-ink);
}

/* --- Forms ---------------------------------------------------------------- */

form p,
form > div {
  margin: 0 0 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--surface);
}

input[type="color"] {
  width: 4rem;
  height: 2.75rem;
  padding: 0.125rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--surface);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.375rem;
  vertical-align: middle;
}

.helptext {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.errorlist {
  list-style: none;
  margin: 0 0 0.375rem;
  padding: 0;
  color: var(--error-ink);
  font-weight: 600;
}

button,
.button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--primary);
  border-radius: 0.375rem;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  border-color: var(--navy);
  background: var(--surface);
  color: var(--navy);
}

.button-danger {
  border-color: var(--danger);
  background: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
}

/* --- Tables --------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin: 0 0 1.25rem;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- New certificate page ---------- */
.cert-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .cert-layout { grid-template-columns: minmax(0, 1fr); } }
.cert-form fieldset { border: 0; border-top: 1px solid #d8dde3; margin: 0 0 1rem; padding: 0.75rem 0 0; }
.cert-form legend { font-weight: 600; padding: 0 0.5rem 0 0; }
.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.85rem; color: #4b5563; margin-bottom: 0.2rem; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select { width: 100%; }
.field-check label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; color: inherit; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
.field-error input, .field-error select { border-color: #b91c1c; }
.field ul:not(.errorlist) { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.field ul:not(.errorlist) label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.95rem; color: inherit; margin: 0; }
.drafts { width: 100%; }
.drafts tr.current td { font-weight: 600; }
.cert-preview { position: sticky; top: 1rem; }
.preview-box { overflow: hidden; border: 1px solid #d8dde3; background: #f3f4f6; }
.preview-frame { display: block; border: 0; transform-origin: 0 0; width: 1056px; height: 816px; background: #fff; }
.tip { padding: 0.6rem 0.8rem; border-left: 4px solid var(--teal); background: var(--tint); }
.tip q { font-weight: 600; }
.preview-warning { margin: 0.75rem 0 0; padding: 0.6rem 0.8rem; border-left: 4px solid var(--coral); background: #fdf0ec; color: var(--ink); font-size: 0.95rem; }

/* ---------- Issue, confirmation and result ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.error { color: var(--error-ink); font-weight: 600; }
.notice { padding: 0.75rem 1rem; border: 1px solid var(--warning-ink); background: var(--warning-bg); color: var(--warning-ink); border-radius: 0.375rem; }
.confirm-card { max-width: 40rem; }
.pdf-frame { display: block; width: 100%; height: 70vh; border: 1px solid #d8dde3; background: #f3f4f6; }
.numbers { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 1.5rem; }
.numbers .number { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; }

/* ---------- Giving record and organizations ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: #4b5563; }
.filters input, .filters select { min-width: 9rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin: 0 0 0.5rem; }
.total { padding: 0.75rem; border: 1px solid #d3e2e2; border-radius: 0.375rem; background: var(--tint); }
.total dt { font-size: 0.85rem; color: var(--muted); }
.total dd { margin: 0; }
.total .count { font-size: 1.5rem; font-weight: 700; }
.total .note { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.tax-note { font-size: 0.85rem; color: var(--muted); line-height: 1.45; border-top: 1px solid #d8dde3; padding-top: 0.6rem; }
.record .number, .confirm-card .number { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; white-space: nowrap; }
.row-actions a { display: inline-block; margin: 0 0.6rem 0.25rem 0; white-space: nowrap; }
tr.state-void td { color: var(--muted); }
.field .label { display: block; font-size: 0.85rem; color: #4b5563; margin-bottom: 0.2rem; }

/* ---------- Legal pages and footer ---------- */
.site-footer { max-width: 60rem; margin: 2rem auto 1.5rem; padding: 0 1rem; font-size: 0.85rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.legal { max-width: 46rem; line-height: 1.55; }
.legal h2 { font-size: 1.05rem; margin-top: 1.5rem; }
.legal ul { padding-left: 1.25rem; }

/* ---------- Entrance pages: sign in, password reset, email confirmation (design 7.4) ---------- */
.entrance-body { background: var(--navy); }
.entrance { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.entrance-brand { display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: 3rem 2.5rem; background: var(--navy); color: #ffffff; }
.entrance-mark { width: 13.75rem; max-width: 60%; height: auto; }
.entrance-name { margin: 0.5rem 0 0; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.entrance-name a { color: inherit; text-decoration: none; }
.entrance-tagline { margin: 0; max-width: 24rem; font-size: 1.1rem; line-height: 1.5; color: #cfe3e3; }
.entrance-panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--page); }
.entrance-inner { width: 100%; max-width: 26rem; }
.entrance-card { padding: 1.75rem 1.75rem 1.5rem; box-shadow: 0 10px 30px rgba(16, 48, 88, 0.10); }
.entrance-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.entrance-card input[type="email"], .entrance-card input[type="password"], .entrance-card input[type="text"] { max-width: none; }
.entrance-card button[type="submit"] { width: 100%; }
.entrance-lead { color: var(--muted); margin-bottom: 1.25rem; }
.entrance-help { margin: 1rem 0 0; font-size: 0.9rem; }
.entrance-seal { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 0; font-size: 0.85rem; color: var(--muted); }
.entrance-seal img { width: 3.75rem; height: auto; flex-shrink: 0; }
.entrance .site-footer { margin: 1rem 0 0; padding: 0; }
@media (max-width: 760px) {
  .entrance { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .entrance-brand { padding: 2rem 1.5rem 1.75rem; gap: 0.6rem; }
  .entrance-mark { width: 7rem; }
  .entrance-name { font-size: 1.5rem; }
  .entrance-tagline { font-size: 1rem; }
  .entrance-panel { padding: 1.5rem 1rem 2rem; min-height: calc(100vh - 14rem); }
}
