/* =========================================================
   Страницы «Контакты и документы»
   ========================================================= */

body.doc-page{
    background: #fff;
    color: var(--ink);
    font-family: 'Rubik', system-ui, sans-serif;
    line-height: 1.6;
}

.doc-shell{
    width: min(980px, calc(100vw - 32px));
    margin: 0 auto;
}
main.doc-shell{ padding: 120px 0 64px; }
main.doc-shell.narrow{ width: min(760px, calc(100vw - 32px)); padding-top: 48px; }

.crumbs{ display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.crumbs a{ color: var(--orange-dark); text-decoration: none; font-weight: 500; }
.crumbs a:hover{ text-decoration: underline; }

.doc-header{
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 36px clamp(22px, 4vw, 44px);
    margin-bottom: 32px;
    border-radius: 24px;
    background: var(--cream);
}
.doc-header h1{
    font-size: clamp(30px, 4.6vw, 52px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.5px;
    color: #2f2f2f;
}
.doc-meta{ display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; color: var(--muted); font-size: 14px; }
.doc-print{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--orange-dark);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.doc-print svg{ width: 17px; height: 17px; }
.doc-print:hover{ background: #FFE3D3; }

.doc-lead{ max-width: 44rem; margin-bottom: 32px; color: var(--ink-soft); font-size: 18px; }

/* --- Оглавление --- */
.doc-toc{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}
.doc-toc a{
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--cream-2);
    color: #9b4a22;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s;
}
.doc-toc a:hover{ background: #FBE0CE; }

/* --- Текст документа --- */
.doc-body{ max-width: 46rem; font-size: 16.5px; }
.doc-body h2{
    margin: 40px 0 14px;
    font-size: 22px;
    font-weight: 700;
    color: #2f2f2f;
    scroll-margin-top: 110px;
}
.doc-body h2:first-child{ margin-top: 0; }
.doc-body p{ margin-bottom: 12px; color: #3d3632; }
.doc-body ul{ margin: 0 0 14px 22px; color: #3d3632; }
.doc-body li{ margin-bottom: 6px; }
.doc-body li::marker{ color: var(--orange); }
.doc-body a{ color: var(--orange-deep); }

/* --- Другие документы --- */
.doc-others{
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}
.doc-others h2{ margin-bottom: 14px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.doc-others ul{ list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.doc-others a{
    display: inline-block;
    padding: 10px 16px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    font-size: 15px;
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.doc-others a:hover{ border-color: var(--orange); color: var(--orange-dark); }

/* --- Хаб: секции --- */
.hub-section{ margin-bottom: 48px; }
.hub-section > h2{
    margin-bottom: 18px;
    font-size: 24px;
    font-weight: 800;
    color: #2f2f2f;
}

.contact-cards{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.c-card{
    display: grid;
    gap: 4px;
    padding: 20px;
    border-radius: 18px;
    background: var(--cream);
    color: var(--ink);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}
.c-card:hover{ transform: translateY(-3px); box-shadow: 0 14px 30px rgba(160, 80, 30, .12); }
.c-ico{
    width: 40px; height: 40px;
    display: grid; place-items: center;
    margin-bottom: 10px;
    border-radius: 12px;
    background: #fff;
    color: var(--orange);
}
.c-ico svg{ width: 20px; height: 20px; }
.c-label{ color: var(--muted); font-size: 13px; }
.c-value{ font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }

.hub-meta{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 18px; color: var(--ink-soft); font-size: 15px; }
.hub-meta b{ color: var(--ink); font-weight: 600; }
.hub-link{ color: var(--orange-deep); font-weight: 600; font-size: 15px; }
.hub-section > .hub-link{ display: inline-block; margin-top: 14px; }

.doc-cards{ display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.d-card{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
    border: 1.5px solid var(--line);
    border-radius: 18px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.d-card:hover{ border-color: var(--orange); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(160, 80, 30, .10); }
.d-num{ color: var(--orange); font-weight: 800; font-size: 14px; }
.d-title{ font-size: 18px; font-weight: 700; line-height: 1.3; }
.d-desc{ color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; flex: 1; }
.d-go{ color: var(--orange-dark); font-weight: 600; font-size: 14px; }

.hub-cta{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px clamp(22px, 4vw, 40px);
    border-radius: 24px;
    background: var(--ink);
    color: #fff;
}
.hub-cta h2{ font-size: 24px; margin-bottom: 4px; }
.hub-cta p{ opacity: .75; }
.hub-cta-actions{ display: flex; flex-wrap: wrap; gap: 10px; }
.hub-cta .btn-ghost{ color: #fff; border-color: rgba(255,255,255,.35); }
.hub-cta .btn-ghost:hover{ border-color: #fff; background: rgba(255,255,255,.08); }

/* --- Кнопки --- */
.btn-primary, .btn-ghost{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, opacity .2s;
}
.btn-primary{ border: 0; background: var(--orange-deep); color: #fff; }
.btn-primary:hover{ background: #a63e12; }
.btn-primary:disabled{ opacity: .45; cursor: not-allowed; }
.btn-ghost{ border: 1.5px solid #e9c7b1; background: transparent; color: var(--orange-dark); }
.btn-ghost:hover{ border-color: var(--orange); }
.doc-actions{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* --- Реквизиты --- */
.req-table{ display: grid; border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; }
.req-table > div{
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}
.req-table > div:last-child{ border-bottom: 0; }
.req-table.compact > div{ grid-template-columns: minmax(130px, 0.6fr) minmax(0, 2fr); }
.req-table dt{ color: var(--muted); font-size: 14px; }
.req-table dd{ font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.req-row{ cursor: pointer; transition: background .15s; }
.req-row:hover, .req-row:focus-visible{ background: #FFF8F3; outline: none; }
.req-copy{ color: var(--orange-dark); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .15s; }
.req-row:hover .req-copy, .req-row:focus-visible .req-copy{ opacity: 1; }
.req-row.copied{ background: #FDEBDD; }
.req-row.copied .req-copy{ opacity: 1; }

.toast{
    position: fixed;
    left: 50%;
    bottom: 24px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 200;
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }

/* --- Бриф --- */
.brief{ display: grid; gap: 24px; max-width: 52rem; }
.brief fieldset{
    display: grid;
    gap: 16px;
    padding: 24px clamp(18px, 3vw, 28px);
    border: 1.5px solid var(--line);
    border-radius: 18px;
}
.brief legend{ padding: 0 8px; margin-left: -8px; font-weight: 800; font-size: 18px; color: #2f2f2f; }
.brief-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.brief label{ display: grid; gap: 6px; font-size: 14.5px; font-weight: 600; color: #3d342e; }
.brief input:not([type=checkbox]), .brief textarea, .brief select{
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    transition: border-color .2s, box-shadow .2s;
}
.brief textarea{ resize: vertical; line-height: 1.5; }
.brief input:focus, .brief textarea:focus, .brief select:focus{ outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgb(224 96 31 / 15%); }
.brief .invalid{ border-color: #c0392b !important; }
.brief-checks{ display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.brief-checks label{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
}
.brief-checks label:has(input:checked){ border-color: var(--orange); background: #FFF8F3; }
.brief input[type=checkbox]{ width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--orange-deep); }
.brief-agree{ display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; font-size: 13.5px !important; color: var(--ink-soft) !important; cursor: pointer; }
.brief-agree a{ color: var(--orange-deep); }
.brief-msg{ display: none; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #c0392b; font-size: 14px; }
.brief-msg.show{ display: block; }
.brief-done{ display: grid; justify-items: start; gap: 10px; padding: 32px; border-radius: 18px; background: var(--cream); }
.brief-done[hidden]{ display: none; }
.brief-done h2{ font-size: 24px; }
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Подвал --- */
.doc-footer{ padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.doc-footer .doc-shell{ display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.doc-footer a{ color: inherit; text-decoration: none; }
.doc-footer a:hover{ color: var(--orange-dark); }

/* --- Просмотр заявок --- */
.admin-login{ display: grid; gap: 12px; max-width: 360px; margin: 10vh auto 0; padding: 32px; border-radius: 20px; background: var(--cream); }
.admin-login h1{ font-size: 26px; }
.admin-login input{ min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; }
.admin-login button{ min-height: 46px; border: 0; border-radius: 12px; background: var(--orange-deep); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.admin-error{ color: #c0392b; font-size: 14px; }
.admin-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-head h1 span{ color: var(--orange); }
.admin-head a{ color: var(--orange-dark); }
.doc-note{ color: var(--muted); }
.lead{ padding: 20px; margin-bottom: 12px; border: 1.5px solid var(--line); border-radius: 16px; }
.lead-top{ display: flex; justify-content: space-between; gap: 12px; }
.lead-top time{ color: var(--muted); font-size: 14px; }
.lead-contact{ margin: 2px 0 10px; color: var(--orange-dark); font-weight: 600; }
.lead p{ white-space: pre-line; color: #3d3632; font-size: 15px; }
.lead-file{ display: inline-block; margin-top: 10px; color: var(--orange-deep); font-weight: 600; }

/* --- Адаптив --- */
@media (max-width: 860px){
    .contact-cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px){
    main.doc-shell{ padding-top: 100px; }
    .contact-cards{ grid-template-columns: 1fr; }
    .c-card{ grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
    .c-ico{ grid-row: span 2; margin: 0; }
    .brief-grid{ grid-template-columns: 1fr; }
    .req-table > div, .req-table.compact > div{ grid-template-columns: 1fr; gap: 2px; }
    .req-copy{ display: none; }
    .doc-lead{ font-size: 16.5px; }
}

/* --- Печать: только документ, без меню и кнопок --- */
@media print{
    .nav-wrap, .no-print, .doc-footer, .toast{ display: none !important; }
    main.doc-shell{ padding: 0; width: 100%; }
    .doc-header{ background: none; padding: 0 0 12px; border-bottom: 2px solid #000; border-radius: 0; }
    .doc-body{ max-width: none; font-size: 12pt; }
    .doc-body a{ color: inherit; text-decoration: none; }
    .brief fieldset{ break-inside: avoid; }
    body{ color: #000; }
}
