:root {
  --brand: #0f7a6c;
  --brand-dark: #0a4f46;
  --brand-tint: #e6f4f1;
  --ink: #14211f;
  --muted: #5b6b68;
  --line: #dce5e3;
  --bg: #f6f9f8;
  --card: #ffffff;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --warn-tint: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 31, .06), 0 4px 16px rgba(20, 33, 31, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; padding: .25rem 0; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--brand-dark); }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.nav-actions form { margin: 0; }
main.wrap { padding: 2rem 0 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 10px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--card); color: var(--brand-dark); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #f0c4c0; }
.btn-danger:hover { background: var(--danger-tint); }
.btn-dark { background: #111; color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* cards, grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.stat { font-size: 2rem; font-weight: 700; color: var(--brand-dark); line-height: 1; }

/* flash */
.flash { border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--card); }
.flash-success { background: var(--brand-tint); border-color: #b7e0d8; }
.flash-error { background: var(--danger-tint); border-color: #f0c4c0; color: var(--danger); }
.flash-info { background: #eef4ff; border-color: #cfdcf7; }
.plans-off { user-select: none; }
.plans-off .card { opacity: .55; filter: grayscale(1); border-color: var(--line, #d6dcd9) !important; }
.plans-off .btn { cursor: not-allowed; }
.notice { background: var(--warn-tint); border: 1px solid #f2dc9b; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.notice ul, .flash ul { margin: .25rem 0 0 1.2rem; padding: 0; }

/* forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; display: block; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], select, textarea, input[type=file] {
  width: 100%; padding: .55rem .7rem; border: 1px solid #c5d3d0; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid #c5d3d0; border-radius: 8px; background: #fff; }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: var(--card); }
legend { font-weight: 700; padding: 0 .4rem; }
.auth-card { max-width: 440px; margin: 2rem auto; }
.checkbox { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.checkbox input { width: auto; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fbfdfc; }
td.num, th.num { text-align: right; }

/* template editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.editor-preview { position: sticky; top: 80px; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .editor-preview { position: static; order: -1; } }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 0; }
.chip { border: 1px solid var(--line); background: var(--brand-tint); color: var(--brand-dark); border-radius: 999px; padding: .15rem .65rem; font-size: .85rem; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--brand); }
.chip-extra { border-style: dashed; background: transparent; }
.field-row { display: grid; grid-template-columns: 150px 1fr 1.4fr auto; gap: .5rem; margin-bottom: .5rem; align-items: center; }
@media (max-width: 700px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row select { grid-column: 1 / -1; } }
.color-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.color-row > div { display: flex; align-items: center; gap: .5rem; }
.color-row label { margin: 0; font-weight: 500; }
.current-art { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; font-size: .875rem; color: var(--muted); }
.current-art img { height: 36px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* pass preview (matches what the wallets draw, roughly) */
.pass { width: 100%; max-width: 340px; margin-inline: auto; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); color: #fff; background: #0f7a6c; font-size: 14px; line-height: 1.3; }
.pass-top { display: flex; align-items: center; gap: .6rem; padding: 14px 16px 6px; }
.pass-logo { height: 30px; max-width: 120px; object-fit: contain; }
.pass-org { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-header { display: flex; gap: 12px; text-align: right; }
.pass-strip { width: 100%; height: 100px; object-fit: cover; display: block; margin-top: 8px; }
.pass-primary { padding: 10px 16px 4px; }
.pass-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.pass-primary .pass-value { font-size: 28px; font-weight: 500; }
.pass-row { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 8px 16px; }
.pass-value { font-size: 16px; word-break: break-word; }
.pass-barcode { background: #fff; margin: 14px auto 18px; width: 190px; padding: 10px; border-radius: 8px; text-align: center; color: #111; }
.pass-barcode .bars { height: 130px; background: repeating-linear-gradient(90deg, #111 0 3px, #fff 3px 6px, #111 6px 7px, #fff 7px 11px); border-radius: 2px; }
.pass-barcode.is-qr .bars { background:
  conic-gradient(#111 25%, #fff 0 50%, #111 0 75%, #fff 0) 0 0 / 22px 22px; }
.pass-barcode.is-wide { width: 250px; }
.pass-barcode.is-wide .bars { height: 60px; }
.pass-barcode small { display: block; margin-top: 6px; font-size: 11px; word-break: break-all; }
.pass-back { margin-top: 1rem; }

/* hero (home) */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; padding: 1.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* public pass page */
body.public { background: #eef3f2; }
.public-wrap { width: min(420px, 100% - 2rem); margin: 0 auto; padding: 1.5rem 0 3rem; }
.public-wrap .btn { margin-top: .6rem; }
/* Add to Apple Wallet / Google Wallet badges: official artwork as supplied - keep the aspect ratio, at least 48px tall,
   8px+ clear space all round, no recolouring, borders, shadows or rounded corners added. */
.wallet-badge { display: block; width: max-content; max-width: 100%; margin: .75rem auto; padding: 0; line-height: 0; background: none; border: 0; }
.wallet-badge img { display: block; height: 56px; width: auto; }
@media (max-width: 360px) { .wallet-badge img { height: 48px; } }
.error-page { text-align: center; padding: 3rem 0; }
.error-page .code { font-size: 4rem; font-weight: 800; color: var(--brand); line-height: 1; }

[hidden] { display: none !important; }
