
:root{
  --blue:#1f4699;
  --blue-2:#dae3f3;
  --bg:#eef3fb;
  --line:#d7dfef;
  --text:#172033;
  --danger-bg:#fdecec;
  --danger:#b62f23;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}
.wrap{
  max-width:1200px;
  margin:24px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
}
.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  padding:24px;
  box-shadow:0 8px 30px rgba(27,56,119,.05);
}
h1,h2{margin:0 0 8px}
.sub{margin:0 0 18px;color:#55617c}
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
label{display:grid;gap:8px}
label span{font-size:14px;font-weight:600}
label.full{grid-column:1/-1}
input{
  width:100%;
  border:1px solid #c8d3ea;
  border-radius:14px;
  padding:14px 16px;
  font-size:16px;
  outline:none;
}
input:focus{border-color:var(--blue)}
.row{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
button{
  border:0;
  border-radius:18px;
  background:var(--blue);
  color:#fff;
  padding:16px 22px;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}
button.secondary{
  background:var(--blue-2);
  color:var(--blue);
}
button:disabled{opacity:.5;cursor:not-allowed}
.status{
  margin-top:18px;
  border-radius:18px;
  padding:18px 20px;
  font-size:16px;
}
.status.error{
  background:var(--danger-bg);
  color:var(--danger);
  border:1px solid #f3b9b4;
}
.status.ok{
  background:#eef9ef;
  color:#14622e;
  border:1px solid #bfe0c4;
}
.hidden{display:none}
.preview{
  min-height:220px;
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  background:#fff;
}
.doc{
  max-width:760px;
  margin:0 auto;
  font-family:"Times New Roman", Georgia, serif;
  color:#111;
}
.doc-header{
  text-align:center;
  line-height:1.35;
  margin-bottom:28px;
  font-size:16px;
}
.doc-header .main{font-weight:700}
.doc-title{
  text-align:center;
  font-size:26px;
  font-weight:700;
  letter-spacing:.5px;
  margin-bottom:18px;
}
.doc-meta{
  display:flex;
  justify-content:space-between;
  gap:24px;
  margin-bottom:18px;
  font-size:17px;
}
.doc-body{
  font-size:18px;
  line-height:1.7;
  text-align:justify;
}
.doc-closing{
  margin-top:18px;
  font-size:17px;
  line-height:1.6;
}
.doc-sign{
  margin-top:40px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
}
.stamp{
  width:170px;
  height:80px;
  border:1px dashed #666;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  color:#555;
}
@media (max-width:800px){
  .grid{grid-template-columns:1fr}
}

#preview .doc{width:100%;max-width:760px;aspect-ratio:1.414/1;background:#fff;padding:34px 44px;overflow:hidden;}

#preview .doc-header .main,#preview .doc-title,#preview .doc-body,#preview .doc-closing,#preview .doc-meta,#preview .doc-sign{letter-spacing:0 !important;word-spacing:0 !important;font-kerning:none;font-variant-ligatures:none;}
