/* ========== PAGE ========== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #F5F7FA;
  color: #111111;
  font-family: 'Inter', Arial, sans-serif;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px 60px;
  text-align: center;
}

.top-logo { height: 48px; }

.eyebrow {
  margin: 20px 0 8px;
  font: 700 12px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #5C2DFF;
}

h1, h2 {
  margin: 0 0 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
h1 { font-size: 40px; }
h2 { font-size: 30px; }

.sub { color: #5E5A78; line-height: 1.6; margin: 0 auto 24px; max-width: 560px; }

.box {
  max-width: 460px;
  margin: 0 auto;
  padding: 26px;
  background: #fff;
  border: 1px solid #E3DEF7;
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(59, 5, 201, 0.08);
}
.box label { display: block; font-weight: 600; margin-bottom: 8px; }
.box input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  margin-bottom: 12px;
  font-size: 16px;
  border: 1.5px solid #E3DEF7;
  border-radius: 12px;
  background: #F5F7FA;
}
.box input:focus { outline: none; border-color: #5C2DFF; }
.box .btn { width: 100%; }

.error { color: #B42318; margin: 12px 0 0; min-height: 1em; }

.btn {
  height: 50px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font: 700 15px 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #2A0490, #5C2DFF);
}
.btn.light { color: #3B05C9; background: #F3F0FF; border: 1.5px solid #E3DEF7; }

.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }

/* Preview box: the certificate is scaled down to fit (see script.js) */
.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3508 / 2480;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(42, 4, 144, 0.15);
}

/* ========== CERTIFICATE (3508 x 2480 px = A4 landscape at 300 DPI) ========== */
.cert {
  position: absolute;
  top: 0; left: 0;
  width: 3508px;
  height: 2480px;
  transform-origin: top left;
  background: #fff;
  color: #111;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  overflow: hidden;
}
.cert .bg { position: absolute; inset: 0; width: 100%; height: 100%; }

.creds { position: absolute; top: 216px; right: 280px; display: flex; align-items: center; gap: 40px; }
.creds img { height: 150px; }
.creds .sep { width: 2px; height: 110px; background: #DCD5FA; }

.content { position: absolute; top: 200px; left: 180px; right: 180px; display: flex; flex-direction: column; align-items: center; }

.logo { height: 190px; }
.company { margin-top: 40px; font-size: 68px; font-weight: 700; letter-spacing: 0.28em; padding-left: 0.28em; }
.tagline { margin-top: 20px; font-size: 32px; font-weight: 600; letter-spacing: 0.38em; padding-left: 0.38em; color: #5C2DFF; }
.divider { margin-top: 46px; width: 2620px; height: 2px; background: linear-gradient(90deg, transparent, #3B05C9 18%, #3B05C9 82%, transparent); }

.title { margin-top: 54px; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 264px; line-height: 0.86; letter-spacing: 0.11em; padding-left: 0.11em; color: #2A0490; }
.subtitle { margin-top: 34px; display: flex; align-items: center; gap: 60px; font-size: 66px; font-weight: 700; letter-spacing: 0.48em; color: #3B05C9; }
.subtitle span { width: 300px; height: 3px; background: rgba(92, 45, 255, 0.6); }

.presented { margin-top: 90px; font-size: 42px; font-weight: 600; letter-spacing: 0.34em; padding-left: 0.34em; color: #5E5A78; }
.name { margin-top: 30px; font-size: 180px; font-weight: 800; line-height: 1.08; white-space: nowrap; }
.name-line { margin-top: 26px; width: 2200px; height: 3px; background: linear-gradient(90deg, transparent, #5C2DFF 25%, #3B05C9 50%, #5C2DFF 75%, transparent); }

.desc { margin-top: 64px; max-width: 2900px; font-family: 'Inter', sans-serif; font-size: 54px; line-height: 1.5; color: #3A3652; }
.desc p { margin: 0 0 18px; }
.desc b { font-weight: 600; color: #111; }
.desc .date { font-weight: 600; color: #3B05C9; }
.chip { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 44px; letter-spacing: 0.1em; color: #3B05C9; background: #F5F7FA; border: 3px solid #5C2DFF; border-radius: 14px; padding: 6px 22px; }

.footer { position: absolute; left: 300px; right: 300px; bottom: 200px; display: flex; justify-content: space-between; align-items: flex-end; text-align: left; }
.label { font-size: 34px; font-weight: 600; letter-spacing: 0.28em; color: #5E5A78; }
.label b { font-size: 46px; letter-spacing: 0.08em; color: #111; margin-left: 14px; }
.cert-id { margin-top: 14px; font-size: 66px; font-weight: 800; letter-spacing: 0.08em; color: #3B05C9; }
.small-line { width: 420px; height: 2px; margin: 30px 0 28px; background: #DCD5FA; }

.sign { width: 1100px; text-align: center; }
.sign img { height: 160px; margin-bottom: -16px; }
.sign-line { height: 3px; margin: 0 70px; background: #111; }
.sign-name { margin-top: 28px; font-size: 58px; font-weight: 800; letter-spacing: 0.18em; }
.sign-role { margin-top: 14px; font-size: 38px; font-weight: 700; letter-spacing: 0.3em; color: #3B05C9; }
.sign-org { margin-top: 12px; font-size: 32px; font-weight: 600; letter-spacing: 0.26em; color: #5E5A78; }

/* ========== PRINT / SAVE AS PDF: only the certificate, full A4 page ========== */
@page { size: A4 landscape; margin: 0; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  #search-page, h2, .sub, .buttons { display: none !important; }
  .page { padding: 0; max-width: none; }
  .preview { width: 297mm; height: 210mm; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .cert { transform: scale(0.32) !important; } /* 3508px x 0.32 = 297mm */
}

@media (max-width: 500px) {
  h1 { font-size: 30px; }
  .btn { width: 100%; }
}
