:root {
    --blue: #008bfd;
    --green: #65b90e;
    --pink: #ed1362;
    --orange: #e27300;
    --dark: #0f2344;
    --gray: #6d7891;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, sans-serif;
    background: #ffffff;
    color: var(--dark);
}

.container {
    max-width: 1440px;
    margin: auto;
    padding: 40px 25px 80px;
}

.topbar {
    display: flex;
    justify-content: flex-end;
}

.language {
    display: flex;
    gap: 10px;
}

.language button {
    border: 1px solid #e8edf5;
    background: #fff;
    color: var(--dark);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: .3s;
}

.language button:hover {
    background: #f5f8fc;
}

header {
    text-align: center;
    padding: 30px 0 80px;
}

header img {
    width: 500px;
    max-width: 90%;
}

header h1 {
    margin-top: 25px;
    font-size: 30px;
    font-weight: 400;
    color: var(--gray);
}

main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.card {
    text-decoration: none;
    color: inherit;
    background: #fff;
    padding: 40px 35px;
    border-radius: 28px;
    border: 1px solid #edf2f7;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .05);
    transition: .35s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 5px;
}

.card:nth-child(1)::before {
    background: var(--blue);
}

.card:nth-child(2)::before {
    background: var(--green);
}

.card:nth-child(3)::before {
    background: var(--pink);
}

.card:nth-child(4)::before {
    background: var(--orange);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .1);
}

.card h2 {
    font-size: 30px;
    margin-bottom: 20px;
}

.card p {
    color: var(--gray);
    min-height: 80px;
    font-size: 17px;
    line-height: 1.7;
}

.btn {
    display: inline-block;
    margin-top: 25px;
    padding: 14px 24px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: .3s;
}

.card:nth-child(1) .btn {
    background: var(--blue);
}

.card:nth-child(2) .btn {
    background: var(--green);
}

.card:nth-child(3) .btn {
    background: var(--pink);
}

.card:nth-child(4) .btn {
    background: var(--orange);
}

.card:hover .btn {
    transform: scale(1.05);
}

footer {
    margin-top: 80px;
    text-align: center;
    color: var(--gray);
    font-size: 24px;
}

@media (max-width: 1200px) {
    main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .topbar {
        justify-content: center;
    }

    header {
        padding-bottom: 50px;
    }

    header img {
        width: 300px;
    }

    header h1 {
        font-size: 22px;
    }

    main {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 30px;
    }

    .card h2 {
        font-size: 24px;
    }

    .card p {
        min-height: auto;
    }

    footer {
        font-size: 18px;
    }
}

/* ===== PARTNERSKI CENTAR ===== */

.partner-center {
    margin-top: 90px;
}

.pc-hero {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 28px;
}

.pc-hero-text {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding: 10px 0 40px;
}

.pc-eyebrow {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3em;
    color: var(--gray);
    margin-bottom: 14px;
}

.pc-hero-text h2 {
    font-size: clamp(38px, 5vw, 64px);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.05;
    color: var(--dark);
    margin-bottom: 16px;
}

.pc-hero-text p {
    font-size: 21px;
    line-height: 1.5;
    color: var(--gray);
    max-width: 520px;
}

.pc-hero-img {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 62%;
    background-size: cover;
    background-position: left center;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
    mask-image: linear-gradient(to right, transparent 0%, #000 45%);
}

.pc-grid {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: -30px;
}

.pc-card {
    --accent: var(--blue);
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 28px;
    border-top: 6px solid var(--accent);
    padding: 8px 8px 26px;
    box-shadow: 0 18px 45px rgba(15, 35, 68, .08);
    transition: .35s;
}

.pc-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(15, 35, 68, .14);
}

.pc-blue  { --accent: var(--blue);  --tint: #e8f4ff; }
.pc-green { --accent: var(--green); --tint: #eaf7dd; }
.pc-pink  { --accent: var(--pink);  --tint: #fde8f0; }

.pc-photo {
    height: 175px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
}

.pc-icon {
    width: 74px;
    height: 74px;
    margin: -38px 0 0 18px;
    position: relative;
    border-radius: 50%;
    background: var(--tint);
    border: 6px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.pc-icon svg {
    width: 34px;
    height: 34px;
}

.pc-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px 0 22px;
}

.pc-body h3 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--dark);
}

.pc-body p {
    color: var(--gray);
    font-size: 17px;
    line-height: 1.5;
}

.pc-arrow {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
}

.pc-arrow svg {
    width: 26px;
    height: 26px;
}

.pc-card:hover .pc-arrow {
    transform: translateX(6px);
}

@media (max-width: 1000px) {
    .pc-grid {
        grid-template-columns: 1fr;
        margin-top: 10px;
    }

    .pc-photo {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .partner-center {
        margin-top: 60px;
    }

    .pc-hero {
        flex-direction: column;
        align-items: flex-start;
        min-height: 0;
    }

    .pc-hero-text {
        padding-bottom: 20px;
    }

    .pc-hero-text p {
        font-size: 18px;
    }

    .pc-hero-img {
        position: relative;
        width: 100%;
        height: 170px;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
        mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
    }
}

.page-block {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0 40px;
    border-top: 6px solid var(--c);
    border-radius: 6px;
}
.page-block h2 { font-size: 44px; margin: 40px 0 16px; }
.page-block p { color: var(--gray); font-size: 20px; line-height: 1.6; margin-bottom: 12px; }
.page-block .btn { text-decoration: none; margin-top: 30px; }


/* ===== POP-UP ZA LOZINKU ===== */

.pw-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 35, 68, .55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pw-overlay.open { display: flex; }

.pw-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 28px;
    border-top: 6px solid var(--blue);
    padding: 40px 34px 34px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
    animation: pwIn .25s ease;
}

@keyframes pwIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.pw-close {
    position: absolute;
    top: 12px;
    right: 18px;
    border: 0;
    background: none;
    font-size: 30px;
    color: var(--gray);
    cursor: pointer;
}

.pw-lock {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e8f4ff;
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-lock svg { width: 32px; height: 32px; }

.pw-modal h3 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }

.pw-modal p { color: var(--gray); margin-bottom: 22px; }

.pw-modal input {
    width: 100%;
    padding: 15px 18px;
    font: inherit;
    font-size: 17px;
    border: 1.5px solid #dfe6f0;
    border-radius: 14px;
    outline: none;
    transition: .2s;
}

.pw-modal input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(0, 139, 253, .12);
}

.pw-error {
    min-height: 22px;
    margin: 10px 0 6px;
    color: var(--pink);
    font-size: 14px;
    font-weight: 600;
}

.pw-submit {
    width: 100%;
    border: 0;
    padding: 15px;
    border-radius: 50px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: .3s;
}

.pw-submit:hover { transform: scale(1.03); }
.pw-submit:disabled { opacity: .6; cursor: wait; }


/* ===== STRANICA DOKUMENTI ===== */

.docs-page { max-width: 1100px; margin: 0 auto; padding-bottom: 30px; text-align: center; border-top: 6px solid var(--c, var(--green)); border-radius: 6px; }
.docs-page h2 { font-size: 44px; margin: 40px 0 12px; }
.docs-sub { color: var(--gray); font-size: 20px; margin-bottom: 44px; }
.docs-empty { color: var(--gray); font-size: 20px; padding: 40px 0; }

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
    text-align: left;
}

.doc-card {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(15, 35, 68, .06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: .3s;
}
.doc-card:hover { transform: translateY(-6px); box-shadow: 0 28px 55px rgba(15, 35, 68, .12); }

.doc-cover {
    display: block;
    background: #f1f5fa;
    aspect-ratio: 210 / 297;
    position: relative;
    overflow: hidden;
}
.doc-cover canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s; }
.doc-cover.ready canvas { opacity: 1; }
.doc-cover:not(.ready)::after {
    content: "PDF";
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; letter-spacing: .2em; color: #b8c3d6;
}

.doc-info { padding: 20px 22px 24px; }
.doc-info h3 { font-size: 19px; line-height: 1.3; margin-bottom: 6px; }
.doc-meta { color: var(--gray); font-size: 14px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.doc-btn {
    text-decoration: none;
    font-size: 13px; font-weight: 700;
    padding: 11px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--c, var(--green));
    color: var(--c, var(--green));
    transition: .25s;
}
.doc-btn:hover { transform: scale(1.04); }
.doc-btn.primary { background: var(--c, var(--green)); color: #fff; }

.docs-footer-actions { margin-top: 50px; }
.docs-footer-actions .btn { text-decoration: none; margin: 0 5px; }

/* ===== VIEWER KATALOGA ===== */

.viewer-body {
    background: #eef2f8;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.viewer-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: #fff;
    box-shadow: 0 2px 14px rgba(15, 35, 68, .06);
}
.v-back { text-decoration: none; color: var(--dark); font-weight: 600; }
.v-logo { height: 34px; }
.v-dl {
    text-decoration: none; background: var(--c, var(--green)); color: #fff;
    font-size: 13px; font-weight: 700; padding: 11px 18px; border-radius: 50px;
}

.viewer-title { text-align: center; font-weight: 700; font-size: 18px; padding: 14px 20px 0; color: var(--dark); }

.viewer-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 70px;
}

#book { width: 100%; height: 100%; }

.pf-page { background: #fff; overflow: hidden; }
.pf-page img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }

.v-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    border: 0; background: #fff; color: var(--dark);
    font-size: 18px; cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 35, 68, .15);
    z-index: 5; transition: .2s;
}
.v-nav:hover { background: var(--c, var(--green)); color: #fff; }
.v-prev { left: 12px; }
.v-next { right: 12px; }

.v-loading { position: absolute; color: var(--gray); font-weight: 600; }

.viewer-controls {
    display: flex; align-items: center; justify-content: center; gap: 22px;
    padding: 6px 20px 18px;
    color: var(--gray); font-weight: 600;
}
.v-fs {
    border: 1.5px solid #d5ddea; background: #fff; color: var(--dark);
    font: inherit; font-size: 12px; font-weight: 700;
    padding: 9px 16px; border-radius: 50px; cursor: pointer;
}

@media (max-width: 768px) {
    .viewer-stage { padding: 10px 8px; }
    .v-nav { display: none; }
    .v-logo { height: 26px; }
    .viewer-bar { padding: 10px 14px; }
    .docs-page h2 { font-size: 32px; }
    .viewer-body .v-fs { display: none; }
}


/* ===== ADMIN ===== */

.adm { max-width: 900px; }
.adm-top { display: flex; justify-content: space-between; align-items: center; }
.adm-logo { height: 40px; }
.adm-link { margin-left: 18px; color: var(--gray); text-decoration: none; font-weight: 600; }
.adm-link:hover { color: var(--dark); }
.adm-h1 { font-size: 34px; margin: 30px 0 20px; }

.adm-flash { padding: 14px 18px; border-radius: 14px; font-weight: 600; margin-bottom: 20px; }
.adm-flash.ok  { background: #eaf7dd; color: #3d7a07; }
.adm-flash.err { background: #fde8f0; color: #c40d4c; }

.adm-box { background: #fff; border: 1px solid #edf2f7; border-radius: 24px; box-shadow: 0 12px 34px rgba(15,35,68,.06); padding: 28px; margin-bottom: 26px; }
.adm-box h2 { font-size: 22px; margin-bottom: 18px; }
.adm-box h2 small { color: var(--gray); font-weight: 500; }

.adm-form { display: flex; flex-direction: column; gap: 8px; }
.adm-label { font-weight: 700; margin-top: 10px; }
.adm-label small { color: var(--gray); font-weight: 500; }
.adm-form input[type=text], .adm-form input[type=file], .adm-title, .adm-login input {
    width: 100%; padding: 13px 16px; font: inherit; border: 1.5px solid #dfe6f0; border-radius: 12px; outline: none; background: #fff;
}
.adm-form input:focus, .adm-title:focus, .adm-login input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,139,253,.12); }

.adm-pages { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0; }
.adm-chip { cursor: pointer; }
.adm-chip input { position: absolute; opacity: 0; pointer-events: none; }
.adm-chip span {
    display: inline-block; padding: 9px 18px; border-radius: 50px;
    border: 1.5px solid var(--c); color: var(--c); font-weight: 700; font-size: 14px; transition: .2s;
}
.adm-chip input:checked + span { background: var(--c); color: #fff; }
.adm-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(15,35,68,.15); }

.adm-btn {
    display: inline-block; border: 0; cursor: pointer; text-decoration: none;
    background: var(--blue); color: #fff; font: inherit; font-weight: 700; font-size: 14px;
    padding: 14px 26px; border-radius: 50px; margin-top: 10px; transition: .25s; align-self: flex-start;
}
.adm-btn:hover { transform: scale(1.04); }
.adm-btn.small { padding: 10px 18px; font-size: 12px; margin-top: 0; }
.adm-btn.ghost { background: #fff; color: var(--dark); border: 1.5px solid #d5ddea; }
.adm-btn.danger { background: #fff; color: var(--pink); border: 1.5px solid var(--pink); }

.adm-doc { border-top: 1px solid #edf2f7; padding: 20px 0; }
.adm-doc:first-of-type { border-top: 0; padding-top: 0; }
.adm-doc-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.adm-title { font-weight: 700; }
.adm-meta { color: var(--gray); font-size: 13px; }
.adm-row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.adm-hidden { color: var(--gray); font-size: 13px; font-style: italic; }
.adm-empty, .adm-note { color: var(--gray); font-size: 14px; }
.adm-note { margin-top: 14px; }
.adm-login { text-align: left; }
