/* Certificate pages: the site's Manrope, centered layout and compact controls. */
:root { --cert-ink: #f3f2ee; --cert-muted: #b3b9b5 }
.admin-glass { --cert-ink: #27312b; --cert-muted: #626d66 }
.certificates-page {
  --cert-ink: #f3f2ee;
  --cert-muted: #b3b9b5;
  background: #151719;
  color: var(--cert-ink);
  color-scheme: dark;
  font-family: Manrope, system-ui, Arial, sans-serif;
  font-synthesis: none;
}
.certificates-page .wrap { width: min(1040px, calc(100% - 40px)); margin-inline: auto }
.cert-site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px }
.cert-site-header a { color: inherit; text-decoration: none }
.cert-site-header .autosim-logo, .cert-site-header nav a { min-height: 44px }
.cert-site-header nav a { display: flex; align-items: center; font-size: 13px }
.cert-main { padding-block: clamp(20px, 4vw, 42px) 64px }
.cert-main h1 { margin: 0; font-size: clamp(29px, 5.3vw, 42px); line-height: 1.14; letter-spacing: -.045em; text-align: center; text-wrap: balance }
.cert-intro { max-width: 600px; margin: 0 auto 28px; text-align: center }
.cert-intro p { margin: 10px auto 0; max-width: 42ch; color: var(--cert-muted); font-size: 14px; line-height: 1.5 }
.cert-builder { display: grid; gap: 22px; width: 100%; max-width: 560px; margin-inline: auto }
.cert-visual { min-width: 0 }
.cert-preview { position: relative; aspect-ratio: 5/3; isolation: isolate; border-radius: 3% / 5%; box-shadow: 0 18px 38px -22px #000b }
.cert-preview > .cert-card { position: absolute; inset: 0; width: 100%; height: 100% }
.cert-card { display: block; width: 100%; height: auto; overflow: visible; border-radius: 3% / 5% }
.cert-card[data-template=apex_light] { box-shadow: 0 0 0 1px #13171930, 0 12px 30px -20px #0009 }
.cert-preview-meta { display: flex; justify-content: center; margin-top: 4px }
.cert-document-link { min-height: 44px; padding: 8px 12px; background: transparent; color: var(--cert-muted); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: .25em }
.cert-controls { display: grid; gap: 20px; width: 100%; max-width: 440px; margin-inline: auto; min-width: 0 }
.cert-controls h3 { margin: 0; font-size: 22px }
.cert-themes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0; padding: 0; border: 0 }
.cert-themes legend, .cert-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0 }
.cert-theme { position: relative; display: grid; gap: 8px; min-height: 68px; min-width: 0; padding: 7px 7px 9px; border-radius: 13px; cursor: pointer }
.cert-theme::before { content: ''; position: absolute; inset: 0; border: 1px solid #ffffff22; border-radius: inherit }
.cert-theme::after { content: ''; position: absolute; inset: 0; border: 2px solid #ef4e22; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity 140ms }
.cert-theme:has(input:checked)::after { opacity: 1 }
.cert-theme input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer }
.cert-theme svg { width: 100%; height: auto; max-height: 50px; border-radius: 7px }
.cert-theme span { font-size: 11px; text-align: center }
.cert-theme:has(input:focus-visible) { outline: 2px solid var(--cert-ink); outline-offset: 4px }
.cert-field { display: grid; gap: 8px; font-size: 13px; color: var(--cert-muted); text-align: left }
.cert-field input, .cert-field textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 52px; border: 1px solid #ffffff25; background: #ffffff05; color: var(--cert-ink); border-radius: 14px; padding: 13px 15px; font: inherit; font-size: 16px }
.cert-amount-wrap { position: relative }
.cert-field input[data-amount-input] { padding: 12px 52px; font-size: 32px; font-weight: 700; line-height: 1.2; text-align: center; letter-spacing: -.04em; font-variant-numeric: tabular-nums }
.cert-currency { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 23px; color: #b3b9b5 }
.cert-field input:focus-visible, .cert-field textarea:focus-visible { outline: 2px solid #ef947d; outline-offset: 3px }
.cert-field textarea { min-height: 96px; resize: vertical; line-height: 1.5 }
.cert-error { margin: 0; font-size: 12px; line-height: 1.5; color: #ffb29e }
.cert-range { --fill: 3%; appearance: none; -webkit-appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: ew-resize; touch-action: pan-y }
.cert-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right,#ef4e22 0 var(--fill),#ffffff24 var(--fill) 100%) }
.cert-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 3px solid var(--cert-ink); border-radius: 50%; background: #ef4e22; margin-top: -10px; transition: transform 140ms }
.cert-range::-moz-range-track { height: 4px; background: #ffffff24; border-radius: 4px }
.cert-range::-moz-range-progress { height: 4px; background: #ef4e22 }
.cert-range::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid var(--cert-ink); border-radius: 50%; background: #ef4e22 }
.cert-range-ends { display: flex; justify-content: space-between; font-size: 11px; color: #a3aaa5 }
.cert-greeting { border-top: 1px solid #ffffff20; border-bottom: 1px solid #ffffff20; text-align: left }
.cert-greeting + .cert-greeting { border-top: 0 }
.cert-greeting summary { display: flex; min-height: 52px; justify-content: space-between; align-items: center; gap: 12px; list-style: none; cursor: pointer; font-size: 13px; color: #d5d9d5 }
.cert-greeting summary::-webkit-details-marker { display: none }
.cert-greeting summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; transition: transform 160ms }
.cert-greeting[open] summary::after { transform: rotate(225deg) }
.cert-greeting[open] summary { margin-bottom: 10px }
.cert-greeting > .cert-field { margin: 14px 0 }
.cert-greeting > .cert-small, .cert-greeting > .cert-terms { margin-bottom: 16px }
.cert-greeting > .cert-quiet { margin: 0 8px 12px 0 }
.cert-count { margin-top: -3px; font-size: 10px; text-align: right; color: #969e98 }
.cert-buy, .cert-primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; border: 0; border-radius: 100px; background: #ce4829; color: #fff; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.4; text-decoration: none; padding: 14px 22px; cursor: pointer; transition: transform 140ms, opacity 140ms }
.cert-buy:active, .cert-primary:active { transform: scale(.985) }
.cert-buy:disabled, .cert-primary:disabled { opacity: .45; cursor: default }
.cert-primary:focus-visible, .cert-buy:focus-visible, .cert-quiet:focus-visible, .cert-greeting summary:focus-visible { outline: 2px solid var(--cert-ink); outline-offset: 4px }
.cert-quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px; border: 1px solid #ffffff2c; border-radius: 100px; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.4; cursor: pointer; text-decoration: none }
.cert-small { font-size: 12px; line-height: 1.5; color: var(--cert-muted) }
.cert-status, .cert-loading { margin: 16px 0; color: #d5d9d5; font-size: 14px; line-height: 1.5; text-align: center; overflow-wrap: anywhere }
.cert-status a { text-decoration: underline; text-underline-offset: .2em }
.cert-checkout { display: grid; gap: 24px; max-width: 440px; margin-inline: auto }
.cert-checkout > h1 { margin-bottom: 0 }
.cert-checkout-preview { padding: 0 8px }
.cert-checkout-form { display: grid; gap: 18px }
.cert-view.cert-sbp-view { max-width: 480px }
.cert-sbp-amount { margin: 16px 0 28px; font-size: 32px; font-weight: 700; text-align: center; letter-spacing: -.035em }
.cert-sbp-selection { display: grid; gap: 18px; margin-bottom: 22px }
.cert-sbp-banks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px }
.cert-sbp-bank { min-height: 52px; border-radius: 14px; padding: 12px; overflow-wrap: anywhere; font-size: 13px }
.cert-sbp-qr-disclosure { text-align: center }
.cert-sbp-qr { display: block; box-sizing: border-box; width: min(280px,100%); height: auto; margin: 16px auto; background: #fff; border: 10px solid #fff; border-radius: 14px }
.cert-sbp-qr-disclosure > .cert-quiet { margin: 12px auto 20px }
.cert-sbp-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px }
.cert-sbp-view > .cert-primary { margin-bottom: 20px }
.cert-checkbox { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 12px; line-height: 1.5; color: var(--cert-muted); cursor: pointer; text-align: left }
.cert-checkbox input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #ce4829 }
.cert-checkbox a, .cert-small a { color: inherit; text-decoration: underline; text-underline-offset: 3px }
.cert-view { width: 100%; max-width: 600px; margin-inline: auto }
.cert-view > h1 { margin: 0 0 24px }
.cert-view > h2 { margin: 28px 0 12px; font-size: 24px; line-height: 1.2; text-align: center }
.cert-view > p, .cert-view > .cert-quiet { text-align: center }
.cert-view > .cert-quiet { display: flex; width: fit-content; margin: 16px auto 0 }
.cert-view > .cert-small + .cert-small { margin-top: 8px }
.cert-view > .cert-information + .cert-greeting-text { margin-top: 16px }
.cert-view > .cert-greeting { margin-block: 0 }
.cert-view > .cert-greeting .cert-access-form { margin-block: 12px 20px }
.cert-view > .cert-terms { text-align: left }
.cert-view .cert-card { margin-inline: auto }
.cert-information { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 22px 0 4px }
.cert-information strong { display: block; font-size: 14px; font-weight: 700 }
.cert-information > div:last-child { text-align: right }
.cert-information > div:last-child strong { font-size: 26px; line-height: 1.2; letter-spacing: -.04em; white-space: nowrap }
.cert-information p { margin: 4px 0 0; font-size: 11px; color: var(--cert-muted) }
.cert-badge { display: inline-flex; margin-top: 6px; font-size: 11px; color: #c2c9c2 }
.cert-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 22px 0 }
.cert-actions > :only-child { grid-column: 1 / -1 }
.cert-actions .cert-primary { min-width: 0 }
.cert-access-form { display: grid; gap: 20px; max-width: 440px; margin: 24px auto 0 }
.cert-list { display: grid; gap: 24px }
.cert-list-item { display: grid; gap: 12px; padding: 0; border: 0; color: inherit; text-decoration: none }
.cert-list-item :is(h2,h3) { margin: 2px 0 0; font-size: 22px; text-align: center }
.cert-list-item p { font-size: 12px; line-height: 1.5; color: var(--cert-muted); text-align: center }
.cert-list-item a { margin-inline: auto }
.cert-history { padding: 0; margin: 0 0 14px; list-style: none }
.cert-history li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid #ffffff16; font-size: 12px; color: var(--cert-muted) }
.cert-history strong { white-space: nowrap }
.cert-heading-row { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 24px }
.cert-heading-row h1 { margin: 0 }
.cert-demo-note { max-width: 560px; margin: 0 auto; padding: 8px 12px; border: 1px solid #ef4e2260; border-radius: 10px; color: #f1a78e; font-size: 12px; text-align: center }
.cert-terms, .cert-greeting-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; color: #bec5bf }
.cert-greeting-text { margin-top: 12px; text-align: center }
#member-certificates-content { width: 100%; min-width: 0 }
.cert-document-dialog { box-sizing: border-box; max-width: 760px; width: calc(100% - 24px); max-height: 92svh; overflow: auto; padding: 16px; border: 1px solid #ffffff28; border-radius: 24px; background: #1b1e20; color: var(--cert-ink) }
.cert-document-dialog::backdrop { background: #000b }
.cert-document-dialog > .cert-quiet { display: flex; margin: 0 0 16px auto }
.cert-document-preview { padding: 20px; border-radius: 16px; background: #e1e5df; color: #151719 }
.cert-document-preview > .cert-card { box-shadow: 0 1px 0 #0002, 0 12px 22px -14px #0007 }
.cert-document-info { display: grid; grid-template-columns: 1fr 120px; gap: 20px; padding: 24px 0 4px; font-size: 13px; line-height: 1.6 }
.cert-document-info p { margin: 8px 0 0 }
.cert-qr-placeholder { align-self: start; display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #15171933; border-radius: 8px; color: #5d645e; font-size: 11px; text-align: center }
@media (max-width: 500px) {
  .cert-site-header { padding-block: 12px }
  .cert-main { padding-block: 18px 48px }
  .cert-intro { margin-bottom: 22px }
  .cert-builder { gap: 14px }
  .cert-controls { gap: 16px }
  .cert-information { grid-template-columns: 1fr auto; gap: 12px }
  .cert-information strong { font-size: 12px }
  .cert-information > div:last-child strong { font-size: 24px }
  .cert-document-preview { padding: 12px }
  .cert-document-info { grid-template-columns: 1fr }
  .cert-qr-placeholder { width: 120px }
}
@media (max-width: 360px) {
  .certificates-page .wrap { width: calc(100% - 32px) }
  .cert-site-header nav a { font-size: 12px }
  .cert-themes { gap: 7px }
  .cert-theme { padding: 6px }
  .cert-theme span { font-size: 10px }
  .cert-actions { grid-template-columns: 1fr }
}
@media (prefers-reduced-motion: reduce) {
  .cert-theme::after, .cert-greeting summary::after, .cert-buy, .cert-primary, .cert-range::-webkit-slider-thumb { transition: none !important }
  .cert-buy:active, .cert-primary:active { transform: none }
}
