/* ═══════════ RESET & BASE ═══════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f8f9fa; color: #333; font-size: 16px; line-height: 1.6;
}
a { color: #1a6ef5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════ HEADER ═══════════ */
.site-header {
    background: #fff; border-bottom: 1px solid #e0e0e0; padding: 0 20px;
    position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
    max-width: 1200px; margin: 0 auto; display: flex;
    align-items: center; justify-content: space-between; height: 60px;
}
.logo { font-size: 22px; font-weight: 700; color: #1a6ef5; text-decoration: none; }
.logo span { color: #34a853; }
.header-nav a { margin-left: 20px; color: #555; font-size: 14px; }
.header-nav a:hover { color: #1a6ef5; text-decoration: none; }
@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;      /* разрешаем перенос */
        height: auto;         /* высота подстроится под 2 строки */
        padding: 10px 0;
    }
    .header-nav {
        display: flex;        /* показываем ссылки (было none) */
        width: 100%;          /* переносим их под лого */
        justify-content: center;
        gap: 20px;
        margin-top: 8px;
    }
    .header-nav a {
        margin-left: 0;       /* убираем отступ — теперь работает gap */
        white-space: nowrap;  /* "DOC в PDF" не разорвётся */
    }
}
.bookmark-link {
    cursor: pointer;
}
.bookmark-link:hover {
    color: #34a853 !important;  /* зелёный при наведении, как акцент лого */
}

/* ═══════════ AD SLOTS ═══════════ */
.ad-slot {
    background: #f0f0f0; border: 1px dashed #ccc; display: flex;
    align-items: center; justify-content: center; color: #999;
    font-size: 12px; overflow: hidden;
}
.ad-top { width: 100%; height: 90px; max-width: 728px; margin: 10px auto; }
@media (max-width: 768px) { .ad-top { height: 100px; max-width: 320px; } }

/* ═══════════ LAYOUT ═══════════ */
.page-wrap {
    max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px;
    display: grid; grid-template-columns: 1fr 300px;
    grid-template-areas: "main sidebar"; gap: 24px;
}
@media (max-width: 900px) {
    .page-wrap { grid-template-columns: 1fr; grid-template-areas: "main" "sidebar"; }
}

/* ═══════════ MAIN ═══════════ */
.main-content { grid-area: main; min-width: 0; }
.page-title { font-size: 28px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; line-height: 1.2; }
.page-subtitle { font-size: 16px; color: #666; margin-bottom: 24px; }
@media (max-width: 768px) {
    .page-title { font-size: 22px; }
    .page-subtitle { font-size: 14px; }
}

/* ═══════════ TABS ═══════════ */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tab-btn {
    padding: 8px 13px; border: 1px solid #ccc; background: #fff;
    cursor: pointer; font-size: 13px; border-radius: 6px; color: #444;
    transition: background .2s, border-color .2s;
}
.tab-btn:hover { border-color: #1a6ef5; background: #f0f6ff; }
.tab-btn.active { background: #1a6ef5; color: #fff; border-color: #1a6ef5; font-weight: 700; }
@media (max-width: 600px) {
    .tab-btn { font-size: 12px; padding: 7px 10px; flex: 1 1 auto; text-align: center; }
}

/* ═══════════ PANEL / FORM ═══════════ */
.panel { display: none; }
.panel.active { display: block; }
.upload-card {
    background: #fff; border-radius: 12px; padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08); margin-bottom: 24px;
}
@media (max-width: 480px) { .upload-card { padding: 16px; } }

/* Dropzone */
.dropzone {
    border: 2px dashed #1a6ef5; border-radius: 10px; padding: 32px 20px;
    text-align: center; cursor: pointer; margin-bottom: 16px;
    transition: border-color .2s, background .2s; position: relative; background: #f0f6ff;
}
.dropzone:hover, .dropzone.dragover { border-color: #0d4fc4; background: #e0edff; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-icon { font-size: 40px; margin-bottom: 8px; }
.dropzone-text { font-size: 16px; color: #333; font-weight: 600; }
.dropzone-sub  { font-size: 13px; color: #888; margin-top: 4px; }
.dropzone.has-file { border-color: #34a853; background: #f0fff4; }
.dropzone.has-file .dropzone-text { color: #34a853; font-weight: bold; }
@media (max-width: 480px) {
    .dropzone { padding: 24px 14px; }
    .dropzone-icon { font-size: 34px; }
    .dropzone-text { font-size: 14px; }
}

/* Radio row */
.radio-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.radio-row label {
    font-size: 14px; padding: 8px 14px; border: 1px solid #e0e0e0;
    border-radius: 8px; cursor: pointer; transition: border-color .2s, background .2s;
}
.radio-row label:has(input:checked) { border-color: #1a6ef5; background: #f0f6ff; color: #1a6ef5; font-weight: 600; }
@media (max-width: 480px) {
    .radio-row { gap: 8px; }
    .radio-row label { flex: 1 1 auto; text-align: center; }
}

/* Select */
select {
    padding: 10px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 14px; margin-bottom: 16px; width: 100%; background: #fff;
}

/* Submit */
button[type=submit] {
    display: block; width: 100%; padding: 15px;
    background: linear-gradient(135deg, #1a6ef5, #0d4fc4); color: #fff;
    border: none; border-radius: 8px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: opacity .2s, transform .1s;
}
button[type=submit]:hover:not(:disabled) { opacity: .92; transform: translateY(-1px); }
button[type=submit]:disabled { background: #aaa; cursor: not-allowed; }

/* Progress */
.progress-wrap { display: none; margin-bottom: 14px; }
.progress-wrap.show { display: block; }
.progress-label { font-size: 13px; color: #555; margin-bottom: 5px; }
.progress-bar-bg { background: #eee; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar { height: 8px; border-radius: 20px; background: #1a6ef5; width: 40%; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0%{margin-left:-40%} 100%{margin-left:100%} }

/* Messages */
.msg {
    padding: 16px 20px; background: #e6f4ea; border: 1px solid #34a853;
    border-radius: 10px; margin-bottom: 20px; font-size: 15px; color: #1e7e34;
}
.msg.err { background: #fff3f3; border-color: #e53935; color: #c62828; }
.action-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
a.dl {
    padding: 12px 24px; background: #34a853; color: #fff; text-decoration: none;
    border-radius: 8px; font-size: 15px; font-weight: 700;
}
a.dl:hover { opacity: .88; text-decoration: none; }
a.del {
    display: inline-flex; align-items: center; gap: 5px; padding: 12px 18px;
    background: #fff; color: #d32f2f; border: 1px solid #d32f2f;
    text-decoration: none; border-radius: 8px; font-size: 15px;
}
a.del:hover { background: #fdecea; text-decoration: none; }

.hint { font-size: 13px; color: #888; margin-bottom: 14px; }

/* Native ad in content */
.ad-native { width: 100%; min-height: 90px; margin: 20px 0; }
.ad-after-content { width: 100%; max-width: 728px; height: 90px; margin: 20px auto; }
@media (max-width: 768px) { .ad-after-content { max-width: 300px; height: 250px; } }

/* ═══════════ SIDEBAR ═══════════ */
.sidebar { grid-area: sidebar; }
.sidebar-sticky { position: sticky; top: 80px; }
.ad-sidebar-top { width: 300px; height: 250px; margin-bottom: 16px; }
.ad-sidebar-bottom { width: 300px; height: 600px; }
@media (max-width: 900px) {
    .sidebar-sticky { position: static; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
    .ad-sidebar-bottom { display: none; }
    .ad-sidebar-top { width: 100%; max-width: 336px; margin-bottom: 0; }
}

/* ═══════════ STICKY BOTTOM AD ═══════════ */
.ad-sticky-bottom {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    display: flex; justify-content: center; pointer-events: none;
}
.ad-sticky-bottom > * { pointer-events: all; }
.ad-sticky-inner {
    width: 728px; height: 90px; background: #f0f0f0; border: 1px dashed #ccc;
    display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px;
}
@media (max-width: 768px) { .ad-sticky-inner { width: 320px; height: 50px; } }
.ad-sticky-close {
    position: absolute; top: -24px; right: 0; background: #555; color: #fff;
    border: none; padding: 2px 8px; font-size: 12px; cursor: pointer;
    border-radius: 4px 4px 0 0; pointer-events: all;
}

/* ═══════════ FOOTER ═══════════ */
.site-footer {
    background: #fff; border-top: 1px solid #e0e0e0; padding: 24px 16px 90px;
    text-align: center; font-size: 13px; color: #999; margin-top: 20px;
}
.site-footer a { color: #888; margin: 0 8px; }


/* ═══════════ СONTENT ═══════════ */
.content-card {
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  line-height: 1.7;
  color: #1f2937;
}

.content-card h1 {
  margin-top: 0;
}

.content-card h2 {
  margin-top: 32px;
  margin-bottom: 14px;
  font-size: 24px;
  color: #111827;
}

.content-card p {
  margin: 0 0 16px;
}

.content-card ul {
  margin: 0 0 20px 22px;
  padding: 0;
}

.content-card li {
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .content-card {
    padding: 22px;
    border-radius: 14px;
  }

  .content-card h2 {
    font-size: 21px;
  }
}

/* ═══════════ E-MAIL ═══════════ */
.contact-email {
  font-size: 20px;
  font-weight: 600;
  margin: 4px 0 24px;
}

.contact-email a {
  color: #2563eb;
  text-decoration: none;
}

.contact-email a:hover {
  text-decoration: underline;
}

.info-block {
    max-width: 820px;
    margin: 24px auto;
    padding: 20px 24px;
    color: #444;
    font-size: 15px;
    line-height: 1.6;
}
.info-block h2 {
    color: #1a6ef5;
    font-size: 20px;
    margin-bottom: 12px;
}
.info-block p { margin-bottom: 10px; }

.dropzone.too-big {
    border-color: #e53935;
    background: #fff5f5;
}
.dropzone.too-big .dropzone-text {
    color: #e53935;
}
