/* =========================================================
   BIBLIOTEKA.KG DOWNLOAD PAGE
   Страница premium-скачивания выбранных страниц в PDF
   ========================================================= */

.download-page {
    position: relative;
    padding: 24px 0 56px;
    color: var(--text);
}

/* =========================================================
   COMMON GLASS BLOCKS
   ========================================================= */

.download-ad-section,
.download-hero,
.download-form-card,
.download-result-card,
.download-alert,
.download-sidebar-block,
.download-widget-section {
    position: relative;
    overflow: hidden;
    color: var(--text);
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
}

.download-hero::before,
.download-form-card::before,
.download-result-card::before,
.download-sidebar-block::before,
.download-widget-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 320px at 0% -14%, rgba(103, 232, 249, .17), transparent 62%),
        radial-gradient(700px 280px at 110% 110%, rgba(var(--tint-rgb), .18), transparent 62%);
    pointer-events: none;
}

.download-hero-inner,
.download-section-head,
.download-format-box,
.download-form,
.download-result-head,
.download-result-btn,
.download-citation-box,
.download-sidebar-block > *,
.download-widget-section > * {
    position: relative;
    z-index: 2;
}

/* =========================================================
   ADS
   ========================================================= */

.download-ad-section {
    padding: 10px;
}

.download-ad-item a,
.download-side-ad-item a {
    display: block;
    text-decoration: none;
}

.download-ad-item img,
.download-side-ad-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* =========================================================
   KICKER / BUTTONS
   ========================================================= */

.download-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 7px 12px;
    color: var(--bg);
    background: var(--accent);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.download-primary-btn,
.download-outline-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.download-primary-btn {
    color: var(--bg) !important;
    background: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: 0 10px 24px rgba(103, 232, 249, .22);
}

.download-primary-btn:hover,
.download-primary-btn:focus {
    color: var(--accent) !important;
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 22px rgba(103, 232, 249, .42);
    transform: translateY(-1px);
}

.download-outline-btn {
    color: var(--text) !important;
    background: rgba(var(--surface-rgb), .62);
    border: 1px solid var(--border);
}

.download-outline-btn:hover,
.download-outline-btn:focus {
    color: var(--bg) !important;
    background: var(--text);
    border-color: var(--text);
    transform: translateY(-1px);
}

/* =========================================================
   HERO
   ========================================================= */

.download-hero {
    min-height: 190px;
}

.download-hero-inner {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 30px;
}

.download-book-cover {
    width: 110px;
    height: 150px;
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    overflow: hidden;
}

.download-book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-hero-content {
    min-width: 0;
}

.download-hero-content h1 {
    max-width: 980px;
    margin: 0 0 14px;
    color: var(--text);
    font-size: clamp(30px, 3.6vw, 52px);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.download-hero-content p {
    max-width: 760px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.download-book-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.download-book-meta-line span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .6);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 800;
}

.download-book-meta-line i {
    color: var(--accent);
}

.download-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 170px;
}

/* =========================================================
   ALERTS
   ========================================================= */

.download-alert {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 18px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.55;
}

.download-alert-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-size: 24px;
}

.download-alert-warning .download-alert-icon {
    background: #f59e0b;
}

.download-alert-danger .download-alert-icon {
    background: #ef4444;
}

/* =========================================================
   RESULT CARD
   ========================================================= */

.download-result-card {
    padding: 26px;
}

.download-result-head {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.download-result-icon {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    background: var(--accent);
    font-size: 32px;
    box-shadow: 0 18px 34px rgba(103, 232, 249, .22);
}

.download-result-card h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.download-result-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.download-result-card p strong {
    color: var(--text);
}

.download-result-btn {
    margin-bottom: 20px;
}

.download-citation-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
}

.download-citation-box label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.download-citation-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.download-citation-row .form-control {
    min-height: 44px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    box-shadow: none;
}

.download-citation-row .form-control:focus {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(103, 232, 249, .15);
}

/* =========================================================
   FORM CARD
   ========================================================= */

.download-form-card {
    padding: 30px;
}

.download-section-head {
    max-width: 820px;
    margin-bottom: 24px;
}

.download-section-head h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: clamp(28px, 3.2vw, 44px);
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.download-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.download-format-box {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
}

.download-format-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.download-format-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.download-example-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    color: var(--bg);
    background: var(--accent);
    border: 1px solid var(--accent);
    font-size: 13px;
    font-weight: 850;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    cursor: pointer;
    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        transform .18s ease;
}

.download-example-btn:hover,
.download-example-btn:focus {
    color: var(--accent);
    background: var(--bg);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.download-form {
    position: relative;
    z-index: 2;
}

.download-field {
    margin-bottom: 20px;
}

.download-field label {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.download-field .help-block,
.download-field .invalid-feedback {
    margin-top: 8px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 800;
}

.download-input {
    min-height: 56px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    font-size: 18px;
    font-weight: 850;
    box-shadow: none;
}

.download-input::placeholder {
    color: var(--muted);
    opacity: .86;
}

.download-input:focus {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 .22rem rgba(103, 232, 249, .15);
}

.download-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.download-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.download-sidebar-block {
    padding: 22px;
}

.download-sidebar-ad {
    padding: 10px;
}

.download-sidebar-block h3 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 23px;
    font-weight: 950;
    line-height: 1.12;
}

.download-sidebar-block p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.download-access-card {
    background:
        linear-gradient(180deg, rgba(103, 232, 249, .14), rgba(var(--surface-rgb), .72)),
        rgba(var(--surface-rgb), var(--glass-alpha));
}

.download-access-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0 16px;
    padding: 11px 12px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .62);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 850;
}

.download-access-status i {
    color: var(--accent);
}

.download-rules-list {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-rules-list li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 10px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.download-rules-list i {
    margin-top: 2px;
    color: var(--accent);
}

.download-book-info-list {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.download-book-info-list li {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.35;
}

.download-book-info-list strong {
    color: var(--accent);
    font-weight: 900;
}

.download-book-info-list span {
    color: var(--text);
    font-weight: 750;
}

.download-sidebar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.download-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    color: var(--accent);
    background: rgba(var(--surface-rgb), .44);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.download-sidebar-link:hover,
.download-sidebar-link:focus {
    color: var(--text);
    border-color: rgba(103, 232, 249, .45);
}

/* =========================================================
   WIDGET SECTION
   ========================================================= */

.download-widget-section {
    padding: 0;
}

.download-widget-section > * {
    position: relative;
    z-index: 2;
}

/* =========================================================
   OWL FIXES
   ========================================================= */

.download-page .owl-carousel .owl-nav button.owl-prev,
.download-page .owl-carousel .owl-nav button.owl-next {
    color: var(--bg);
    background: var(--accent);
    border: 1px solid var(--accent);
    min-width: 34px;
    min-height: 34px;
}

.download-page .owl-carousel .owl-dots .owl-dot span {
    background: var(--muted);
}

.download-page .owl-carousel .owl-dots .owl-dot.active span,
.download-page .owl-carousel .owl-dots .owl-dot:hover span {
    background: var(--accent);
}

/* =========================================================
   DARK MODE TUNING
   ========================================================= */

html.theme-dark .download-format-box,
body.theme-dark .download-format-box,
html.theme-dark .download-citation-box,
body.theme-dark .download-citation-box,
html.theme-dark .download-rules-list li,
body.theme-dark .download-rules-list li,
html.theme-dark .download-book-info-list li,
body.theme-dark .download-book-info-list li,
html.theme-dark .download-access-status,
body.theme-dark .download-access-status,
html.theme-dark .download-sidebar-link,
body.theme-dark .download-sidebar-link {
    background: rgba(255, 255, 255, .045);
}

html.theme-dark .download-result-icon,
body.theme-dark .download-result-icon {
    box-shadow: 0 18px 34px rgba(103, 232, 249, .14);
}

/* =========================================================
   NO RADIUS
   ========================================================= */

.download-ad-section,
.download-hero,
.download-form-card,
.download-result-card,
.download-alert,
.download-sidebar-block,
.download-widget-section,
.download-kicker,
.download-primary-btn,
.download-outline-btn,
.download-book-cover,
.download-book-cover img,
.download-book-meta-line span,
.download-alert-icon,
.download-result-icon,
.download-citation-box,
.download-citation-row .form-control,
.download-format-box,
.download-example-btn,
.download-input,
.download-access-status,
.download-rules-list li,
.download-book-info-list li,
.download-sidebar-link,
.download-page .owl-carousel .owl-nav button.owl-prev,
.download-page .owl-carousel .owl-nav button.owl-next {
    border-radius: 0 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1199.98px) {
    .download-sidebar {
        position: static;
        top: auto;
    }
}

@media (max-width: 991.98px) {
    .download-page {
        padding-top: 20px;
    }

    .download-hero-inner {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .download-hero-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .download-sidebar-block.download-sidebar-ad {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767.98px) {
    .download-form-card,
    .download-result-card {
        padding: 24px 20px;
    }

    .download-format-box {
        grid-template-columns: 1fr;
    }

    .download-citation-row {
        grid-template-columns: 1fr;
    }

    .download-citation-row .btn {
        width: 100%;
    }

    .download-form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .download-hero-inner {
        grid-template-columns: 1fr;
        padding: 22px 18px;
    }

    .download-book-cover {
        width: 108px;
        height: 146px;
    }

    .download-hero-actions {
        grid-template-columns: 1fr;
    }

    .download-hero-content h1 {
        font-size: 28px;
    }

    .download-section-head h2,
    .download-result-card h2 {
        font-size: 27px;
    }

    .download-alert {
        grid-template-columns: 1fr;
    }

    .download-alert-icon {
        width: 54px;
        height: 54px;
    }

    .download-sidebar-block {
        padding: 20px;
    }
}