/* GRRC 2027 · Katılım ve teşekkür belgeleri (A4 yatay). Belge 21 kuralları: iki dilli, üç logo,
   belge türüne göre renk şeridi (katılım yeşil, danışman lacivert), belge no ve doğrulama karekodu. */
:root {
  --navy: #1F3864;
  --orange: #C55A11;
  --green: #2E7D4F;
  --ink: #1d1d1f;
  --muted: #5f6168;
  --line: #d9d6cf;
  --paper: #fffdf8;
  --band: var(--green);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #e9e7e1; color: var(--ink); font-family: Inter, -apple-system, "Segoe UI", system-ui, sans-serif; }

/* Araç çubuğu (yalnızca ekranda) */
.toolbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px 6px; }
.tb-in { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
.tb-back { color: var(--navy); text-decoration: none; font-weight: 500; }
.tb-info { color: var(--muted); font-size: 14px; flex: 1 1 auto; }
.tb-kind { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.tb-kind select { font: 14px Inter, sans-serif; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tb-preview { background: #fff4e5; color: #8a4b00; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
/* Ön izleme: onaylanmamış takım belgesi geçersizdir */
.cert.preview .inner { opacity: .92; }
.cert .pv-mark { display: none; }
.cert.preview .pv-mark { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-24deg); z-index: 5;
  font: 700 46pt Inter, sans-serif; letter-spacing: .12em; color: rgba(176, 0, 32, .13); white-space: nowrap; pointer-events: none; text-align: center; line-height: 1.1; }
.cert.preview .pv-mark small { display: block; font-size: 15pt; letter-spacing: .08em; }
.verify .qr.empty { border: 0.3mm dashed var(--line); display: grid; place-items: center; font-size: 6.5pt; color: var(--muted); }
#tb-print { background: var(--orange); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: 600 15px Inter, sans-serif; cursor: pointer; }
#tb-print:disabled { opacity: .5; cursor: default; }
.tb-hint { max-width: 1200px; margin: 6px auto 0; font-size: 13px; color: var(--muted); }
.msg { max-width: 720px; margin: 40px auto; background: #fff; border-radius: 12px; padding: 24px 28px; line-height: 1.5; }

#certs { padding: 24px 0 60px; display: grid; gap: 28px; justify-content: center; }

/* Sayfa: 297 × 210 mm */
.cert {
  width: 297mm; height: 210mm; position: relative; overflow: hidden;
  background: var(--paper); box-shadow: 0 6px 30px rgba(0,0,0,.14);
  font-size: 10.5pt; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.cert.advisor { --band: var(--navy); }
/* Üst renk şeridi ve alt ince şerit */
.cert::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7mm; background: var(--band); }
.cert::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.2mm; background: linear-gradient(90deg, var(--navy) 0 70%, var(--orange) 70% 100%); }
/* Çift çerçeve */
.frame { position: absolute; inset: 12mm 10mm 8mm; border: 0.6mm solid var(--navy); }
.frame::before { content: ""; position: absolute; inset: 1.6mm; border: 0.25mm solid var(--orange); }
/* Köşe süsleri (altıgen) */
.corner { position: absolute; width: 9mm; height: 9mm; background: var(--paper); }
.corner svg { width: 100%; height: 100%; display: block; }
.c-tl { left: -4.5mm; top: -4.5mm; } .c-tr { right: -4.5mm; top: -4.5mm; }
.c-bl { left: -4.5mm; bottom: -4.5mm; } .c-br { right: -4.5mm; bottom: -4.5mm; }
/* Filigran amblem */
.watermark { position: absolute; right: -18mm; bottom: -16mm; width: 120mm; opacity: .05; pointer-events: none; }

.inner { position: absolute; inset: 17mm 18mm 12mm; display: grid; grid-template-rows: auto auto auto 1fr auto; }

.logos { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.logos img { display: block; }
.logos .l-gaun { height: 18mm; justify-self: start; }
.logos .l-grrc { height: 18mm; }
.logos .l-ideal { height: 15mm; justify-self: end; }

.kicker { text-align: center; margin: 3.5mm 0 0; font-size: 7.6pt; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kicker b { color: var(--band); }

.head { text-align: center; margin-top: 2.5mm; }
.title { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: 35pt; line-height: 1.05; color: var(--navy); margin: 0; letter-spacing: .01em; }
.title-en { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-size: 14pt; color: var(--band); margin: 1mm 0 0; }
.present { margin: 3.2mm 0 0; font-size: 9pt; color: var(--muted); letter-spacing: .04em; }
.name { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 30pt; line-height: 1.15; margin: 1.2mm auto 0; padding: 0 8mm 1.4mm; display: inline-block; border-bottom: 0.35mm solid var(--orange); min-width: 120mm; }
.name.long { font-size: 24pt; }

.body { text-align: center; max-width: 220mm; margin: 3mm auto 0; }
.body p { margin: 0; }
.body .tr { font-size: 11.8pt; line-height: 1.45; }
.body .en { font-size: 9.3pt; font-style: italic; color: var(--muted); margin-top: 1.2mm; }

.research { display: grid; grid-template-columns: 1.35fr 1fr; gap: 6mm; margin: 0 6mm; align-self: center;
  border-top: 0.25mm solid var(--line); border-bottom: 0.25mm solid var(--line); padding: 3.6mm 0; }
.research h3 { margin: 0 0 1.2mm; font-size: 7.6pt; letter-spacing: .16em; text-transform: uppercase; color: var(--band); font-weight: 700; }
.r-title { font-family: "Source Serif 4", Georgia, serif; font-size: 14.5pt; font-weight: 600; line-height: 1.25; color: var(--ink); margin: 0; }
.r-title-en { font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-size: 10.5pt; color: var(--muted); margin: .8mm 0 0; }
.r-kw { font-size: 9.2pt; color: var(--muted); margin: 1.4mm 0 0; }
.r-kw b { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 1mm 3.5mm; font-size: 9.4pt; margin: 0; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; font-weight: 500; }

.foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8mm; }
.sig { text-align: center; font-size: 8.8pt; }
.sig .line { border-top: 0.3mm solid var(--ink); margin: 0 auto 1.4mm; width: 66mm; height: 0; }
.sig .sig-img { display: block; height: 19mm; width: auto; margin: 0 auto -3.2mm; position: relative; z-index: 1; }
.date-col { align-self: end; font-size: 9pt; color: var(--muted); padding-bottom: 6.5mm; }
.date-col span { display: inline-block; border-top: 0.25mm solid var(--line); padding-top: 1.2mm; }
.foot .verify { justify-self: end; }.sig b { display: block; font-size: 10pt; }
.sig > span { color: var(--muted); display: block; }
.verify { text-align: center; font-size: 7.2pt; color: var(--muted); }
.verify .qr { width: 21mm; height: 21mm; margin: 0 auto 1mm; background: #fff; padding: 1mm; }
.verify .qr img, .verify .qr canvas { width: 100% !important; height: 100% !important; display: block; }
.verify .no { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 8pt; color: var(--ink); letter-spacing: .04em; }
.verify .date { margin-top: .8mm; }

@media print {
  html, body { background: #fff; }
  .toolbar { display: none; }
  #certs { padding: 0; gap: 0; display: block; }
  .cert { box-shadow: none; page-break-after: always; break-after: page; }
  .cert:last-child { page-break-after: auto; break-after: auto; }
}
@page { size: A4 landscape; margin: 0; }

/* Ekranda dar pencerede sayfayı küçült */
@media screen and (max-width: 1160px) {
  #certs { zoom: .75; }
}
@media screen and (max-width: 860px) {
  #certs { zoom: .45; }
}

/* Doğrulama sayfası */
.verify-page { max-width: 640px; margin: 40px auto; background: #fff; border-radius: 14px; padding: 28px 30px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.verify-page h1 { font-family: "Source Serif 4", Georgia, serif; color: var(--navy); margin: 0 0 6px; font-size: 26px; }
.verify-page form { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.verify-page input { flex: 1 1 240px; font: 16px ui-monospace, Menlo, Consolas, monospace; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; text-transform: uppercase; }
.verify-page button { background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: 600 15px Inter, sans-serif; cursor: pointer; }
.v-ok { border-left: 4px solid var(--green); background: #eef7f1; padding: 12px 16px; border-radius: 8px; }
.v-bad { border-left: 4px solid #B00020; background: #fdeeee; padding: 12px 16px; border-radius: 8px; }
.v-ok dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
.v-ok dt { color: var(--muted); }
.v-ok dd { margin: 0; font-weight: 500; }
@media (max-width: 520px) { .verify-page { margin: 16px; padding: 20px 16px; } }
