/* ============================================================
   Sof tilim — Mening sertifikatim
   Test natijasi kartalari, ism kiritish va A4 sertifikat varag'i.

   Sertifikat — YOTIQ (landscape) A4: 297 x 210 mm.
   Tuzilishi: tepada brend lentasi, chapda matn, o'ngda muhr.
   ============================================================ */

/* ---------- Testlar holati ----------------------------------- */

.st-sert__testlar { margin-top: 26px; display: grid; gap: 14px; }

.st-sert__test {
  border: 1px solid var(--st-line); border-radius: 16px;
  background: #fff; padding: 18px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.st-sert__test.is-otdi { border-color: #BFE3C8; background: #F5FBF6; }

.st-sert__ic {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #EDF1F7; color: var(--st-muted);
  font: 700 17px/1 var(--st-font);
}
.st-sert__test.is-otdi .st-sert__ic { background: #DDF2E2; color: #0B7A2E; }

.st-sert__matn { flex: 1 1 260px; min-width: 0; }
.st-sert__matn h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--st-navy); }
.st-sert__matn p { margin: 5px 0 0; font-size: 14px; color: var(--st-muted); line-height: 1.5; }
.st-sert__test.is-otdi .st-sert__matn p b { color: #0B7A2E; }

.st-sert__amal { flex: 0 0 auto; }
.st-sert__amal a { text-decoration: none; }

/* ---------- Ism kiritish ------------------------------------- */

.st-sert__ism {
  margin-top: 22px; padding: 20px;
  border: 1px solid var(--st-line); border-radius: 16px; background: #fff;
}
.st-sert__ism label {
  display: block; margin: 14px 0 7px;
  font-size: 13px; font-weight: 600; color: var(--st-ink-soft);
}
.st-sert__ism input {
  width: 100%; box-sizing: border-box;
  padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--st-line); background: #fff;
  font: 400 15.5px/1.3 var(--st-font); color: var(--st-ink);
}
.st-sert__ism input:focus {
  outline: 0; border-color: var(--st-blue);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, .14);
}
.st-sert__izoh { margin: 9px 0 0; font-size: 13px; color: var(--st-muted); line-height: 1.55; }
.st-sert__tugmalar { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Ro'yxatdagi sertifikat raqami */
.st-sert__raqam {
  display: inline-block; margin-top: 5px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--st-navy); background: #EEF3FB;
  padding: 3px 9px; border-radius: 6px;
}

.st-yuklab { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* `display: flex` HTML dagi `hidden` ni bosib ketadi — shuning uchun alohida qoida.
   Aks holda sertifikat shakllantirilmasdan turib tugmalar ko‘rinib qoladi. */
.st-yuklab[hidden] { display: none !important; }
.st-yuklab__izoh { font-size: 13px; color: var(--st-muted); }

/* ============================================================
   A4 YOTIQ SERTIFIKAT
   ============================================================ */

.st-varaq-quti { overflow-x: auto; padding: 2px; }

.st-sertifikat {
  position: relative;
  width: 297mm; height: 210mm; margin: 0 auto;
  background: #fff;
  border: 1px solid var(--st-line);
  box-shadow: 0 10px 34px rgba(2, 20, 50, .13);
  box-sizing: border-box;
  padding: 6mm;
  font-family: "Times New Roman", Times, serif;
  color: #10192B;
}

/* Rasmiy qo'sh ramka: tashqi nozik chiziq + ichki qalin chiziq */
.sr-ramka {
  height: 100%; box-sizing: border-box;
  border: .3mm solid var(--st-navy); padding: 1.6mm;
}
.sr-ich {
  position: relative; height: 100%; box-sizing: border-box;
  border: 1mm solid var(--st-navy);
  display: flex; flex-direction: column; overflow: hidden;
}

/* Nozik fon naqshi — pastki o'ng burchakda yumshoq yoyilma */
.sr-ich::after {
  content: ''; position: absolute; right: -60mm; bottom: -80mm;
  width: 200mm; height: 200mm; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
              rgba(34, 187, 251, .07) 0%, rgba(11, 87, 208, .05) 45%, transparent 70%);
  pointer-events: none;
}

/* ---------- Tepadagi brend lentasi --------------------------- */

.sr-lenta {
  position: relative; z-index: 1;
  flex: 0 0 auto; height: 34mm; padding: 0 12mm;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(105deg, #011E4B 0%, var(--st-navy) 38%, var(--st-blue) 100%);
  color: #fff;
}
.sr-lenta__brend { display: flex; flex-direction: column; gap: 3.4mm; min-width: 0; }
.sr-lenta__logo { height: 21mm; width: auto; display: block; }
.sr-lenta__shior {
  font-family: var(--st-font); font-size: 9pt; font-weight: 500;
  letter-spacing: .03em; color: rgba(255, 255, 255, .84);
  max-width: 150mm; line-height: 1.35;
}
.sr-lenta__yorliq {
  text-align: right; font-family: var(--st-font);
  font-size: 8.5pt; font-weight: 600; letter-spacing: .26em;
  text-transform: uppercase; line-height: 1.7; color: rgba(255, 255, 255, .88);
}

/* Lenta ostidagi uch rangli chiziq — brend ranglari */
.sr-chiziq { flex: 0 0 auto; height: 1.4mm; display: flex; position: relative; z-index: 1; }
.sr-chiziq i { display: block; height: 100%; }
.sr-chiziq i:nth-child(1) { width: 46%; background: var(--st-sky); }
.sr-chiziq i:nth-child(2) { width: 32%; background: var(--st-green); }
.sr-chiziq i:nth-child(3) { width: 22%; background: var(--st-blue-bright); }

/* ---------- Tana ---------------------------------------------- */

.sr-tana {
  position: relative; z-index: 1;
  flex: 1 1 auto; min-height: 0;
  padding: 7mm 12mm 7mm;
  display: flex; box-sizing: border-box;
}

.sr-chap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sr-ong {
  flex: 0 0 62mm; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding-top: 2mm;
}

/* Sarlavha */
.sr-sarlavha {
  font-size: 40pt; font-weight: 700; letter-spacing: .02em;
  color: var(--st-navy); line-height: 1;
}
.sr-sarlavha-en {
  margin-top: 2.5mm; font-family: var(--st-font);
  font-size: 10pt; letter-spacing: .34em; text-transform: uppercase; color: #7F8DA3;
}
.sr-rule {
  margin-top: 5mm; width: 62mm; height: 1.1mm; border-radius: 1mm;
  background: linear-gradient(90deg, var(--st-blue) 0%, var(--st-sky) 70%, transparent 100%);
}

.sr-berildi { margin-top: 7mm; font-size: 13pt; color: #46566E; }

/* Ism — sertifikatning eng muhim satri. Uzun familiya kelsa ham
   shrift kichraytirilmaydi: matn keyingi qatorga o'tadi. */
.sr-ism {
  margin-top: 3mm; padding-bottom: 3.5mm;
  font-size: 29pt; font-weight: 700; color: #061B3D; line-height: 1.22;
  border-bottom: .7mm solid #E3EAF4;
  max-width: 182mm; overflow-wrap: break-word;
}

/* Yo'nalish nomi — sertifikat nimani tasdiqlashini bir qarashda
   ko'rsatadigan satr. Ismdan keyin, tavsifdan oldin turadi. */
.sr-yonalish {
  margin-top: 6mm; font-size: 19pt; font-weight: 700; line-height: 1.3;
  color: var(--st-navy); max-width: 182mm;
}

.sr-tavsif {
  margin-top: 3mm; font-size: 13pt; line-height: 1.5; color: #1A2334;
  max-width: 182mm;
}
.sr-tavsif b { color: var(--st-navy); }
.sr-tavsif-en {
  margin-top: 3mm; font-size: 10.5pt; line-height: 1.45;
  color: #5A6B85; font-style: italic; max-width: 182mm;
}

/* Natija belgilari */
.sr-natija { margin-top: auto; padding-top: 6mm; display: flex; gap: 6mm; }
.sr-belgi {
  min-width: 40mm; padding: 4mm 7mm;
  border: .5mm solid #DCE6F5; border-radius: 3mm; background: #F7FAFF;
}
.sr-belgi .k {
  font-family: var(--st-font); font-size: 7.5pt; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: #7286A3;
}
.sr-belgi .q {
  margin-top: 1.5mm; font-size: 19pt; font-weight: 700; color: var(--st-blue);
}

/* Oyoq — sana va platforma */
.sr-oyoq {
  margin-top: 6mm; padding-top: 4.5mm; border-top: .3mm solid #E8EEF7;
  display: flex; justify-content: space-between; align-items: flex-end;
  font-size: 10.5pt; color: #46566E;
}
.sr-oyoq b { color: #10192B; }
.sr-oyoq .manzil { text-align: right; font-family: var(--st-font); font-size: 9.5pt; }

/* Sertifikat raqami va tekshirish havolasi — varaqning oyoq qismida.
   Raqamsiz sertifikatni tekshirib bo'lmaydi, shuning uchun u sanadan
   keyin, ko'zga tashlanadigan joyda turadi. */
.sr-raqam {
  margin-top: 1.6mm; font-family: var(--st-font); font-size: 9pt;
  letter-spacing: .02em; color: #46566E;
}
.sr-raqam b { letter-spacing: .1em; color: var(--st-navy); }
.sr-tekshir {
  margin-top: 1mm; font-family: var(--st-font); font-size: 8pt;
  color: #7286A3;
}

/* Tizim maqomi — varaqning eng pastida, oyoq chizig‘idan keyin.
   Ko‘zga tashlanmaydi, lekin o‘qishga qiynalmaydigan darajada:
   sertifikat rasmiy hujjat emasligi undan foydalanadigan odamga
   ham, uni ko‘rsatilgan tomonga ham ayon bo‘lishi kerak. */
.sr-maqom {
  margin-top: 3.2mm; font-family: var(--st-font); font-size: 8.5pt;
  line-height: 1.35; color: #6B7C96;
}

/* ---------- O'ngdagi muhr ------------------------------------- */

.sr-muhr {
  width: 52mm; height: 52mm; border-radius: 50%;
  border: 1.1mm solid var(--st-navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; position: relative;
}
.sr-muhr::before {
  content: ''; position: absolute; inset: 2.2mm;
  border: .35mm solid var(--st-sky); border-radius: 50%;
}
.sr-muhr__mark { width: 19mm; height: 19mm; display: block; }
.sr-muhr__nom {
  margin-top: 1.5mm; font-family: var(--st-font);
  font-size: 8pt; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--st-navy);
}
.sr-muhr__yil {
  margin-top: .6mm; font-family: var(--st-font);
  font-size: 7pt; letter-spacing: .14em; color: #7286A3;
}

/* ---------- Ekranda kichraytirish ----------------------------- */

@media (max-width: 1180px) {
  .st-sertifikat { transform: scale(.78); transform-origin: top left; }
  .st-varaq-quti { height: calc(210mm * .78 + 6px); }
}
@media (max-width: 900px) {
  .st-sertifikat { transform: scale(.55); }
  .st-varaq-quti { height: calc(210mm * .55 + 6px); }
}

/* ---------- Chop etish ---------------------------------------- */

@media print {
  .st-side, .st-work__bar, .st-veil, .st-h1, .st-sub,
  .st-sert__testlar, .st-sert__ism, .st-yuklab { display: none !important; }

  .st-app { display: block; }
  .st-work__body { padding: 0; max-width: none; }
  .st-varaq-quti {
    overflow: visible !important; padding: 0;
    height: auto !important;
  }
  body { background: #fff; }

  .st-sertifikat {
    width: 297mm; height: 210mm; margin: 0;
    border: 0; box-shadow: none;
    transform: none !important;
  }
  .st-sertifikat::after,
  .sr-lenta, .sr-chiziq, .sr-belgi, .sr-muhr {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  @page { size: A4 landscape; margin: 0; }
}
