/* certificates.css - the app's certificate screens for the kiosk (same layout, wording and behaviour).
   Uses the kiosk's design tokens (kiosk.css): --gradient-brand, --cyan, --cyan-deep, --secondary, --ink*, --paper,
   --etch*, --radius*, --display, --mono, --t-*. */

.cz { width: 100%; min-width: 0; padding-bottom: 120px; }        /* full width of the kiosk page (it is a grid item) */

/* ---------------------------------------------------------------- hub: hero */
.cz-hero {
    position: relative; overflow: hidden;
    background: var(--gradient-brand); color: #fff;
    border-radius: var(--radius-lg); padding: clamp(22px, 2.6vw, 40px);
    box-shadow: 0 18px 40px rgba(10, 26, 38, .16);
}
.cz-hero::after {               /* lab-glass rings, like the app's hero */
    content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.16); box-shadow: 0 0 0 46px rgba(255,255,255,.05), 0 0 0 92px rgba(255,255,255,.04);
    pointer-events: none;
}
.cz-eyebrow { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.cz-hero__title { font-family: var(--display); font-size: clamp(28px, 3.2vw, 48px); font-weight: 800; letter-spacing: -.02em; margin: 8px 0 8px; line-height: 1.05; }
.cz-hero p { margin: 0 0 18px; max-width: 640px; color: rgba(255,255,255,.92); font-size: var(--t-md, 16px); line-height: 1.5; }
.cz-hero__scan {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
    background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); border-radius: 999px;
    padding: 12px 22px; font: inherit; font-weight: 700; transition: background .2s ease, transform .15s ease;
}
.cz-hero__scan:hover { background: rgba(255,255,255,.14); }
.cz-hero__scan:active { transform: scale(.98); }

/* ---------------------------------------------------------------- hub: certificate types */
.cz-kinds { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.cz-kind {
    display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
    background: var(--paper); border: 1px solid var(--etch-soft); border-radius: var(--radius);
    padding: 14px 18px; font: inherit; color: var(--ink);
    box-shadow: 0 6px 18px rgba(10, 26, 38, .05); transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.cz-kind:hover { border-color: var(--cyan); box-shadow: 0 10px 26px rgba(0, 173, 239, .14); }
.cz-kind:active { transform: scale(.99); }
.cz-tile {
    flex: 0 0 auto; width: 64px; height: 64px; padding: 9px; border-radius: 16px; display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(0,173,239,.16), rgba(141,104,173,.18)); border: 1px solid rgba(0,173,239,.22);
}
.cz-tile img { width: 100%; height: 100%; object-fit: contain; }
.cz-tile i { display: none; font-size: 26px; color: var(--cyan-deep); }
.cz-tile.fallback img { display: none; }
.cz-tile.fallback i { display: block; }
.cz-kind__text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cz-kind__text b { font-family: var(--display); font-size: 17px; font-weight: 650; }
.cz-kind__text span { color: var(--ink-45); font-size: 14px; }
.cz-kind__go { color: var(--cyan-deep); font-size: 20px; }

/* ---------------------------------------------------------------- type page: header bar */
.cz-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cz-back, .cz-iconbtn {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: var(--paper); border: 1px solid var(--etch-soft); color: var(--ink); font-size: 18px; font: inherit;
}
.cz-back:hover, .cz-iconbtn:hover { border-color: var(--cyan); color: var(--cyan-deep); }
.cz-iconbtn { background: rgba(0,173,239,.12); border-color: transparent; color: var(--cyan-deep); border-radius: 14px; width: 54px; height: 54px; font-size: 20px; }
.cz-bar .cz-tile { width: 54px; height: 54px; padding: 7px; border-radius: 14px; }
.cz-bar__text { flex: 1; min-width: 0; }
.cz-bar__text h2 { margin: 0; font-family: var(--display); font-size: clamp(22px, 2vw, 30px); font-weight: 750; letter-spacing: -.015em; }
.cz-bar__text p { margin: 2px 0 0; color: var(--ink-70); }
.cz-clear {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 16px; border-radius: 999px;
    border: 1px solid var(--etch-soft); background: var(--paper); color: var(--ink-70); font: inherit; font-weight: 600;
}
.cz-clear:hover { color: var(--secondary); border-color: var(--secondary); }

/* ---------------------------------------------------------------- type page: search card */
.cz-search { background: var(--paper); border: 1px solid var(--etch-soft); border-radius: var(--radius); padding: 18px; box-shadow: 0 6px 18px rgba(10,26,38,.05);
             display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cz-search > .cz-search__row { flex: 3 1 520px; }
.cz-search > .cz-field { flex: 1 1 240px; }                       /* date (bottle / tool-necked) */
.cz-search > .cz-primary { flex: 1 1 280px; width: auto; }
/* certificates: cards side by side on wide screens, one column on narrow ones */
.cz-list { display: grid; gap: 12px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); }
.cz-list .cz-row { margin-bottom: 0; }
.cz-search__row { display: flex; gap: 10px; align-items: center; }
.cz-field {
    flex: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 18px;
    border: 1px solid var(--etch); border-radius: 14px; background: var(--paper); transition: border-color .2s ease, box-shadow .2s ease;
}
.cz-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,173,239,.18); }
.cz-field i { color: var(--ink-45); }
.cz-field input, .cz-field select {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
    font: inherit; font-size: 18px; font-family: var(--mono); letter-spacing: .02em; padding: 14px 0;
}
.cz-field input::placeholder { font-family: var(--body, inherit); letter-spacing: 0; color: var(--ink-45); }
.cz-field select { font-family: inherit; cursor: pointer; }
.cz-primary {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; cursor: pointer;
    border: 0; border-radius: 999px; background: var(--gradient-brand); color: #fff; font: inherit; font-weight: 700; font-size: 17px;
    box-shadow: 0 10px 24px rgba(0,173,239,.28); transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.cz-primary:hover { box-shadow: 0 14px 30px rgba(0,173,239,.36); }
.cz-primary:active { transform: scale(.99); }
.cz-primary:disabled, .cz-act:disabled, .cz-bulk button:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* ---------------------------------------------------------------- empty state */
.cz-empty { text-align: center; padding: 48px 20px 24px; color: var(--ink-45); }
.cz-empty__icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: var(--cyan-deep);
                  background: linear-gradient(135deg, rgba(0,173,239,.14), rgba(141,104,173,.16)); }
.cz-empty b { display: block; font-family: var(--display); font-size: 19px; color: var(--ink); margin-bottom: 6px; }

/* ---------------------------------------------------------------- certificate card (compact, like the app) */
.cz-row {
    background: var(--paper); border: 1px solid var(--etch-soft); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
    box-shadow: 0 4px 14px rgba(10,26,38,.04); transition: border-color .2s ease, box-shadow .2s ease;
    animation: czIn .28s cubic-bezier(.16,1,.3,1) both;
}
.cz-row.on { border: 1.5px solid var(--cyan); }
@keyframes czIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cz-row__head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 4px 12px; cursor: pointer; }
.cz-check { position: relative; flex: 0 0 auto; width: 26px; height: 26px; }
.cz-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cz-check span { position: absolute; inset: 0; border: 2px solid var(--ink-45); border-radius: 6px; background: var(--paper); transition: all .15s ease; pointer-events: none; }
.cz-check input:checked + span { background: var(--cyan-deep); border-color: var(--cyan-deep); }
.cz-check input:checked + span::after { content: ""; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cz-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,173,239,.3); }
.cz-row__text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cz-row__code { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--cyan-deep); }
.cz-row__title { font-family: var(--display); font-size: 16.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-row.open .cz-row__title { white-space: normal; }
.cz-row__date { font-size: 13px; font-weight: 600; color: var(--ink-45); }
.cz-plus { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-70); cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.cz-plus i { transition: transform .2s ease, color .2s ease; }
.cz-row.open .cz-plus i { transform: rotate(45deg); color: var(--secondary); }     /* + turns into x */
.cz-row__acts { display: flex; gap: 4px; padding: 0 10px 8px 48px; flex-wrap: wrap; }
.cz-act {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 0; cursor: pointer;
    background: transparent; color: var(--cyan-deep); font: inherit; font-weight: 700; font-size: 14px;
}
.cz-act:hover { background: rgba(0,173,239,.10); }
.cz-row__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s cubic-bezier(.16,1,.3,1); }
.cz-row.open .cz-row__more { grid-template-rows: 1fr; }
.cz-row__more > div { overflow: hidden; }
.cz-row__more dl { margin: 0 14px 12px 22px; padding-top: 10px; border-top: 1px solid var(--etch-soft); display: grid; grid-template-columns: 170px 1fr; gap: 5px 14px; }
.cz-row__more dt { color: var(--ink-45); font-weight: 600; font-size: 13.5px; }
.cz-row__more dd { margin: 0; font-size: 14.5px; }

/* ---------------------------------------------------------------- bottom bar (selected certificates) */
.cz-bulk {
    position: sticky; bottom: 0; z-index: 5; margin-top: 18px; display: flex; gap: 10px; align-items: center;
    background: var(--paper); border: 1px solid var(--etch-soft); border-radius: var(--radius); padding: 12px;
    box-shadow: 0 -8px 24px rgba(10,26,38,.08); animation: czIn .25s ease both;
}
.cz-bulk .cz-primary { flex: 0 1 380px; }
.cz-bulk__info { flex: 1; min-width: 0; padding-left: 8px; font-weight: 700; color: var(--ink-70); }
.cz-bulk__info b { color: var(--cyan-deep); font-family: var(--mono); }
.cz-bulk__ghost {
    display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 20px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--etch); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700;
}
.cz-bulk__ghost i { color: #1D6F42; }               /* Excel green */
.cz-bulk__share { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--etch); background: var(--paper); color: var(--cyan-deep); cursor: pointer; font-size: 19px; }

/* ---------------------------------------------------------------- busy overlay (the app's flask loader) */
.cz-busy { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(255,255,255,.85); backdrop-filter: blur(2px); }
.cz-busy .bsl-loading { font-weight: 600; color: var(--ink-70); }

/* ---------------------------------------------------------------- scanned code: "which certificate is this?" */
.cz-pick h3 { margin: 0 0 4px; font-family: var(--mono); font-size: 16px; color: var(--ink); }
.cz-pick p { margin: 0 0 14px; color: var(--ink-45); }
.cz-pick button { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--etch-soft); background: var(--paper); font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.cz-pick button:hover { border-color: var(--cyan); color: var(--cyan-deep); }

/* ---------------------------------------------------------------- QR scanner (webcam) */
.cz-scan { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; }
.cz-scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-scan__frame { position: absolute; inset: 0; pointer-events: none; }
.cz-scan__frame::before {          /* dim outside the square */
    content: ""; position: absolute; left: 50%; top: 50%; width: 60%; aspect-ratio: 1; transform: translate(-50%, -50%);
    border-radius: 20px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); border: 1.5px solid rgba(255,255,255,.4);
}
.cz-scan__corners { position: absolute; left: 50%; top: 50%; width: 60%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
    background:
      linear-gradient(var(--cyan), var(--cyan)) top left / 34px 5px no-repeat, linear-gradient(var(--cyan), var(--cyan)) top left / 5px 34px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) top right / 34px 5px no-repeat, linear-gradient(var(--cyan), var(--cyan)) top right / 5px 34px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom left / 34px 5px no-repeat, linear-gradient(var(--cyan), var(--cyan)) bottom left / 5px 34px no-repeat,
      linear-gradient(var(--cyan), var(--cyan)) bottom right / 34px 5px no-repeat, linear-gradient(var(--cyan), var(--cyan)) bottom right / 5px 34px no-repeat; }
.cz-scan__line { position: absolute; left: 22%; right: 22%; height: 2px; top: 22%; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: czScan 2.2s ease-in-out infinite; }
@keyframes czScan { 0%, 100% { top: 22%; } 50% { top: 78%; } }
.cz-scan__msg { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.cz-scan__tools { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.cz-scan__tools select { font: inherit; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--etch); background: var(--paper); }
.cz-scan__tools input[type=range] { flex: 1; min-width: 160px; accent-color: var(--cyan); }
.cz-scan__tip { margin: 10px 0 0; color: var(--ink-45); font-size: 14px; text-align: center; }

/* wide kiosk screens: the five types side by side as tiles */
@media (min-width: 1500px) {
    .cz-kinds { grid-template-columns: repeat(5, 1fr); }
    .cz-kind { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px; min-height: 230px; position: relative; }
    .cz-kind .cz-tile { width: 84px; height: 84px; padding: 12px; border-radius: 20px; }
    .cz-kind__text b { font-size: 19px; }
    .cz-kind__go { position: absolute; right: 20px; bottom: 20px; }
}

@media (max-width: 560px) {
    .cz .section-head h2 { font-size: 23px; }
    .cz-hero__title { font-size: 30px; }
    .cz-bar__text h2 { font-size: 21px; }
}

@media (max-width: 700px) {
    .cz-bulk__info { display: none; }
    .cz-bulk .cz-primary { flex: 1; }
    .cz-row__more dl { grid-template-columns: 1fr; }
    .cz-row__acts { padding-left: 12px; }
}

/* ---------------------------------------------------------------- scanner hint dialog (kiosk: USB / Bluetooth QR scanner) */
.cz-wedge { text-align: center; }
.cz-wedge h2 { margin: 6px 0 6px; font-family: var(--display); font-size: 24px; }
.cz-wedge p { margin: 0 auto 16px; max-width: 440px; color: var(--ink-70); line-height: 1.5; }
.cz-wedge__art { position: relative; width: 260px; max-width: 100%; margin: 0 auto 6px; }
.cz-wedge__svg { width: 100%; height: auto; display: block; overflow: visible; }
.cz-wedge__gun { transform-origin: 210px 90px; animation: czGun 2.6s ease-in-out infinite; }
@keyframes czGun { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-6px, 3px) rotate(-3deg); } }
.cz-wedge__beam { animation: czBeamFlash 2.6s ease-in-out infinite; }
@keyframes czBeamFlash { 0%, 100% { opacity: .35; } 45%, 60% { opacity: 1; } }
.cz-wedge__window { animation: czBlink 1.3s ease-in-out infinite; }
@keyframes czBlink { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.cz-wedge__scanline { animation: czLine 2.6s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(255,77,77,.9)); }
@keyframes czLine { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(86px); } }
.cz-wedge__ok { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
    display: grid; place-items: center; background: #1fae6b; color: #fff; font-size: 34px; transform: scale(0); opacity: 0;
    box-shadow: 0 10px 30px rgba(31,174,107,.4); transition: transform .35s cubic-bezier(.2,1.4,.4,1), opacity .2s ease; }
.cz-wedge.is-ok .cz-wedge__ok { transform: scale(1); opacity: 1; }
.cz-wedge.is-ok .cz-wedge__svg { opacity: .25; transition: opacity .2s ease; }
.cz-wedge__field { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 18px; margin: 0 auto 10px; max-width: 460px;
    border: 2px solid var(--cyan); border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 4px rgba(0,173,239,.12); }
.cz-wedge__field i { color: var(--cyan-deep); font-size: 20px; }
.cz-wedge__field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-family: var(--mono); font-size: 18px; color: var(--ink); padding: 14px 0; }
.cz-wedge.is-bad .cz-wedge__field { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229,72,77,.14); animation: czShake .35s ease; }
@keyframes czShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.cz-wedge__status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-70); margin-bottom: 16px; min-height: 22px; }
.cz-wedge.is-bad .cz-wedge__status { color: #e5484d; }
.cz-wedge.is-ok .cz-wedge__status { color: #1fae6b; font-family: var(--mono); }
.cz-wedge__dot { width: 10px; height: 10px; border-radius: 50%; background: #1fae6b; box-shadow: 0 0 0 0 rgba(31,174,107,.6); animation: czPulse 1.4s ease-out infinite; }
@keyframes czPulse { 0% { box-shadow: 0 0 0 0 rgba(31,174,107,.55); } 100% { box-shadow: 0 0 0 12px rgba(31,174,107,0); } }
.cz-wedge__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
    .cz-wedge__gun, .cz-wedge__beam, .cz-wedge__window, .cz-wedge__scanline, .cz-wedge__dot { animation: none; }
}

/* ---------------------------------------------------------------- PDF viewer, "certificate ready", scanner heading
   (classes instead of inline styles: the page also works under a strict Content-Security-Policy) */
.bsl-modal__card.cz-viewer { width: min(1100px, 100%); padding: 16px; }
.cz-viewer__bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.cz-viewer__code { margin: 0 !important; flex: 1; text-align: left !important; font-size: 18px !important; font-family: var(--mono) !important; }
.cz-viewer__bar a.btn { text-decoration: none; }
.cz-viewer__frame { position: relative; height: 78vh; border: 1px solid var(--etch-soft); border-radius: 12px; overflow: hidden; background: #fff; }
.cz-viewer__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.cz-viewer__frame .bsl-loading { position: absolute; inset: 0; display: grid; place-content: center; z-index: 1; background: #fff; }
.cz-viewer__frame.is-loaded .bsl-loading { display: none; }
.cz-ready { text-align: center; }
.cz-ready h2 { margin: 14px 0 6px !important; }
.cz-ready .btn { width: 100%; }
.cz-scanhead { margin: 0 0 12px !important; text-align: left !important; font-size: 20px !important; }
.cz-scan__zoom { display: flex; align-items: center; gap: 8px; flex: 1; }
.cz-scan__zoom[hidden] { display: none; }
.cz-scan__close { margin-left: auto; }
