/* Доджикси · общий стиль для конструкторов документов */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f6f8fb;color:#0f172a;line-height:1.55}
.wrap{max-width:980px;margin:0 auto;padding:14px}

header{padding:14px 0;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.brand{font-weight:800;font-size:1.4rem;color:#0f172a;text-decoration:none}
.brand span{color:#4da3ff}
header nav{display:flex;gap:6px;margin-left:auto}
header nav a{color:#475569;text-decoration:none;padding:6px 10px;border-radius:8px;font-size:.92rem}
header nav a:hover{background:#fff;color:#0f172a}

.doc-hero{background:linear-gradient(135deg,#eef4ff 0%,#fef3f7 100%);border:1px solid #e0e7ef;border-radius:18px;padding:24px 22px;margin-bottom:18px}
.doc-hero h1{margin:0 0 6px;font-size:1.65rem;font-weight:800;letter-spacing:-.02em}
.doc-hero p{margin:0;color:#475569;font-size:.96rem}

.doc-grid{display:grid;grid-template-columns:1fr 1.1fr;gap:18px}
@media (max-width:840px){.doc-grid{grid-template-columns:1fr}}

.doc-form{background:#fff;border:1px solid #e5ebf3;border-radius:14px;padding:18px}
.doc-form h2{margin:0 0 12px;font-size:1.05rem;color:#0f172a}
.doc-form label{display:block;margin:0 0 12px;font-size:.88rem;color:#475569;font-weight:500}
.doc-form label > span{display:block;margin-bottom:4px}
.doc-form input,.doc-form textarea,.doc-form select{width:100%;padding:10px 12px;border:1px solid #d2dbe8;border-radius:8px;font-size:.95rem;font-family:inherit;outline:none;background:#fff;color:#0f172a}
.doc-form input:focus,.doc-form textarea:focus,.doc-form select:focus{border-color:#4da3ff;box-shadow:0 0 0 3px rgba(77,163,255,.12)}
.doc-form textarea{resize:vertical;min-height:80px}
.doc-form .hint{color:#94a3b8;font-size:.78rem;margin-top:4px}
.doc-form .row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:520px){.doc-form .row{grid-template-columns:1fr}}
.doc-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.btn{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;border-radius:10px;font-weight:600;cursor:pointer;border:1px solid transparent;font-size:.92rem;text-decoration:none}
.btn-primary{background:#0f172a;color:#fff;border-color:#0f172a}
.btn-primary:hover{background:#1e293b}
.btn-outline{background:#fff;color:#0f172a;border-color:#cbd5e1}
.btn-outline:hover{background:#f1f5fa;border-color:#0f172a}

.doc-preview-wrap{background:#fff;border:1px solid #e5ebf3;border-radius:14px;padding:14px}
.doc-preview-wrap h2{margin:0 0 12px;font-size:1.05rem;color:#0f172a}
.doc-preview{background:#fff;color:#0f172a;font-family:'Times New Roman',serif;font-size:14pt;line-height:1.55;padding:42px 56px;min-height:600px;border:1px solid #e5ebf3;border-radius:8px;white-space:normal}
.doc-preview h3{font-size:14pt;text-align:center;margin:0 0 18px;font-weight:bold}
.doc-preview p{margin:0 0 12px;text-indent:30px}
.doc-preview .signature-line{display:inline-block;border-bottom:1px solid #0f172a;min-width:180px;text-align:center}
.doc-preview .place-date{display:flex;justify-content:space-between;margin:24px 0 16px}
.doc-preview .signatures{margin-top:32px;display:grid;grid-template-columns:1fr;gap:18px}
.doc-preview .sign-row{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}

.note{background:#fffbe6;border-left:4px solid #f59e0b;padding:10px 14px;border-radius:6px;margin:14px 0;font-size:.88rem;color:#475569}
.note b{color:#0f172a}

footer{margin:30px 0 14px;text-align:center;color:#94a3b8;font-size:.85rem}
footer a{color:#64748b;text-decoration:none}
footer a:hover{color:#0f172a}

@media print{
  header,.doc-form,.doc-preview-wrap > h2,.doc-actions,.doc-hero,footer,.theme-toggle{display:none !important}
  body,.wrap,.doc-grid,.doc-preview-wrap,.doc-preview{background:#fff !important;color:#000 !important;border:none !important;padding:0 !important;margin:0 !important;box-shadow:none !important}
  .doc-grid{display:block}
  .doc-preview{padding:0 !important;border:none !important}
  @page{margin:2cm}
}

/* Тёмная тема */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0b1220;color:#e2e8f0}
html[data-theme="dark"] .brand{color:#fff}
html[data-theme="dark"] header nav a{color:#cbd5e1}
html[data-theme="dark"] header nav a:hover{background:#1e293b;color:#fff}
html[data-theme="dark"] .doc-hero{background:linear-gradient(135deg,#162033 0%,#1a1f2e 100%);border-color:#334155}
html[data-theme="dark"] .doc-hero p{color:#cbd5e1}
html[data-theme="dark"] .doc-form,html[data-theme="dark"] .doc-preview-wrap{background:#1e293b;border-color:#334155}
html[data-theme="dark"] .doc-form h2,html[data-theme="dark"] .doc-preview-wrap h2{color:#f8fafc}
html[data-theme="dark"] .doc-form label{color:#cbd5e1}
html[data-theme="dark"] .doc-form input,html[data-theme="dark"] .doc-form textarea,html[data-theme="dark"] .doc-form select{background:#0f172a;border-color:#334155;color:#e2e8f0}
html[data-theme="dark"] .doc-form input:focus,html[data-theme="dark"] .doc-form textarea:focus,html[data-theme="dark"] .doc-form select:focus{border-color:#60a5fa}
html[data-theme="dark"] .btn-primary{background:#3b82f6;border-color:#3b82f6}
html[data-theme="dark"] .btn-primary:hover{background:#2563eb}
html[data-theme="dark"] .btn-outline{background:#1e293b;color:#e2e8f0;border-color:#334155}
html[data-theme="dark"] .btn-outline:hover{background:#283448;border-color:#60a5fa}
html[data-theme="dark"] .doc-preview{background:#f8fafc;color:#0f172a;border-color:#475569}
html[data-theme="dark"] .note{background:#1e293b;color:#cbd5e1}
html[data-theme="dark"] .note b{color:#fbbf24}
html[data-theme="dark"] footer{color:#64748b}
html[data-theme="dark"] footer a{color:#94a3b8}

.theme-toggle{background:transparent;border:1px solid #d2dbe8;border-radius:8px;width:36px;height:36px;cursor:pointer;font-size:1rem;display:flex;align-items:center;justify-content:center;color:#475569;padding:0;margin-left:6px;transition:.15s}
.theme-toggle:hover{background:#fff;border-color:#0f172a;color:#0f172a}
html[data-theme="dark"] .theme-toggle{border-color:#334155;color:#cbd5e1}
html[data-theme="dark"] .theme-toggle:hover{background:#1e293b;color:#fff;border-color:#475569}
