:root{
  --blue:#0056e0;
  --blue-dark:#0041b8;
  --bg:#f3f4fb;
  --text:#1f2937;
  --muted:#6b7280;
}

*{box-sizing:border-box;}
html,body{height:100%;}

body{
  margin:0;
  font-family:"Montserrat","Segoe UI",sans-serif;
  background:var(--bg);
}

/* Ортасына карта қою */
.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 16px;
}

.card{
  width:100%;
  max-width:1120px;
  min-height:360px;
  background:#ffffff;
  border-radius:22px;
  display:grid;
  grid-template-columns:1.05fr .95fr;
  overflow:hidden;
  box-shadow:0 18px 45px rgba(15,23,42,.12);
}

/* Сол жақ бөлік */
.card-left{
  background:var(--blue);
  color:#ffffff;
  padding:48px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;        /* ✅ тік ортасына */
  text-align:center;
  gap:14px;
}
.logo-wrap{
  margin-bottom:22px;
}
.logo{
  max-width:320px;
  width:100%;
  filter:drop-shadow(0 8px 18px rgba(0,0,0,.35));
}
.left-title{
  font-weight:700;
  letter-spacing:.08em;
  font-size:16px;
  text-transform:uppercase;
  opacity:.9;
}
.left-text{
  font-size:16px;
  opacity:.95;
  line-height:1.5;
}

/* Соц. желілер */
.social{
  margin-top:40px;
  display:flex;
  gap:12px;
}
.social a{
  width:44px; height:44px;
  border-radius:50%;
  background:rgba(255,255,255,.15);
  display:flex; align-items:center; justify-content:center;
  color:#fff;
  font-size:19px;
  text-decoration:none;
  transition:.2s;
}
.social a:hover{
  background:rgba(255,255,255,.3);
  transform:translateY(-2px);
}

/* Оң жақ бөлік */
.card-right{
  background:#ffffff;
  padding:40px 56px;
  display:flex;
  align-items:center;             /* ✅ тік ортасына */
  justify-content:center;
}
.right-inner{
  width:100%;
  max-width:460px;
}
.home-link{
  width:max-content;
  max-width:100%;
  min-height:34px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0 0 18px;
  padding:8px 11px;
  border-radius:10px;
  color:var(--blue);
  background:#eef5ff;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
}
.home-link:hover{
  background:#dbeafe;
}
.title{
  margin:0;
  font-size:22px;
  font-weight:800;
  color:#1f2937;
  text-align:center;
}
.title-underline{
  width:60px;
  height:4px;
  border-radius:999px;
  background:var(--blue);
  margin:10px auto 24px;
}

/* Форма */
.check-form{
  display:flex;
  flex-direction:column;
  gap:25px;
  align-items:center;
}
.field{
  width:100%;
}
.check-input{
  width:100%;
  padding:11px 16px;
  border-radius:12px;
  border:1px solid #93c5fd;
  background:#f9fafb;
  font-size:14px;
  outline:none;
}
.check-input::placeholder{
  color:#9ca3af;
}
.check-input:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 2px rgba(147,197,253,.45);
  background:#ffffff;
}

.btn-check{
  width:200px;
  padding:12px 20px;
  border-radius:12px;
  border:none;
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  color:#ffffff;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(37,99,235,.45);
  transition:.15s;
}
.btn-check:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
}

/* ===== НӘТИЖЕ БЛОГЫ (жаңа, әдемі дизайн) ===== */

#publicResult{
  margin-top:10px;
  min-height:16px;              /* биіктік аздап қана өседі */
}



/* Нәтиже аймағының жалпы қаптамасы */
.result-shell{
  margin-top: 18px;
  min-height: 283px;           /* 👈 тұрақты биіктік */
  display: flex;
  align-items: stretch;
 }

/* Бастапқы текст пен карточка – екеуі де осы рамка ішінде */
.result-placeholder,
.result-card{
  width: 100%;
}

/* Бастапқы кезде текст ортасында тұрсын */
.result-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  color:#9ca3af;
  text-align:center;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid #93c5fd;
  background:#f9fafb;
}




/* === GOVERNMENT OFFICIAL CLEAN (ресми нәтиже картасы) === */

/* Карточка */
/* === НӘТИЖЕ КАРТОЧКАСЫ – РЕСМИ СТИЛЬ + ТҮЗЕТУЛЕР === */

.result-card{
  position: relative;
  padding: 18px 24px 22px 40px;   /* сол жақтан көбірек орын – сызық іште */
  border-radius: 12px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  font-size:13px;

  /* PDF батырманы төменге итеру үшін */
  min-height: 210px;
  display:flex;
  flex-direction:column;
}

/* Жасыл/қызыл сызық – КАРТОЧКАНЫҢ ІШІНДЕ, шеттен 10px */
.result-card.valid{
  border-color:#bbf7d0;
}
.result-card.valid::before{
  content:"";
  position:absolute;
  left:14px;          /* ішке кіріп тұр */
  top:16px;
  bottom:16px;
  width:3px;
  border-radius:999px;
  background:#22c55e;
}

.result-card.invalid{
  border-color:#fecaca;
}
.result-card.invalid::before{
  content:"";
  position:absolute;
  left:14px;
  top:16px;
  bottom:16px;
  width:3px;
  border-radius:999px;
  background:#ef4444;
}

/* Тақырып түсі */
.result-title{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
  color:#111827;
}
.result-card.valid .result-title{
  color:#16a34a;
}
.result-card.invalid .result-title{
  color:#dc2626;
}

/* Жолдар */
.result-row{
  display:grid;
  grid-template-columns:140px 1fr;
  padding:4px 0;
  border-bottom:1px solid #f1f5f9;
}
.result-row:last-child{
  border-bottom:none;
}

.result-label{
  color:#6b7280;
  font-size:13px;
}
.result-value{
  color:#111827;
  font-weight:600;
  font-size:13px;
}

/* PDF батырмасы – карта астыңғы жағында */
.result-actions{
  margin-top:auto;            /* қосымша бос орынды төменге итереді */
  padding-top:2px;
  display:flex;
  justify-content:flex-end;
}

/* PDF батырмасының стилі */
.btn-pdf{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:12px 18px;
  border:none;
  border-radius:10px;
  background:#f97316;
  color:#ffffff;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(249,115,22,0.35);
  transition:0.15s;
}
.btn-pdf i{
  font-size:13px;
}
.btn-pdf:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}







/* Footer */
.footer{
  margin-top:20px;
  font-size:11.5px;
  color:#9ca3af;
  text-align:center;
}

/* Toast */
.toast-backdrop{
  position:fixed;
  inset:0;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  pointer-events:none;
  z-index:50;
}
.toast-box{
  margin-top:18px;
  padding:8px 20px;
  border-radius:12px;
  background:#22c55e;
  color:#ffffff;
  font-size:13px;
  font-weight:600;
  box-shadow:0 12px 30px rgba(16,185,129,.5);
  pointer-events:auto;
}
.toast-box.error{
  background:#ef4444;
  box-shadow:0 12px 30px rgba(239,68,68,.5);
}

/* Responsive */
@media(max-width:900px){
  .card{
    grid-template-columns:1fr;
    max-width:520px;
  }
  .card-left{
    padding:32px 26px;
  }
  .card-right{
    padding:30px 24px 34px;
  }
}


/* === PDF жүктеу батырмасының контейнері === */
.result-actions{
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;   /* 👉 Оң жаққа */
}

/* === PDF батырмасының стилі === */
.btn-pdf{
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: #f97316;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(249,115,22,0.35);
  transition: 0.15s;
}

.btn-pdf i{
  font-size: 14px;
}

.btn-pdf:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* === Public check page polish: PDF button + responsive stability === */
.card{
  min-height: min(586px, calc(100vh - 24px));
}

.right-inner{
  min-width: 0;
}

.result-shell{
  width: 100%;
  min-height: 274px;
}

.result-card{
  overflow: hidden;
}

.result-row{
  grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
  column-gap: 12px;
}

.result-value{
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.result-card .result-actions{
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.result-card .download-btn,
.result-card .btn-pdf{
  appearance: none;
  width: auto;
  min-width: 142px;
  min-height: 40px;
  justify-content: center;
  gap: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37,99,235,.24);
}

.result-card .download-btn i,
.result-card .btn-pdf i{
  font-size: 15px;
}

.result-card .download-btn:hover,
.result-card .btn-pdf:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(37,99,235,.3);
}

.result-card .download-btn:focus-visible,
.result-card .btn-pdf:focus-visible,
.btn-check:focus-visible,
.check-input:focus-visible{
  outline: 3px solid rgba(37,99,235,.28);
  outline-offset: 2px;
}

@media (min-width:901px) and (max-height:720px){
  .page{
    align-items: center;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .card{
    min-height: auto;
  }
  .card-left{
    padding-top: 34px;
    padding-bottom: 34px;
  }
  .logo{
    max-width: 270px;
  }
  .social{
    margin-top: 26px;
  }
  .card-right{
    padding-top: 30px;
    padding-bottom: 30px;
  }
  .check-form{
    gap: 22px;
  }
  .result-shell{
    min-height: 252px;
  }
  .footer{
    margin-top: 14px;
  }
}

@media(max-width:900px){
  .page{
    align-items: flex-start;
    padding: 18px 14px;
  }
  .card{
    min-height: 0;
    max-width: 560px;
  }
  .logo{
    max-width: 260px;
  }
  .left-text{
    max-width: 420px;
  }
  .social{
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .right-inner{
    max-width: 100%;
  }
  .result-shell{
    min-height: 0;
  }
}

@media(max-width:560px){
  .page{
    padding: 0;
  }
  .card{
    border-radius: 0;
    box-shadow: none;
  }
  .card-left{
    padding: 28px 18px 24px;
  }
  .logo{
    max-width: 220px;
  }
  .left-text{
    font-size: 14px;
  }
  .social a{
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .card-right{
    padding: 26px 16px 30px;
  }
  .title{
    font-size: 20px;
    line-height: 1.25;
  }
  .check-form{
    gap: 18px;
  }
  .btn-check{
    width: 100%;
    min-height: 44px;
  }
  .result-card{
    padding: 18px 18px 20px 34px;
  }
  .result-row{
    grid-template-columns: 1fr;
    row-gap: 2px;
    padding: 6px 0;
  }
  .result-label,
  .result-value{
    font-size: 12.5px;
  }
  .result-card .result-actions{
    justify-content: stretch;
    padding-top: 16px;
  }
  .result-card .download-btn,
  .result-card .btn-pdf{
    width: 100%;
    min-width: 0;
  }
}

/* Cross-browser base guards */
html{
  -webkit-text-size-adjust:100%;
}
button,
input{
  font:inherit;
}
img{
  max-width:100%;
  height:auto;
}
.page{
  min-height:100vh;
  min-height:100dvh;
}

/* Phone fit: keep the public check card inside the viewport */
@media(max-width:560px){
  .page{
    padding:12px 0;
    align-items:flex-start;
    justify-content:center;
    overflow-x:hidden;
  }
  .card{
    display:flex;
    flex-direction:column;
    width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important;
    margin:0 auto;
    border:1px solid #e8eef8;
    border-radius:18px;
    box-shadow:0 12px 30px rgba(15,23,42,.08);
    overflow:hidden;
  }
  .card-left{
    width:100%;
    padding:24px 18px 22px;
  }
  .card-right{
    width:100%;
    padding:24px 16px 28px;
  }
  .home-link{
    min-height:38px;
    font-size:12.5px;
  }
  .card-left,
  .card-right,
  .right-inner,
  .check-form,
  .field,
  .result-shell,
  .result-placeholder,
  .footer{
    max-width:100%;
    min-width:0;
  }
  .left-text,
  .title,
  .result-placeholder,
  .footer{
    overflow-wrap:break-word;
  }
  .check-input,
  .btn-check{
    width:100%;
    max-width:100%;
    min-width:0;
  }
  .check-input{
    font-size:16px;
  }
}

/* LED display fit is opt-in with ?led=1 so normal desktop stays unchanged */
@media (min-width:901px){
  html.led-mode .card{
    transform:scale(.9);
    transform-origin:center center;
  }
}
