/* Full CSS extracted from launitics.html */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
}

:root {
  --gold-dark: #92400E;
  --gold: #D97706;
  --gold-light: #FDE68A;
  --cream: #FFFBEB;
  --s950: #020617;
  --s900: #0f172a;
  --s700: #334155;
  --s600: #475569;
  --s500: #64748b;
  --s400: #94a3b8;
  --s200: #e2e8f0;
  --s100: #f1f5f9;
  --s50: #f8fafc;
  --em600: #059669;
  --em200: #a7f3d0;
  --em100: #d1fae5;
  --em800: #065f46;
  --rd600: #dc2626;
  --rd200: #fecaca;
  --rd100: #fee2e2;
  --rd800: #991b1b;
  --am600: #d97706;
  --am700: #b45309;
  --am800: #92400e;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

/* ── Header ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--s200);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.logo-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--s950);
  color: #fcd34d;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.logo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--s950);
  line-height: 1.2;
}

.logo-sub {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--s500);
  line-height: 1;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--s600);
  cursor: pointer;
  transition: background 150ms, color 150ms;
  font-family: 'IBM Plex Sans', sans-serif;
}

.nav-btn:hover {
  background: var(--s100);
  color: var(--s950);
}

.nav-btn.active {
  background: var(--s100);
  color: var(--s950);
  font-weight: 600;
}

/* ── Backend config banner ── */
#config-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 8px 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#config-bar label {
  font-size: .8rem;
  color: var(--am800);
  font-weight: 600;
  white-space: nowrap;
}

#backend-url-input {
  flex: 1;
  min-width: 220px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  background: #fff;
  outline: none;
}

#backend-url-input:focus {
  border-color: var(--am700);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, .15);
}

#btn-save-url {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  background: var(--am700);
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
}

#btn-save-url:hover {
  background: var(--am800);
}

.config-hint {
  font-size: .75rem;
  color: var(--s500);
}

#api-status {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.status-ok {
  background: var(--em100);
  color: var(--em800);
}

.status-err {
  background: var(--rd100);
  color: var(--rd800);
}

.status-idle {
  background: var(--s100);
  color: var(--s500);
}

/* ── Pages ── */
main.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-head {
  padding-top: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--am700);
}

h1.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 500;
  color: var(--s950);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-top: 8px;
}

.page-sub {
  margin-top: 10px;
  color: var(--s600);
  font-size: .9rem;
  line-height: 1.6;
  max-width: 560px;
}


.card {
    width: 100%;
    max-width: 335px;
    min-height: 208px;
    margin: 4px auto 28px;
    padding: 49px 21px 32px;
    transform: translateY(-8px);

    background: #fff;
    border: 1.5px solid #0b63a5;
    border-radius: 18px;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;

    box-sizing: border-box;

    box-shadow: 0 3px 9px rgba(0, 75, 135, 0.42);
}
   
.field {
  margin-bottom: 10px;
}

.field:last-of-type {
  margin-bottom: 0;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.input-wrap input {
  width: 100%;
  padding: 16px 46px 10px 0;
  min-height: 52px;
  border: none;
  border-bottom: 2px solid rgba(10, 95, 181, 0.35);
  background: transparent;
  font-size: 1rem;
  color: var(--s950);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-wrap input:focus {
  border-color: rgba(10, 95, 181, 1);
}

label.lbl {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--s600);
  margin-bottom: 12px;
  font-weight: 600;
}

.field-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  pointer-events: none;
  opacity: 0.9;
}

input[type=text],
input[type=date],
input[type=search] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--s200);
  border-radius: 8px;
  font-size: .875rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--s950);
  background: #fff;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

input:focus {
  border-color: var(--s950);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 42px;
  border-radius: 8px;
  border: none;
  font-size: .875rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, transform 150ms, opacity 150ms;
  text-decoration: none;
  vertical-align: middle;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-dark {
  background: var(--s950);
  color: #fff;
}

.btn-dark:hover:not(:disabled) {
  background: #1e293b;
}

.btn-amber {
  background: var(--am600);
  color: #fff;
}

.btn-amber:hover:not(:disabled) {
  background: var(--am700);
}

.btn-outline {
  background: transparent;
  color: var(--am800);
  border: 1px solid #fcd34d;
}

.btn-outline:hover:not(:disabled) {
  background: #fffbeb;
}

.btn-ghost {
  background: transparent;
  color: var(--s700);
  border: 1px solid var(--s200);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--s50);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: .78rem;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
  margin-top: 22px;
  background: linear-gradient(180deg, #1C6FE0 0%, #0A4FA8 100%);
  color: #fff;
  border-radius: 999px;
  padding: 16px 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 35px rgba(28, 111, 224, 0.24);
}

.gen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media(min-width:768px) {
  .gen-grid {
    grid-template-columns: 360px 1fr;
    gap: 32px;
  }
}

.form-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 14px;
  border-bottom: 6px solid var(--s100);
}

.form-hdr-lbl {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--s500);
  font-weight: 600;
}

/* ── Preview panel ── */
.preview-panel {
  background: rgba(241, 245, 249, .6);
  border: 1px solid var(--s200);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: inset 0 1px 8px rgba(2, 6, 23, .04);
}

@media(min-width:768px) {
  .preview-panel {
    position: sticky;
    top: 84px;
  }
}

.preview-lbl {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--s500);
  margin-bottom: 10px;
}

.preview-hint {
  margin-top: 10px;
  font-size: .72rem;
  color: var(--s400);
}

/* ── Certificate preview ── */
.cert-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1.414/1;
  background-color: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(2, 6, 23, .10);
  background-image:
    radial-gradient(rgba(146, 64, 14, .04) 1px, transparent 1px),
    radial-gradient(rgba(146, 64, 14, .03) 1px, transparent 1px);
  background-size: 18px 18px, 32px 32px;
  background-position: 0 0, 9px 16px;
}

.cb-outer {
  position: absolute;
  inset: 10px;
  border: 3px solid var(--gold-dark);
  border-radius: 2px;
  pointer-events: none;
}

.cb-inner {
  position: absolute;
  inset: 18px;
  border: 1px solid var(--gold);
  border-radius: 2px;
  pointer-events: none;
}

.cc {
  position: absolute;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}

.cc::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.cc::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-light);
}

.cc-tl {
  top: 13px;
  left: 13px;
}

.cc-tr {
  top: 13px;
  right: 13px;
}

.cc-bl {
  bottom: 13px;
  left: 13px;
}

.cc-br {
  bottom: 13px;
  right: 13px;
}

.cert-body-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 8%;
}

.c-inst {
  margin-top: 7%;
  font-size: clamp(7px, 1vw, 10px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--s500);
  font-family: 'IBM Plex Sans', sans-serif;
}

.c-title {
  margin-top: 3%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  color: var(--gold-dark);
  font-size: clamp(14px, 4.2vw, 42px);
  line-height: 1.1;
}

.c-sub {
  margin-top: 2%;
  font-style: italic;
  color: var(--s700);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(8px, 1.4vw, 13px);
}

.c-recip {
  margin-top: 3%;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--s950);
  font-size: clamp(16px, 4vw, 38px);
  line-height: 1.05;
  word-break: break-word;
}

.c-div {
  margin-top: 4px;
  height: 1px;
  width: 55%;
  background: rgba(217, 119, 6, .6);
}

.c-course-lbl {
  margin-top: 3%;
  color: var(--s700);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(8px, 1.3vw, 12px);
}

.c-course {
  margin-top: 2%;
  font-family: 'Cormorant Garamond', serif;
  color: var(--s900);
  font-size: clamp(11px, 2.4vw, 22px);
  line-height: 1.15;
  word-break: break-word;
}

.c-footer {
  margin-top: auto;
  margin-bottom: 6%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 5%;
}

.c-foot-blk {
  text-align: left;
}

.c-foot-blk.right {
  text-align: right;
}

.c-foot-lbl {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--s500);
  font-family: 'IBM Plex Sans', sans-serif;
}

.c-foot-line {
  margin-top: 4px;
  height: 1px;
  background: rgba(15, 23, 42, .7);
  width: 100px;
}

.c-foot-blk.right .c-foot-line {
  margin-left: auto;
}

.c-foot-val {
  margin-top: 4px;
  font-family: 'Cormorant Garamond', serif;
  color: var(--s900);
  font-size: clamp(8px, 1.2vw, 12px);
}

.c-foot-blk.right .c-foot-val {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(11px, 1.8vw, 19px);
}

.c-uid {
  position: absolute;
  bottom: 2%;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(6px, .9vw, 9px);
  color: var(--s500);
  letter-spacing: .04em;
}

/* ── Success card ── */
.success-card {
  margin-top: 18px;
  border: 1px solid var(--em200);
  background: rgba(209, 250, 229, .35);
  border-radius: 10px;
  padding: 14px;
}

.sc-eye {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--em800);
  font-weight: 600;
}

.sc-id {
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem;
  color: var(--s900);
}

/* ── Verify ── */
.verify-wrap {
  max-width: 660px;
  margin: 0 auto;
  padding-top: 2.5rem;
}

@media(min-width:768px) {
  .verify-wrap {
    padding-top: 5rem;
  }
}

.v-hero {
  text-align: center;
}

.v-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media(min-width:520px) {
  .v-row {
    flex-direction: row;
  }
}

.v-inp-wrap {
  position: relative;
  flex: 1;
}

.v-inp-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--s400);
  pointer-events: none;
}

.v-inp-wrap input {
  padding-left: 38px;
  height: 42px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: 'IBM Plex Mono', monospace;
}

.btn-verify {
  height: 46px;
  padding: 0 22px;
}

/* ── Result ── */
.result-area {
  margin-top: 1.5rem;
}

/* ── Footer and others omitted for brevity */

/* Mobile‑specific adjustments */
@media (max-width: 600px) {
  .card {
    width: 100%;
  }
}

/* Center page content */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background-image: url('bg_pattern.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

@media (max-width: 600px) {
  body {
    justify-content: center;
  }
}

.cert-preview {
  aspect-ratio: 1 / 1.4;
}

.bg-img {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

.logo-center {
  text-align: center;
  margin: 8px 0 4px;;
}

.logo-img {
  max-width: 125px;
  height: auto;
  transform: translateY(-2px);
}

.hidden {
  display: none !important;
}

main.container {
  width: 100%;
  max-width: 360px;
  padding: 0 12px 20px;
}

.form-hdr {
  display: none;
}

.card .field {
  margin-bottom: 28px;
}

.card label.lbl {
  display: block;
  margin: 0 0 6px 4px;
  color: #707070;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

.card .input-wrap input[type="text"] {
  height: 31px;
  min-height: 31px;
  padding: 0 42px 5px 0;
  border: none;
  border-bottom: 2px solid #176fa9;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
  font-size: 16px;
}

.card .input-wrap input[type="text"]:focus {
  border-color: #0b63a5;
  box-shadow: none;
}

.card .field-icon {
  right: 9px;
  top: 3px;
  width: 21px;
  height: 21px;
  object-fit: cover;
  opacity: 0;
}

.card .input-wrap::before,
.card .input-wrap::after {
  content: "";
  position: absolute;
  right: 11px;
  pointer-events: none;
  background: #43aee0;
}

.card .input-wrap::before {
  top: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.card .input-wrap::after {
  top: 13px;
  width: 15px;
  height: 8px;
  right: 8px;
  border-radius: 8px 8px 2px 2px;
}

.card .btn-full {
  width: 100%;
  height: 37px;
  margin-top: 0;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0067ad 0%, #3fb7e6 100%);
  box-shadow: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.card .btn-full:hover:not(:disabled) {
  background: linear-gradient(180deg, #005f9f 0%, #36acd9 100%);
}


/* Background Image: Stretches to fill the  */
.cert-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  /* Or 'cover' depending on your design */
  z-index: 0;
}

/* Logo: Positioned specifically (e.g., top center) */
.cert-logo {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  /* Adjust as needed */
  height: auto;
  z-index: 1;
}

/* Text Content: Centered and layered above images */
.cert-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 80%;
  z-index: 2;
  font-family: 'Cormorant Garamond', serif;
}

.cert-name {
  font-size: 48px;
  color: #0f172a;
  border-bottom: 2px solid #d97706;
  display: inline-block;
  padding-bottom: 10px;
  margin: 20px 0;
}

/* Download page layout */
.download-page {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 100vh;
  background: #f8fafc;
}

.download-page #pdf-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.5rem;
}

.download-page #pdf-content {
  position: relative;
  width: min(100%, 1123px);
  aspect-ratio: 1123 / 794;
  background: none;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.download-page #pdf-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-page #txtblock {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 1rem;
}

.download-page #txtblock span {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  line-height: 1.2;
}

.download-page #download-btn {
  width: min(100%, 360px);
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  background-color: #92400E;
  color: #fff;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease;
}

.download-page #download-btn:hover {
  transform: translateY(-2px);
  background-color: #b45309;
}

@media (max-width: 640px) {
  .download-page {
    padding: 0.75rem;
  }

  .download-page #pdf-wrapper {
    padding: 0;
  }

  .download-page #download-btn {
    width: 100%;
  }
}

/* Utility to hide the preview from the main UI */
.hidden {
  display: none;
  /* IMPORTANT: When generating, JS will temporarily remove this class 
     or render it in a way that html2pdf can see it */
}
.logo-center {
  align-items: center;
  
}