/*
 * Pusaka Bangsa — Custom Stylesheet
 * File: assets/css/app.css
 *
 * Sistem desain berbasis identitas visual nasional Indonesia:
 * merah-putih, tenang, modern, dan terpercaya.
 *
 * Semua font menggunakan system-ui stack (nol dependensi eksternal).
 * Setelah Poppins diunduh, tambahkan @font-face di bagian FONTS.
 */

/* ================================================================
   FONTS — @font-face lokal (aktifkan setelah download Poppins)
   ================================================================ */

/*
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-Regular.woff2') format('woff2'),
         url('../fonts/poppins/Poppins-Regular.woff')  format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-Medium.woff2') format('woff2'),
         url('../fonts/poppins/Poppins-Medium.woff')  format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-SemiBold.woff2') format('woff2'),
         url('../fonts/poppins/Poppins-SemiBold.woff')  format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('../fonts/poppins/Poppins-Bold.woff2') format('woff2'),
         url('../fonts/poppins/Poppins-Bold.woff')  format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

/* ================================================================
   DESIGN TOKENS
   ================================================================ */

:root {
    /* Warna Utama — Merah Putih */
    --pb-merah:        #C1272D;     /* Merah bendera Indonesia */
    --pb-merah-gelap:  #8E1A1F;     /* Merah tua, hover state */
    --pb-merah-muda:   #f8e4e4;     /* Merah sangat pucat, background aksen */
    --pb-putih:        #FFFFFF;
    --pb-emas:         #C8973A;     /* Emas batik, aksen dekoratif */
    --pb-emas-muda:    #F5E8C8;     /* Emas pucat */

    /* Netral */
    --pb-gelap:        #1B1B2E;     /* Teks utama / header */
    --pb-abu-tua:      #4A4A5A;     /* Teks sekunder */
    --pb-abu:          #8A8A9A;     /* Placeholder, teks tersier */
    --pb-abu-muda:     #F0F0F5;     /* Background section */
    --pb-garis:        #E0E0EA;     /* Garis pemisah */

    /* Tipografi */
    --pb-font:         'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont,
                       'Helvetica Neue', Arial, sans-serif;
    /* Aktifkan baris di bawah setelah Poppins diunduh: */
    /* --pb-font: 'Poppins', 'Segoe UI', system-ui, sans-serif; */

    /* Spacing */
    --pb-radius:       0.75rem;
    --pb-radius-lg:    1.25rem;
    --pb-shadow:       0 2px 12px rgba(0, 0, 0, 0.08);
    --pb-shadow-hover: 0 8px 28px rgba(193, 39, 45, 0.18);
    --pb-transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   BASE
   ================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ── Sembunyikan scrollbar di semua browser, scroll tetap berfungsi ── */
html, body {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / Edge lama */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari / Edge baru */
}

body {
    font-family: var(--pb-font);
    font-size:   1rem;
    color:       var(--pb-gelap);
    background:  var(--pb-putih);
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

/* Teks warna merah utility */
.text-merah { color: var(--pb-merah) !important; }

/* ================================================================
   SKIP TO CONTENT — Aksesibilitas
   ================================================================ */

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--pb-gelap);
    color: var(--pb-putih);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--pb-radius) var(--pb-radius);
    z-index: 9999;
    font-size: 0.875rem;
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* ================================================================
   NAVBAR
   ================================================================ */

.pb-navbar {
    background: #3A1508;
    padding: 0.85rem 0;
    box-shadow: 0 2px 20px rgba(46, 16, 6, 0.55),
                0 1px 4px  rgba(155, 32, 32, 0.2);
}

.pb-logo-img {
    display: block;
}

.pb-brand-name {
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--pb-putih);
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.pb-brand-sub {
    font-size:  0.7rem;
    color:      rgba(255, 255, 255, 0.75);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
}

.pb-domain-badge {
    font-size:    0.8rem;
    color:        rgba(255, 255, 255, 0.8);
    font-weight:  500;
    letter-spacing: 0.03em;
    border:       1px solid rgba(255, 255, 255, 0.3);
    padding:      0.2rem 0.6rem;
    border-radius: 999px;
    background:   rgba(255, 255, 255, 0.1);
}

/* ================================================================
   HERO SECTION
   ================================================================ */

.pb-hero {
    position:   relative;
    background: linear-gradient(160deg, var(--pb-gelap) 0%, #2C1A1E 60%, #3D0A10 100%);
    padding:    3rem 0 2.75rem;
    overflow:   hidden;
}

/* Pola geometris batik — pure CSS, tanpa gambar */
.pb-hero-pattern {
    position: absolute;
    inset:    0;
    pointer-events: none;
    opacity:  0.06;
    background-image:
        /* Pola diagonal silang — terinspirasi motif batik kawung */
        repeating-linear-gradient(
            45deg,
            var(--pb-emas) 0px,
            var(--pb-emas) 1px,
            transparent 1px,
            transparent 28px
        ),
        repeating-linear-gradient(
            -45deg,
            var(--pb-emas) 0px,
            var(--pb-emas) 1px,
            transparent 1px,
            transparent 28px
        );
}

.pb-hero-icon {
    font-size:   2rem;
    color:       var(--pb-emas);
    margin-bottom: 0.875rem;
    opacity:     0.9;
}

.pb-hero-title {
    font-size:   clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    color:       var(--pb-putih);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.pb-hero-accent {
    color:               var(--pb-emas);
    text-decoration:     underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 3px;
    text-decoration-color: rgba(200, 151, 58, 0.5);
}

.pb-hero-sub {
    font-size:    1rem;
    color:        rgba(255, 255, 255, 0.7);
    max-width:    480px;
    margin:       0 auto 1.5rem;
    line-height:  1.6;
}

.pb-btn-hero {
    background:   var(--pb-emas);
    color:        var(--pb-gelap);
    font-weight:  700;
    padding:      0.7rem 2rem;
    border-radius: 999px;
    border:       none;
    font-size:    1rem;
    letter-spacing: 0.02em;
    transition:   transform var(--pb-transition), box-shadow var(--pb-transition);
    text-decoration: none;
    display:      inline-flex;
    align-items:  center;
}

.pb-btn-hero:hover,
.pb-btn-hero:focus-visible {
    background:   #b0822e;
    color:        var(--pb-putih);
    transform:    translateY(-2px);
    box-shadow:   0 6px 20px rgba(200, 151, 58, 0.4);
    text-decoration: none;
}

/* ================================================================
   APPS SECTION
   ================================================================ */

.pb-apps-section {
    padding:    2.5rem 0 2rem;
    background: var(--pb-abu-muda);
}

.pb-section-title {
    font-size:   1.5rem;
    font-weight: 700;
    color:       var(--pb-gelap);
    margin-bottom: 0.25rem;
}

/* ================================================================
   APPLICATION CARDS
   ================================================================ */

.pb-app-card {
    background:    var(--pb-putih);
    border-radius: var(--pb-radius-lg);
    overflow:      hidden;
    box-shadow:    var(--pb-shadow);
    display:       flex;
    flex-direction: column;
    border:        1px solid var(--pb-garis);
    transition:    transform var(--pb-transition),
                   box-shadow var(--pb-transition);
}

.pb-app-card:hover {
    transform:  translateY(-4px);
    box-shadow: var(--pb-shadow-hover);
    border-color: rgba(193, 39, 45, 0.2);
}

/* Header kartu berwarna (warna per app dari config) */
.pb-card-header {
    position:       relative;
    padding:        1.25rem 1.25rem 1rem;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    /* background diset inline via PHP */
}

/* Overlay gelap subtle agar ikon tetap terbaca */
.pb-card-header::after {
    content:  '';
    position: absolute;
    inset:    0;
    background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.pb-card-icon {
    position:   relative;
    z-index:    1;
    font-size:  1.65rem;
    color:      rgba(255, 255, 255, 0.95);
    width:      2.6rem;
    height:     2.6rem;
    display:    flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--pb-radius);
    backdrop-filter: blur(4px);
}

.pb-card-category {
    position:     relative;
    z-index:      1;
    font-size:    0.65rem;
    font-weight:  700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color:        rgba(255, 255, 255, 0.9);
    background:   rgba(0, 0, 0, 0.25);
    padding:      0.2rem 0.55rem;
    border-radius: 999px;
}

.pb-card-body {
    padding: 0.875rem 1.25rem 0.5rem;
    flex:    1;
}

.pb-card-title {
    font-size:   1.05rem;
    font-weight: 700;
    color:       var(--pb-gelap);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.pb-card-desc {
    font-size:  0.875rem;
    color:      var(--pb-abu-tua);
    line-height: 1.55;
    margin-bottom: 0;
}

.pb-card-footer {
    padding: 0.75rem 1.25rem 1.25rem;
}

/* Tombol Buka Aplikasi */
.pb-btn-app {
    background:   var(--pb-merah);
    color:        var(--pb-putih);
    font-weight:  600;
    font-size:    0.9rem;
    padding:      0.6rem 1.25rem;
    border-radius: var(--pb-radius);
    border:       2px solid var(--pb-merah);
    transition:   background var(--pb-transition),
                  color var(--pb-transition),
                  transform var(--pb-transition);
    text-decoration: none;
    display:      inline-flex;
    align-items:  center;
    justify-content: center;
}

.pb-btn-app:hover,
.pb-btn-app:focus-visible {
    background:  var(--pb-merah-gelap);
    color:       var(--pb-putih);
    border-color: var(--pb-merah-gelap);
    transform:   translateY(-1px);
    text-decoration: none;
}

.pb-btn-app:active {
    transform: translateY(0);
}

/* Focus visible untuk aksesibilitas keyboard */
.pb-btn-app:focus-visible,
.pb-btn-hero:focus-visible {
    outline: 3px solid var(--pb-emas);
    outline-offset: 3px;
}

/* ================================================================
   INFO SECTION
   ================================================================ */

.pb-info-section {
    padding:    2rem 0 2.5rem;
    background: var(--pb-putih);
    border-top: 1px solid var(--pb-garis);
}

.pb-info-card {
    text-align:    center;
    padding:       1.5rem 1.25rem;
    border-radius: var(--pb-radius-lg);
    background:    var(--pb-abu-muda);
    border:        1px solid var(--pb-garis);
    height:        100%;
}

.pb-info-icon {
    font-size:   1.6rem;
    color:       var(--pb-merah);
    margin-bottom: 0.6rem;
    display:     block;
}

.pb-info-title {
    font-size:   1rem;
    font-weight: 700;
    color:       var(--pb-gelap);
    margin-bottom: 0.5rem;
}

.pb-info-text {
    font-size:  0.875rem;
    color:      var(--pb-abu-tua);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ================================================================
   FOOTER
   ================================================================ */

.pb-footer {
    background: var(--pb-gelap);
    color:      rgba(255, 255, 255, 0.75);
    padding:    2rem 0;
    font-size:  0.875rem;
}

.pb-footer-small {
    font-size: 0.8rem;
    color:     rgba(255, 255, 255, 0.5);
}

.pb-footer-logo {
    vertical-align: -3px;
    object-fit:     contain;
    border-radius:  3px;
}

.pb-badge-sec {
    display:      inline-flex;
    align-items:  center;
    font-size:    0.72rem;
    font-weight:  500;
    color:        rgba(255, 255, 255, 0.7);
    background:   rgba(255, 255, 255, 0.08);
    border:       1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding:      0.25rem 0.65rem;
}

/* ================================================================
   REDIRECT PAGE
   ================================================================ */

.pb-redirect-body {
    background: linear-gradient(160deg, var(--pb-abu-muda) 0%, var(--pb-putih) 100%);
}

.pb-redirect-box {
    background:    var(--pb-putih);
    border-radius: var(--pb-radius-lg);
    padding:       3rem 2.5rem;
    box-shadow:    var(--pb-shadow);
    border:        1px solid var(--pb-garis);
    max-width:     420px;
    width:         90%;
}

.pb-progress-animate {
    transition: width 0.05s linear;
}

/* ================================================================
   BOOTSTRAP ICON — Bootstrap Icons lokal
   Override path font jika diperlukan
   ================================================================ */

/* Path font Bootstrap Icons mengacu ke lokasi relatif dari CSS:
   ../fonts/bootstrap-icons/bootstrap-icons.woff2
   Pastikan file tersebut ada setelah menjalankan download-assets.sh */

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 575.98px) {
    /* Navbar kompak: perkecil nama aplikasi, tetap tampilkan nama instansi */
    .pb-logo-img {
        width: 44px;
        height: 44px;
    }
    .pb-brand-name {
        font-size: 0.88rem;
    }
    .pb-brand-sub {
        font-size: 0.62rem;
    }

    .pb-hero {
        padding: 2rem 0 1.75rem;
    }
    .pb-hero-icon {
        font-size: 1.5rem;
        margin-bottom: 0.6rem;
    }
    .pb-hero-sub {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    .pb-btn-hero {
        padding: 0.55rem 1.5rem;
        font-size: 0.875rem;
    }

    /* Apps section kompak */
    .pb-apps-section { padding: 1.75rem 0 1.5rem; }
    .pb-section-title { font-size: 1.1rem; }

    /* === CARD 2-KOLOM: kompak & rapi === */
    .pb-app-card {
        border-radius: 0.625rem;
    }
    .pb-card-header {
        padding: 0.875rem 0.875rem 0.65rem;
    }
    .pb-card-icon {
        font-size: 1.25rem;
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
    }
    .pb-card-category {
        font-size: 0.5rem;
        padding: 0.1rem 0.35rem;
        letter-spacing: 0.06em;
    }
    .pb-card-body {
        padding: 0.625rem 0.875rem 0.375rem;
    }
    .pb-card-title {
        font-size: 0.78rem;
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }
    .pb-card-desc {
        font-size: 0.7rem;
        line-height: 1.4;
        /* Potong deskripsi panjang di mobile 2-kolom */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .pb-card-footer {
        padding: 0.5rem 0.875rem 0.875rem;
    }
    .pb-btn-app {
        font-size: 0.72rem;
        padding: 0.4rem 0.6rem;
        border-width: 1.5px;
    }

    /* Redirect */
    .pb-redirect-box { padding: 2rem 1.5rem; }

    /* Info section */
    .pb-info-section { padding: 1.5rem 0 2rem; }
    .pb-info-card { padding: 1.25rem 1rem; }
    .pb-info-icon { font-size: 1.35rem; }
    .pb-info-title { font-size: 0.9rem; }
    .pb-info-text { font-size: 0.8rem; }
}

@media (max-width: 767.98px) {
    .pb-info-section { padding: 1.75rem 0 2rem; }
}

/* ================================================================
   PRINT
   ================================================================ */

@media print {
    .pb-navbar, .pb-footer, .pb-btn-app, .pb-btn-hero { display: none !important; }
    .pb-app-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ================================================================
   REDUCED MOTION — Aksesibilitas
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}


/* ================================================================
   AUTH PAGES — Login & Register
   Layout responsif: Desktop / Tablet / Mobile
   Background per device diatur dari konfigurasi sistem
   ================================================================ */

/* --- Body utama halaman auth --- */
.pb-auth-body {
    background: linear-gradient(160deg, var(--pb-gelap) 0%, #2C1A1E 60%, #3D0A10 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--pb-font);
}

/* Overlay pattern batik tipis di atas background */
.pb-auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(45deg,
            var(--pb-emas) 0px, var(--pb-emas) 1px, transparent 1px, transparent 28px),
        repeating-linear-gradient(-45deg,
            var(--pb-emas) 0px, var(--pb-emas) 1px, transparent 1px, transparent 28px);
}

/* Overlay gelap di atas bg foto agar form tetap terbaca */
.pb-auth-body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: rgba(0, 0, 0, 0.42);
}

/* --- Layout utama: desktop two-column, tablet/mobile center --- */
.pb-auth-main {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px); /* Sisakan ruang footer */
}

/* Desktop: sisi kiri branding, sisi kanan form */
@media (min-width: 992px) {
    .pb-auth-main {
        justify-content: center;
        gap: 4rem;
        padding: 3rem 2rem;
    }

    /* Panel branding hanya tampil di desktop */
    .pb-auth-branding {
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: 380px;
        flex-shrink: 0;
        color: var(--pb-putih);
    }

    .pb-auth-branding-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
        filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
    }

    .pb-auth-branding-title {
        font-size: clamp(1.6rem, 2.5vw, 2.1rem);
        font-weight: 800;
        line-height: 1.2;
        margin-bottom: 0.75rem;
        text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    }

    .pb-auth-branding-sub {
        font-size: 0.95rem;
        color: rgba(255,255,255,0.72);
        line-height: 1.65;
        margin-bottom: 2rem;
    }

    .pb-auth-branding-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pb-auth-branding-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: rgba(255,255,255,0.85);
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 999px;
        padding: 0.3rem 0.75rem;
        backdrop-filter: blur(4px);
    }

    .pb-auth-branding-divider {
        width: 48px;
        height: 3px;
        background: var(--pb-emas);
        border-radius: 999px;
        margin-bottom: 1.5rem;
        opacity: 0.85;
    }
}

/* Sembunyikan panel branding di tablet & mobile */
@media (max-width: 991.98px) {
    .pb-auth-branding {
        display: none !important;
    }
    .pb-auth-main {
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

/* --- Card form auth --- */
.pb-auth-box {
    background:    var(--pb-putih);
    border-radius: var(--pb-radius-lg);
    padding:       2.5rem 2.25rem;
    box-shadow:    0 24px 64px rgba(0, 0, 0, 0.40),
                   0 2px 8px  rgba(0, 0, 0, 0.20);
    width:         100%;
    max-width:     460px;
    position:      relative;
    flex-shrink:   0;
}

/* Card lebih lebar untuk register (2 kolom field) */
.pb-auth-box--wide {
    max-width: 560px;
}

/* === TABLET (768px – 991px): card lebih sempit, teks proporsional === */
@media (min-width: 768px) and (max-width: 991.98px) {
    .pb-auth-main {
        padding: 2rem 2rem;
    }
    .pb-auth-box {
        max-width: 480px;
        padding: 2.25rem 2rem;
    }
    .pb-auth-box--wide {
        max-width: 560px;
    }
}

/* === MOBILE (<768px): full-width dengan padding nyaman === */
@media (max-width: 767.98px) {
    .pb-auth-main {
        padding: 1rem 0.75rem;
        align-items: flex-start;
    }
    .pb-auth-box {
        padding: 1.75rem 1.25rem;
        max-width: 100%;
        border-radius: var(--pb-radius);
        box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    }
    .pb-auth-box--wide {
        max-width: 100%;
    }
}

/* === SMALL MOBILE (<480px): kompak === */
@media (max-width: 479.98px) {
    .pb-auth-main {
        padding: 0.75rem 0.5rem;
    }
    .pb-auth-box {
        padding: 1.5rem 1rem;
        border-radius: 0.6rem;
    }
}

/* --- Header kartu: logo + judul --- */
.pb-auth-title {
    font-size:   1.35rem;
    color:       var(--pb-gelap);
    margin-bottom: 0.25rem;
}

@media (max-width: 479.98px) {
    .pb-auth-title {
        font-size: 1.15rem;
    }
}

/* --- Input group custom --- */
.pb-input-group {
    border-radius: var(--pb-radius);
    overflow: visible;
}

.pb-input-icon {
    background:   var(--pb-abu-muda);
    border:       1px solid var(--pb-garis);
    border-right: none;
    color:        var(--pb-abu);
    padding:      0 0.85rem;
}

.pb-input {
    border: 1px solid var(--pb-garis);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
}

.pb-input:focus {
    border-color: var(--pb-merah);
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.12);
}

/* Touch-friendly: tinggi input minimal 44px di mobile */
@media (max-width: 767.98px) {
    .pb-input,
    .pb-input-icon,
    .pb-btn-show-pass {
        min-height: 44px;
    }
    .pb-input {
        font-size: 1rem; /* Cegah zoom auto di iOS */
    }
}

/* --- Tombol show/hide password --- */
.pb-btn-show-pass {
    background:   var(--pb-abu-muda);
    border:       1px solid var(--pb-garis);
    border-left:  none;
    color:        var(--pb-abu);
    padding:      0.375rem 0.7rem;
    transition:   color 0.2s;
}
.pb-btn-show-pass:hover {
    color: var(--pb-merah);
    background: var(--pb-abu-muda);
}

/* --- Password strength meter --- */
.pb-pw-meter {
    height:        5px;
    background:    var(--pb-garis);
    border-radius: 999px;
    overflow:      hidden;
}
.pb-pw-bar {
    height:     100%;
    width:      0%;
    background: var(--pb-merah);
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
}

/* --- Kotak kebijakan registrasi --- */
.pb-policy-box {
    background:    var(--pb-abu-muda);
    border:        1px solid var(--pb-garis);
    border-radius: var(--pb-radius);
    padding:       0.75rem 1rem;
    font-size:     0.8rem;
    color:         var(--pb-abu-tua);
    line-height:   1.5;
}

/* --- Security note di bawah form --- */
.pb-auth-security-note {
    text-align: center;
    font-size:  0.75rem;
    color:      var(--pb-abu);
    border-top: 1px solid var(--pb-garis);
    padding-top: 0.75rem;
}

/* --- Ikon share di modal --- */
.pb-share-icon-btn {
    width:           52px;
    height:          52px;
    border-radius:   50%;
    border:          none;
    display:         flex;
    align-items:     center;
    justify-content: center;
    cursor:          pointer;
    color:           #ffffff;
    font-size:       1.35rem;
    flex-shrink:     0;
    transition:      transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow:      0 3px 10px rgba(0,0,0,0.25);
}
.pb-share-icon-btn:hover {
    transform:  translateY(-3px) scale(1.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.pb-share-icon-btn:active {
    transform: scale(0.95);
}

/* --- Strip tombol aksi di dalam card login/register ---
   4 tombol selalu sejajar dalam 1 baris di semua ukuran layar */
.pb-action-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    border-top: 1px solid var(--pb-garis);
    padding-top: 1.1rem;
}

.pb-sbtn {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           100%;
    padding:         0.75rem 0;
    border-radius:   0.85rem;
    border:          none;
    cursor:          pointer;
    transition:      transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.pb-sbtn i {
    font-size:   1.5rem;
    line-height: 1;
}

.pb-sbtn:hover {
    transform:  translateY(-2px);
    filter:     brightness(1.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

.pb-sbtn:active {
    transform: translateY(0);
    filter:    brightness(0.95);
}

/* Bagikan — navy elegan */
.pb-sbtn--share {
    background: linear-gradient(145deg, #1B2A4A 0%, #2C3E6B 100%);
    color:      #E8D5A3;
    box-shadow: 0 4px 14px rgba(27,42,74,0.5);
}

/* Instal — hijau tua elegan */
.pb-sbtn--install {
    background: linear-gradient(145deg, #14532D 0%, #1A6B3A 100%);
    color:      #BBFAD0;
    box-shadow: 0 4px 14px rgba(20,83,45,0.5);
}

/* Izin Browser — ungu tua elegan */
.pb-sbtn--perm {
    background: linear-gradient(145deg, #3B1F5E 0%, #52307F 100%);
    color:      #E4DAFF;
    box-shadow: 0 4px 14px rgba(59,31,94,0.5);
}

@media (max-width: 479.98px) {
    .pb-action-strip {
        gap: 0.4rem;
    }
    .pb-sbtn {
        font-size: 0.68rem;
        padding:   0.7rem 0.2rem;
    }
    .pb-sbtn i {
        font-size: 1.1rem;
    }
}

/* --- Footer auth --- */
.pb-auth-footer {
    position: relative;
    z-index:  1;
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem;
}

@media (max-width: 767.98px) {
    .pb-auth-footer {
        font-size: 0.75rem;
    }
}

/* --- CAPTCHA: proporsional di semua ukuran --- */
@media (max-width: 479.98px) {
    .pb-captcha-img {
        /* object-fit:cover memotong sisi kanan sehingga karakter ke-5 terpotong.
           Gunakan width:100% + object-fit:contain agar seluruh gambar tampil utuh.
           max-width dibatasi agar tidak memakan seluruh lebar layar. */
        width: 100%;
        max-width: 260px;
        height: auto;
        object-fit: contain;
    }
}

/* --- Register: row 2-kolom menjadi 1-kolom di mobile kecil --- */
@media (max-width: 575.98px) {
    .pb-auth-box--wide .row.g-3 > [class*="col-sm-6"] {
        grid-column: span 12;
    }
}

/* ================================================================
   NAVBAR — User info dan logout button
   ================================================================ */

.pb-user-avatar {
    width:         36px;
    height:        36px;
    border-radius: 50%;
    background:    rgba(255, 255, 255, 0.2);
    color:         var(--pb-putih);
    display:       flex;
    align-items:   center;
    justify-content: center;
    font-weight:   700;
    font-size:     0.9rem;
    flex-shrink:   0;
    border:        2px solid rgba(255, 255, 255, 0.3);
}

.pb-user-name {
    font-size:  0.85rem;
    color:      var(--pb-putih);
    font-weight: 600;
    line-height: 1.1;
}

.pb-user-role {
    font-size: 0.7rem;
    color:     rgba(255, 255, 255, 0.6);
    line-height: 1.1;
}

.pb-btn-logout {
    background:   rgba(255, 255, 255, 0.12);
    color:        rgba(255, 255, 255, 0.9);
    border:       1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--pb-radius);
    padding:      0.35rem 0.75rem;
    font-size:    0.85rem;
    font-weight:  500;
    transition:   background var(--pb-transition), color var(--pb-transition);
}

.pb-btn-logout:hover {
    background: rgba(255, 255, 255, 0.22);
    color:      var(--pb-putih);
}

@media (max-width: 767.98px) {
    .pb-auth-box {
        padding: 2rem 1.25rem;
    }
}

/* ================================================================
   NAVBAR — Tombol Izin Browser
   ================================================================ */

.pb-btn-perm {
    background:   rgba(255, 255, 255, 0.12);
    color:        rgba(255, 255, 255, 0.85);
    border:       1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--pb-radius);
    padding:      0.35rem 0.65rem;
    font-size:    0.95rem;
    transition:   background var(--pb-transition), color var(--pb-transition);
}
.pb-btn-perm:hover {
    background:   rgba(255, 255, 255, 0.22);
    color:        var(--pb-putih);
}

/* Hilangkan caret default Bootstrap pada dropdown admin */
.pb-btn-perm.dropdown-toggle::after {
    display: none;
}

/* Dropdown menu admin */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: var(--pb-radius);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--pb-merah-muda);
    color:      var(--pb-merah);
}

/* Mobile: pastikan dropdown admin tidak keluar layar ke kanan.
   Pada xs (<576px) dropdown-menu-sm-end tidak aktif, sehingga
   Popper memakai alignment start (kiri). Kita batasi lebar agar
   tidak melebihi viewport dan geser agar selalu masuk layar. */
@media (max-width: 575.98px) {
    .pb-navbar .dropdown-menu {
        max-width: calc(100vw - 1rem);
        min-width: 200px;
    }
}

/* ================================================================
   CAPTCHA
   ================================================================ */

.pb-captcha-wrap {
    display:      flex;
    align-items:  center;
    gap:          0.5rem;
    margin-bottom: 0.5rem;
}

.pb-captcha-img {
    height:        100px;
    width:         auto;
    border:        1px solid var(--pb-garis);
    border-radius: var(--pb-radius);
    background:    var(--pb-abu-muda);
    cursor:        default;
    user-select:   none;
    display:       block;
}

.pb-captcha-refresh {
    background:   var(--pb-abu-muda);
    border:       1px solid var(--pb-garis);
    color:        var(--pb-abu-tua);
    border-radius: var(--pb-radius);
    padding:      0.35rem 0.6rem;
    font-size:    0.9rem;
    transition:   all var(--pb-transition);
    flex-shrink:  0;
}
.pb-captcha-refresh:hover {
    background:   var(--pb-merah-muda);
    color:        var(--pb-merah);
    border-color: var(--pb-merah);
    transform:    rotate(15deg);
}

/* ================================================================
   ADMIN — MANAJEMEN PENGGUNA (users.php)
   Desain ringkas, elegan, dan responsif (desktop/tablet/mobile)
   ================================================================ */

/* Warna status tambahan — versi elegan/muted, bukan warna Bootstrap default */
:root {
    --pb-hijau:       #2E7D57;
    --pb-hijau-muda:  #EAF4EE;
    --pb-hijau-garis: #BFE0CD;

    --pb-amber:       #A9700D;
    --pb-amber-muda:  #FBF1E1;
    --pb-amber-garis: #F0D9A8;

    --pb-biru:        #1F5C82;
    --pb-biru-muda:   #E7F0F5;
    --pb-biru-garis:  #BEDAE8;

    --pb-netral-muda: #EDEDF2;
    --pb-netral-garis:#DCDCE4;

    --pb-stat-merah:  #7C1D22;
    --pb-stat-hijau:  #1E5631;
    --pb-stat-emas:   #96702C;
    --pb-stat-biru:   #163A5C;
}

/* --- Header halaman: ringkas, tidak "gendut" --- */
.pb-admin-header {
    background:  var(--pb-gelap);
    padding:     1.35rem 0;
    border-bottom: 3px solid var(--pb-merah);
}

.pb-admin-icon {
    width:          2.5rem;
    height:         2.5rem;
    border-radius:  0.65rem;
    background:     rgba(255, 255, 255, 0.1);
    color:          var(--pb-emas);
    display:        flex;
    align-items:    center;
    justify-content: center;
    font-size:      1.15rem;
    flex-shrink:    0;
}

.pb-admin-breadcrumb {
    font-size:  0.72rem;
    color:      rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
}
.pb-admin-breadcrumb a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}
.pb-admin-breadcrumb a:hover { color: var(--pb-putih); }

.pb-admin-title {
    font-size:   1.15rem;
    font-weight: 700;
    color:       var(--pb-putih);
    margin:      0.1rem 0 0;
    line-height: 1.2;
}

/* Tombol ukuran ringkas, dipakai berulang di halaman admin */
.pb-btn-compact {
    font-size: 0.82rem;
    padding:   0.45rem 0.9rem;
    display:   inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* --- Strip statistik: ringkas & horizontal --- */
.pb-stat-chip {
    display:       flex;
    align-items:   center;
    gap:           0.65rem;
    background:    var(--chip-color, var(--pb-stat-merah));
    border:        1px solid color-mix(in srgb, var(--chip-color, var(--pb-stat-merah)) 82%, black);
    border-radius: 0.65rem;
    padding:       0.7rem 0.85rem;
    height:        100%;
    box-shadow:    0 2px 8px rgba(0, 0, 0, 0.1);
    transition:    box-shadow var(--pb-transition), transform var(--pb-transition);
}
.pb-stat-chip:hover {
    box-shadow:   0 8px 18px rgba(0, 0, 0, 0.18);
    transform:    translateY(-2px);
}
.pb-stat-icon {
    width:          2.1rem;
    height:         2.1rem;
    border-radius:  0.55rem;
    background:     rgba(255, 255, 255, 0.16);
    color:          var(--pb-putih);
    display:        flex;
    align-items:    center;
    justify-content: center;
    font-size:      0.95rem;
    flex-shrink:    0;
}
.pb-stat-value {
    font-size:   1.15rem;
    font-weight: 700;
    color:       var(--pb-putih);
    line-height: 1.15;
}
.pb-stat-label {
    font-size: 0.7rem;
    color:     rgba(255, 255, 255, 0.8);
    margin-top: 0.05rem;
}

/* --- Tab konfigurasi (pb-config-tab): warna bereaksi ke class .active
       yang di-toggle oleh Bootstrap saat tab diklik, bukan lewat inline style --- */
#configTabs .pb-config-tab {
    background:   var(--pb-abu-muda);
    color:        var(--pb-abu-tua);
    border:       none;
    transition:   background var(--pb-transition), color var(--pb-transition);
}
#configTabs .pb-config-tab:hover:not(.active) {
    background: var(--pb-emas-muda);
    color:      var(--pb-gelap);
}
#configTabs .pb-config-tab.active {
    background: var(--pb-merah);
    color:      #fff;
}

/* --- Kartu filter: ringkas --- */
.pb-filter-card {
    background:    var(--pb-putih);
    border:        1px solid var(--pb-garis);
    border-radius: 0.65rem;
    padding:       0.9rem 1rem;
}
.pb-filter-card .form-label {
    font-size:     0.7rem;
    font-weight:   600;
    color:         var(--pb-abu-tua);
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}
.pb-filter-card .form-control,
.pb-filter-card .form-select {
    font-size: 0.85rem;
    padding:   0.45rem 0.7rem;
    border-color: var(--pb-garis);
}
.pb-filter-card .form-control:focus,
.pb-filter-card .form-select:focus {
    border-color: var(--pb-merah);
    box-shadow:   0 0 0 3px var(--pb-merah-muda);
}
.pb-filter-card .input-group-text {
    background:   var(--pb-abu-muda);
    border-color: var(--pb-garis);
    color:        var(--pb-abu);
    font-size:    0.85rem;
}

/* --- Kartu tabel --- */
.pb-table-card {
    background:    var(--pb-putih);
    border:        1px solid var(--pb-garis);
    border-radius: 0.65rem;
    overflow:      hidden;
}

/* --- Kartu form (tambah/edit), selaras dgn pb-table-card & pb-utable --- */
.pb-form-card {
    background:    var(--pb-putih);
    border:        1px solid var(--pb-garis);
    border-radius: 0.65rem;
    overflow:      hidden;
}
.pb-form-card-header {
    display:        flex;
    align-items:    center;
    gap:            0.65rem;
    background:     var(--pb-gelap);
    border-bottom:  2px solid var(--pb-emas);
    padding:        0.85rem 1.1rem;
}
.pb-form-card-header .pb-form-card-icon {
    width:          2.1rem;
    height:         2.1rem;
    border-radius:  0.55rem;
    background:     rgba(255, 255, 255, 0.1);
    color:          var(--pb-emas);
    display:        flex;
    align-items:    center;
    justify-content: center;
    font-size:      0.95rem;
    flex-shrink:    0;
}
.pb-form-card-header h2 {
    font-size:   0.95rem;
    font-weight: 700;
    color:       var(--pb-putih);
    margin:      0;
    line-height: 1.2;
}
.pb-form-card-header p {
    font-size: 0.72rem;
    color:     rgba(255, 255, 255, 0.65);
    margin:    0.15rem 0 0;
}
.pb-form-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
}
.pb-form-section-title {
    display:        flex;
    align-items:    center;
    gap:            0.5rem;
    font-size:      0.72rem;
    font-weight:    700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color:          var(--pb-abu-tua);
    margin:         0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom:  1px solid var(--pb-garis);
}
.pb-form-section-title i { color: var(--pb-merah); }
.pb-form-tip {
    display:       flex;
    gap:           0.6rem;
    align-items:   flex-start;
    background:    var(--pb-abu-muda);
    border:        1px solid var(--pb-garis);
    border-left:   3px solid var(--pb-emas);
    border-radius: 0.5rem;
    padding:       0.65rem 0.85rem;
    font-size:     0.76rem;
    color:         var(--pb-abu-tua);
    line-height:   1.5;
}
.pb-form-tip i { color: var(--pb-emas); margin-top: 0.15rem; }

.pb-utable {
    font-size: 0.83rem;
    margin-bottom: 0;
}
.pb-utable thead th {
    background:    var(--pb-gelap);
    border-bottom: 2px solid var(--pb-emas);
    color:         rgba(255, 255, 255, 0.82);
    font-size:     0.68rem;
    font-weight:   700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding:       0.65rem 0.85rem;
    white-space:   nowrap;
}
.pb-utable tbody td {
    padding:       0.6rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--pb-garis);
}
.pb-utable tbody tr:last-child td { border-bottom: none; }
.pb-utable tbody tr:hover { background: var(--pb-abu-muda); }
.pb-utable tbody tr.is-inactive { opacity: 0.6; }

/* Avatar ringkas di tabel/kartu */
.pb-avatar-sm {
    width:          32px;
    height:         32px;
    border-radius:  50%;
    display:        flex;
    align-items:    center;
    justify-content: center;
    color:          #fff;
    font-weight:    700;
    font-size:      0.78rem;
    flex-shrink:    0;
}

.pb-uname {
    font-size:   0.85rem;
    font-weight: 600;
    color:       var(--pb-gelap);
}
.pb-uemail {
    font-size: 0.72rem;
    color:     var(--pb-abu);
}
.pb-unip {
    font-size:     0.72rem;
    color:         var(--pb-abu-tua);
    background:    var(--pb-abu-muda);
    padding:       0.15rem 0.45rem;
    border-radius: 0.35rem;
    letter-spacing: 0.02em;
}

/* Badge role & status — versi tipis, tidak mencolok */
.pb-chip {
    display:       inline-flex;
    align-items:   center;
    gap:           0.3rem;
    font-size:     0.68rem;
    font-weight:   600;
    padding:       0.22rem 0.55rem;
    border-radius: 999px;
    border:        1px solid transparent;
    white-space:   nowrap;
}
.pb-chip--admin    { background: var(--pb-merah-muda); color: var(--pb-merah-gelap); border-color: #f0c6c8; }
.pb-chip--pimpinan { background: var(--pb-biru-muda);  color: var(--pb-biru);        border-color: var(--pb-biru-garis); }
.pb-chip--pegawai  { background: var(--pb-hijau-muda); color: var(--pb-hijau);       border-color: var(--pb-hijau-garis); }
.pb-chip--netral   { background: var(--pb-netral-muda);color: var(--pb-abu-tua);     border-color: var(--pb-netral-garis); }

.pb-chip--active   { background: var(--pb-hijau-muda); color: var(--pb-hijau);       border-color: var(--pb-hijau-garis); }
.pb-chip--inactive { background: var(--pb-netral-muda);color: var(--pb-abu-tua);     border-color: var(--pb-netral-garis); }
.pb-chip--locked   { background: var(--pb-amber-muda); color: var(--pb-amber);       border-color: var(--pb-amber-garis); }

/* Tombol aksi ikon — kecil, outline, tidak "gendut" */
.pb-action-btn {
    width:          30px;
    height:         30px;
    display:        inline-flex;
    align-items:    center;
    justify-content: center;
    border-radius:  0.5rem;
    border:         1px solid var(--pb-garis);
    background:     var(--pb-putih);
    color:          var(--pb-abu-tua);
    font-size:      0.82rem;
    transition:     all var(--pb-transition);
    flex-shrink:    0;
}
.pb-action-btn:hover  { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.1); }
.pb-action-btn--edit:hover   { background: var(--pb-gelap);   color: #fff; border-color: var(--pb-gelap); }
.pb-action-btn--on:hover     { background: var(--pb-hijau);   color: #fff; border-color: var(--pb-hijau); }
.pb-action-btn--off:hover    { background: var(--pb-amber);   color: #fff; border-color: var(--pb-amber); }
.pb-action-btn--delete:hover { background: var(--pb-merah);   color: #fff; border-color: var(--pb-merah); }
.pb-action-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* --- Footer tabel: info + paginasi --- */
.pb-table-footer {
    background:  var(--pb-gelap);
    border-top:  2px solid var(--pb-emas);
    padding:     0.65rem 1rem;
    font-size:   0.78rem;
    color:       rgba(255, 255, 255, 0.68);
}
.pb-table-footer strong { color: var(--pb-putih); }
.pb-table-footer .pagination { margin-bottom: 0; }
.pb-table-footer .page-link {
    font-size: 0.78rem;
    color:     var(--pb-gelap);
    border-color: transparent;
}
.pb-table-footer .page-item.active .page-link {
    background:   var(--pb-merah);
    border-color: var(--pb-merah);
    color:        var(--pb-putih);
}
.pb-table-footer .page-item.disabled .page-link {
    color:      rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

/* --- Daftar kartu untuk MOBILE (pengganti tabel di layar sempit) --- */
.pb-user-cards { display: none; }

.pb-user-card {
    display:       flex;
    align-items:   flex-start;
    gap:           0.65rem;
    padding:       0.85rem 1rem;
    border-bottom: 1px solid var(--pb-garis);
}
.pb-user-card:last-child { border-bottom: none; }
.pb-user-card.is-inactive { opacity: 0.6; }

.pb-user-card-body { flex: 1; min-width: 0; }

.pb-user-card-top {
    display:        flex;
    align-items:    flex-start;
    justify-content: space-between;
    gap:            0.5rem;
}

.pb-user-card-meta {
    display:       flex;
    flex-wrap:     wrap;
    align-items:   center;
    gap:           0.35rem;
    margin-top:    0.4rem;
}

.pb-user-card-actions {
    display: flex;
    gap:     0.4rem;
    margin-top: 0.55rem;
}

.pb-user-card-login {
    font-size: 0.7rem;
    color:     var(--pb-abu);
    margin-top: 0.3rem;
}

/* --- Breakpoint: di bawah 768px tabel disembunyikan, kartu ditampilkan --- */
@media (max-width: 767.98px) {
    .pb-utable-wrap { display: none; }
    .pb-user-cards  { display: block; }

    .pb-admin-header { padding: 1.1rem 0; }
    .pb-admin-title  { font-size: 1.02rem; }
    .pb-admin-icon   { width: 2.15rem; height: 2.15rem; font-size: 1rem; }

    .pb-stat-value { font-size: 1.02rem; }
    .pb-stat-icon  { width: 1.9rem; height: 1.9rem; font-size: 0.85rem; }
    .pb-stat-chip  { padding: 0.6rem 0.7rem; }
}

@media (max-width: 479.98px) {
    .pb-btn-compact span { display: none; }
    .pb-btn-compact { padding: 0.5rem 0.6rem; }
}
/* ================================================================
   SHARE MODULE — Tombol & Modal Berbagi
   ================================================================ */

/* Tombol Share di navbar — sama dengan pb-btn-perm */
#btn-share-app {
    position: relative;
}

/* Animasi pulse pada icon share (opsional) */
@keyframes pb-share-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* Modal Share — tombol platform */
#modalShare .btn {
    transition: opacity var(--pb-transition), transform var(--pb-transition);
}
#modalShare .btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
#modalShare .btn:active {
    transform: translateY(0);
}

/* Preview banner WA */
#pb-wa-banner-preview {
    border: 2px solid var(--pb-garis);
    transition: opacity 0.3s;
}

/* Salin link badge */
#pb-share-copy-btn {
    white-space: nowrap;
    font-size: 0.78rem;
}

/* Native share wrap — hidden on desktop jika tidak didukung */
.pb-share-native-wrap { }