/* css/components.css
   Reusable parts: header, buttons, forms, lists, the verify box, footer. */

/* ---------- Header ---------- */
.site-header { background: var(--bg); border-bottom: 3px solid var(--gold-500); margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 8px; flex-wrap: wrap; }
.logo img { height: 58px; width: auto; }
.site-nav ul { display: flex; align-items: center; gap: 4px 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; padding-block: 8px; border-bottom: 3px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"]:not(.btn) { border-bottom-color: var(--gold-500); color: var(--navy-700); }
.nav-toggle { display: none; font: 600 1rem var(--font-text); background: var(--navy-700); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 16px; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; padding-bottom: 12px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-block; font: 700 1rem/1 var(--font-text); padding: 14px 22px; border-radius: var(--radius); text-decoration: none; border: 2px solid transparent; cursor: pointer; text-align: center; }
.btn-small { padding: 10px 16px; }
.btn-gold { background: var(--gold-500); color: #1d1200; }
.btn-navy { background: var(--navy-700); color: #fff; }
.btn-light { border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.btn-gold:hover, .btn-navy:hover, .btn-light:hover { filter: brightness(1.1); color: inherit; }
.btn-navy:hover { color: #fff; }
.btn-light:hover { color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 600; }
.field input, .field select, .field textarea { font: 400 1rem var(--font-text); padding: 12px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); outline: none; box-shadow: 0 0 0 3px rgba(24, 80, 176, 0.25); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; } /* bot trap field */
.form-note { min-height: 1.5em; font-weight: 600; }
.form-note.ok { color: var(--ok); }
.form-note.bad { color: var(--bad); }

/* ---------- Lists ---------- */
.course-list { list-style: none; margin: 0; padding: 0; }
.course-list li { display: grid; grid-template-columns: minmax(0, 1fr) 9rem 9rem; gap: 4px 24px; padding-block: 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
.course-list li p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.course-list li > span { color: var(--muted); font-size: 0.95rem; }
.course-list a { font-weight: 700; }
@media (max-width: 640px) { .course-list li { grid-template-columns: minmax(0, 1fr); } }
.group { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.6fr); gap: 12px 48px; padding-block: 28px; border-top: 2px solid var(--navy-700); }
@media (max-width: 820px) { .group { grid-template-columns: minmax(0, 1fr); } }
.checks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { padding-inline-start: 28px; position: relative; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.45em; width: 14px; height: 8px; border-inline-start: 3px solid var(--gold-500); border-block-end: 3px solid var(--gold-500); transform: rotate(-45deg); }

/* ---------- The verify box (inspection-tag style) ---------- */
.tag { background: #fff; color: var(--ink); border-radius: 10px; box-shadow: var(--shadow); width: 100%; max-width: 460px; overflow: hidden; transform-origin: 50% 14px; }
.tag-head { background: var(--gold-500); color: #1d1200; padding: 14px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag-head strong { font-family: var(--font-display); font-size: 1.15rem; }
.tag-hole { width: 18px; height: 18px; border-radius: 50%; background: var(--navy-900); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45); flex: none; }
.tag-body { padding: 20px 22px 22px; }
.tag label { display: block; font-weight: 700; margin-bottom: 6px; }
.tag-row { display: flex; gap: 8px; }
.tag-row input { flex: 1; min-width: 0; font: 600 1rem ui-monospace, Menlo, Consolas, monospace; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius); text-transform: uppercase; }
.tag-help { font-size: 0.9rem; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 480px) { .tag-row { flex-direction: column; } .btn { width: 100%; } }
.swing { animation: swing 0.9s ease-out 1; }
@keyframes swing { 0% { transform: rotate(-2.4deg); } 30% { transform: rotate(1.6deg); } 60% { transform: rotate(-0.9deg); } 100% { transform: rotate(0); } }

/* ---------- Verify result ---------- */
.result { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; }
.status { display: inline-block; font-weight: 700; padding: 6px 14px; border-radius: 99px; }
.status.valid { background: var(--ok-bg); color: var(--ok); }
.status.expired { background: var(--warn-bg); color: var(--warn); }
.status.revoked, .status.notfound { background: var(--bad-bg); color: var(--bad); }
.record { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0 0; }
.record dt { color: var(--muted); }
.record dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #dbe5fb; margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-block: 48px 24px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 32px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-name { font-family: var(--font-display); font-size: 1.15rem; color: #fff; margin: 0 0 4px; }
.footer-ar { color: var(--gold-500); font-weight: 700; margin: 0 0 8px; }
.footer-head { font-weight: 700; color: #fff; margin: 0 0 10px; }
.site-footer .small { color: #b9c7e8; }
.site-footer address { font-style: normal; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid rgba(255, 255, 255, 0.2); margin-top: 32px; padding-top: 16px; font-size: 0.9rem; color: #b9c7e8; }

/* Small spacing helpers. They replace inline style="" attributes, which the site's security policy (CSP) blocks. */
.mt-0 { margin-top: 0; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-28 { margin-top: 28px; } .mt-32 { margin-top: 32px; } .mt-36 { margin-top: 36px; }
.mw-60 { max-width: 60ch; } .mw-70 { max-width: 70ch; }
