
/* ==========================================
   RESET DAN DASAR
========================================== */

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

:root {
    --primary: #166534;
    --primary-dark: #14532d;
    --background: #f6f9f7;
    --text: #1b2920;
    --muted: #7b8980;
    --border: #e1e8e3;
    --white: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

button,
input {
    font: inherit;
}

[hidden] {
    display: none !important;
}


/* ==========================================
   HEADER
========================================== */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    min-height: 88px;
    margin: auto;
    padding: 15px 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: white;

    font-size: 23px;
    font-weight: bold;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 21px;
    line-height: 1.3;
}

.brand-text small {
    color: var(--muted);
    font-size: 15px;
}

.header-tag {
    background: #ecfdf3;
    color: var(--primary);
    border: 1px solid #d1fae0;

    padding: 9px 17px;
    border-radius: 30px;

    font-size: 14px;
    font-weight: bold;
}


/* ==========================================
   CONTAINER
========================================== */

.container {
    width: 100%;
    max-width: 1100px;

    margin: 35px auto;
    padding: 0 25px;
}


/* ==========================================
   HERO
========================================== */

.hero {
    background: linear-gradient(
        120deg,
        #14532d,
        #15803d
    );

    color: white;

    padding: 45px 40px;
    border-radius: 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    overflow: hidden;
}

.eyebrow {
    color: #bbf7d0;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 43px);
    line-height: 1.2;
    margin-bottom: 15px;
}

.hero-desc {
    max-width: 480px;
    color: #dcfce7;
    font-size: 17px;
}

.hero-icon {
    width: 105px;
    height: 105px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #86efac;
    border-radius: 30px;

    color: white;
    font-size: 55px;
    transform: rotate(8deg);

    flex-shrink: 0;
}


/* ==========================================
   JUDUL DAFTAR
========================================== */

.list-heading {
    margin-top: 48px;
    margin-bottom: 20px;
}

.list-heading h2 {
    font-size: 29px;
    margin-bottom: 3px;
}

.muted {
    color: var(--muted);
    font-size: 15px;
}


/* ==========================================
   SEARCH
========================================== */

.search-box {
    width: 100%;
    min-height: 60px;

    background: white;
    border: 1px solid var(--border);
    border-radius: 17px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 20px;
    margin-bottom: 25px;
}

.search-box span {
    color: var(--muted);
    font-size: 30px;
}

.search-box input {
    width: 100%;
    height: 55px;

    border: none;
    outline: none;

    color: var(--text);
    background: transparent;
    font-size: 16px;
}

.search-box:focus-within {
    border-color: var(--primary);
}


/* ==========================================
   DAFTAR DOKUMEN
========================================== */

.document-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.document-card {
    width: 100%;
    min-height: 130px;

    padding: 20px 24px;

    display: flex;
    align-items: center;
    gap: 20px;

    background: white;
    border: 1px solid var(--border);
    border-radius: 22px;

    text-align: left;
    cursor: pointer;

    transition: 0.2s ease;
}

.document-card:hover {
    border-color: #86b99a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.pdf-icon {
    width: 75px;
    height: 85px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff1f0;
    color: #b42318;

    border-radius: 15px;

    font-size: 20px;
    font-weight: bold;
}

.card-copy {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-copy strong {
    font-size: 19px;
    color: #111827;
    overflow-wrap: anywhere;
}

.card-copy small {
    color: var(--muted);
    font-size: 14px;
}

.card-arrow {
    color: #94a39a;
    font-size: 30px;
}


/* ==========================================
   EMPTY STATE
========================================== */

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    font-size: 40px;
}

.empty-state h3 {
    color: var(--text);
    margin: 10px 0;
}


/* ==========================================
   ERROR
========================================== */

.notice {
    padding: 18px;
    border-radius: 12px;
    margin-top: 20px;
}

.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}


/* ==========================================
   PDF VIEWER
========================================== */

#viewerView {
    width: 100%;
}

.pdf-stage {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pdf-page {
    width: 100%;
    display: flex;
    justify-content: center;
    background: white;
    overflow: hidden;
}

.pdf-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-message {
    padding: 35px 15px;
    text-align: center;
    color: #555;
    font-size: 17px;
}

.error-text {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 12px;
    overflow-wrap: anywhere;
}


/* ==========================================
   FOOTER
========================================== */

.site-footer {
    margin-top: 80px;
    padding: 25px 15px;

    border-top: 1px solid var(--border);
    background: white;

    text-align: center;
    color: var(--muted);
    font-size: 14px;
}


/* ==========================================
   MODE PDF ONLY
   SAAT DOKUMEN DIBUKA
========================================== */

body.pdf-only {
    margin: 0;
    padding: 0;

    background: #e9ece9;
}

/* Hilangkan seluruh tampilan portal */

body.pdf-only .site-header,
body.pdf-only .site-footer,
body.pdf-only #listView {
    display: none !important;
}

/* Hilangkan jarak container */

body.pdf-only main.container {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;
}

/* Viewer memenuhi layar */

body.pdf-only #viewerView {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Latar halaman PDF */

body.pdf-only .pdf-stage {
    width: 100%;
    gap: 8px;
    padding: 0;
    background: #e9ece9;
}

/* Setiap halaman PDF */

body.pdf-only .pdf-page {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background: white;
    box-shadow: 0 1px 5px rgba(0,0,0,0.12);
}

/* Canvas PDF */

body.pdf-only .pdf-page canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Loading PDF */

body.pdf-only .pdf-message {
    padding: 35px 15px;
    text-align: center;
    background: #e9ece9;
}

/* Mode fullscreen browser */

body.pdf-only:fullscreen {
    background: #e9ece9;
}


/* ==========================================
   RESPONSIVE MOBILE
========================================== */

@media (max-width: 600px) {

    .header-inner {
        min-height: 78px;
        padding: 12px 18px;
    }

    .brand-mark {
        width: 52px;
        height: 52px;
        border-radius: 15px;
        font-size: 20px;
    }

    .brand-text strong {
        font-size: 17px;
    }

    .brand-text small {
        font-size: 13px;
    }

    .header-tag {
        font-size: 12px;
        padding: 8px 12px;
    }

    .container {
        margin: 25px auto;
        padding: 0 18px;
    }

    .hero {
        padding: 35px 24px;
        border-radius: 22px;
    }

    .hero-desc {
        font-size: 15px;
    }

    .hero-icon {
        width: 65px;
        height: 65px;
        font-size: 35px;
    }

    .list-heading {
        margin-top: 35px;
    }

    .list-heading h2 {
        font-size: 25px;
    }

    .document-card {
        min-height: 115px;
        padding: 16px;
        gap: 15px;
        border-radius: 19px;
    }

    .pdf-icon {
        width: 65px;
        height: 75px;
        font-size: 17px;
    }

    .card-copy strong {
        font-size: 16px;
    }

    .card-copy small {
        font-size: 13px;
    }

    /* PDF mobile */

    body.pdf-only .pdf-page {
        width: 100%;
    }

    body.pdf-only .pdf-page canvas {
        max-width: 100%;
    }

}
