/* PITOWINGS certificate pages */
@font-face { font-family: 'Cinzel'; font-weight: 500; font-display: swap; src: url('fonts/cinzel-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-weight: 700; font-display: swap; src: url('fonts/cinzel-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-weight: 400; font-display: swap; src: url('fonts/great-vibes-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Great Vibes'; font-weight: 400; font-display: swap; src: url('fonts/great-vibes-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-display: swap; src: url('fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: swap; src: url('fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; font-display: swap; src: url('fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --plum: #8a2360; --plum-700: #5c1742; --plum-900: #33102a; --rose: #d6335e; --gold: #b8913f;
  --ink: #231a21; --muted: #6d6069; --line: #e9e0e6; --bg: #f8f4f7; --card: #ffffff;
  --ok: #1f7a4d; --ok-bg: #e9f6ef; --err: #b42335; --err-bg: #fdecee;
  --radius: 14px; --shadow: 0 1px 2px rgba(51,16,42,.06), 0 8px 28px rgba(51,16,42,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: 340px; background: linear-gradient(180deg, #f1e3ec 0%, rgba(248,244,247,0) 100%); z-index: -1; }
a { color: var(--plum); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header / footer */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; width: 100%; margin: 0 auto; padding: 18px 20px; }
.topbar img { height: 46px; width: auto; display: block; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--plum-900); }
.topbar .brand img { height: 46px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: Cinzel, 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 19px; letter-spacing: .06em; }
.brand small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
@media (max-width: 480px) { .topbar .brand img { height: 38px; } .brand strong { font-size: 16px; } .brand small { font-size: 9.5px; } }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 20px 48px; }
footer { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 16px 32px; }

/* hero */
.hero { text-align: center; margin: 12px auto 28px; max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--plum); background: #fff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.eyebrow svg { width: 14px; height: 14px; }
.hero h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: clamp(32px, 5vw, 46px); line-height: 1.1; margin: 16px 0 10px; color: var(--plum-900); }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.narrow { max-width: 560px; margin: 0 auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f3ecf1; padding: 4px; border-radius: 12px; margin-bottom: 22px; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; border-radius: 9px; font: 600 14px Inter, sans-serif; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--plum-700); box-shadow: 0 1px 3px rgba(51,16,42,.12); }
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 12.5px; color: var(--err); margin-top: 5px; }
input, select { width: 100%; font: 400 15px Inter, sans-serif; color: var(--ink); background: #fff; border: 1px solid #d9ccd5; border-radius: 10px; padding: 11px 13px; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(138,35,96,.15); }
input[disabled] { background: #f6f2f5; color: var(--muted); }
input.invalid, select.invalid { border-color: var(--err); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-dur { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 0; } .card { padding: 20px; } }

.captcha { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.captcha-img { display: flex; align-items: center; gap: 6px; }
.captcha-img img { width: 190px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fbf7fa; display: block; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--plum); }
.icon-btn:hover { border-color: var(--plum); }
.icon-btn svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .captcha { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 20px; min-height: 46px; font: 600 15px Inter, sans-serif; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { background: var(--plum-700); }
.btn-primary[disabled] { background: #b996ab; cursor: wait; }
.btn-ghost { background: #fff; color: var(--plum-700); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--plum); }
.btn-block { width: 100%; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.alert-err { background: var(--err-bg); color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: #f3ecf1; color: var(--plum-700); }

.trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 14px; height: 14px; color: var(--plum); }

/* results */
.results { margin-top: 32px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.results-head h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px; margin: 0; color: var(--plum-900); }
.cert-card { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 20px; }
.cert-card canvas, .preview canvas { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(51,16,42,.14); background: #fff; }
.meta dl { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; word-break: break-word; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); margin-bottom: 12px; }
.badge svg { width: 14px; height: 14px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; letter-spacing: .08em; }
@media (max-width: 820px) { .cert-card { grid-template-columns: 1fr; } }

/* admin */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--plum); margin: 6px 0 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px 8px; border: 1px solid #d9ccd5; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); background: #fff; }
.segmented span svg { width: 22px; height: 22px; }
.segmented input:checked + span { border-color: var(--plum); color: var(--plum-700); background: #fbf3f8; box-shadow: 0 0 0 3px rgba(138,35,96,.12); }
.segmented input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 2px; }
.preview { position: sticky; top: 16px; }
.preview .label { margin-bottom: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.toolbar h2 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px; color: var(--plum-900); }
.review dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 20px; font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; font-weight: 600; word-break: break-word; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.success-no { font-size: 34px; font-weight: 700; color: var(--plum-900); margin: 6px 0 18px; }
.issued-list { margin-top: 18px; font-size: 13.5px; }
.issued-list table { width: 100%; border-collapse: collapse; }
.issued-list th, .issued-list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.issued-list th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ---- owner tools ---- */
.admin-tabs { margin: 0; min-width: 340px; }
.admin-tabs .count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: #efe3ea; color: var(--plum-700); font-size: 12px; }
.admin-tabs .count:empty { display: none; }
@media (max-width: 560px) { .toolbar { flex-direction: column; align-items: stretch; } .admin-tabs { min-width: 0; } }
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.form-head h2 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 26px; color: var(--plum-900); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-warn { background: #fff; color: #9a5b00; border: 1px solid #ecd3a8; }
.btn-warn:hover { border-color: #9a5b00; }
.btn-danger { background: #fff; color: var(--err); border: 1px solid #f0c6cc; }
.btn-danger:hover { border-color: var(--err); }
.btn-danger-solid { background: var(--err); color: #fff; }
.btn-danger-solid:hover { background: #8f1b2a; }
.btn-danger-solid[disabled], .btn-primary[disabled] { opacity: .55; cursor: not-allowed; }

.list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.list-tools .field { margin: 0; }
.list-tools .grow { flex: 1 1 260px; }
.list-tools select { min-width: 150px; }
.list-summary { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 18px; }
.table-wrap { overflow-x: auto; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cert-table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cert-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cert-table tr.is-revoked td { background: #fdf7f8; }
.cert-table .strong { font-weight: 600; }
.cert-table .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.cert-table .mono { font-weight: 700; color: var(--plum-900); }
.actions-col { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-active { background: var(--ok-bg); color: var(--ok); }
.pill-revoked { background: var(--err-bg); color: var(--err); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
@media (max-width: 900px) {
  .cert-table thead { display: none; }
  .cert-table, .cert-table tbody, .cert-table tr, .cert-table td { display: block; width: 100%; }
  .cert-table tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 6px 4px; }
  .cert-table td { border: 0; padding: 6px 10px; }
  .cert-table td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .actions-col { white-space: normal; }
}

.modal { position: fixed; inset: 0; background: rgba(35, 16, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { background: #fff; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(35,16,42,.3); max-width: 480px; width: 100%; padding: 24px; }
.modal-card h3 { margin: 0 0 8px; font-size: 19px; color: var(--plum-900); }
.modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }

/* revoked notices on /verify */
.badge-revoked { background: var(--err-bg); color: var(--err); }
.revoked-note { background: var(--err-bg); color: var(--err); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
