/* ============================================================================
   agrimaps.id — area premium
   Tema gelap/terang, panel kaca, peta vektor, panel informasi ala Google Maps.
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
    /* Satu keluarga huruf dengan tampilan publik (Inter 400–800), tanpa font
       tambahan: display & mono memakai Inter agar identitas tetap sama. */
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --accent: #17d39a;
    --accent-strong: #0b8457;
    --accent-fill: #17d39a;   /* permukaan hijau terisi */
    --accent-text: #17d39a;   /* aksen sebagai teks (9,3:1 di panel gelap) */
    --on-accent: #083026;     /* teks di atas --accent-fill (kontras 7,4:1) */
    --gold: #e6c48a;
    --danger: #ff6b6b;

    --tb-h: 70px;
    --panel-w: 372px;
    --drawer-w: 408px;
}

html[data-theme="dark"] {
    --bg: #050908;
    --bg-2: #08110f;
    --glass: rgba(15, 24, 22, 0.72);
    --glass-strong: rgba(11, 19, 17, 0.9);
    --glass-soft: rgba(255, 255, 255, 0.045);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #e9f3f0;
    --text-2: #b9cbc7;
    --muted: #829996;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
    --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.42);
    --mesh-1: rgba(23, 211, 154, 0.34);
    --mesh-2: rgba(11, 132, 87, 0.44);
    --mesh-3: rgba(230, 196, 138, 0.16);
}

html[data-theme="light"] {
    --bg: #eef3f1;
    --bg-2: #e3ebe7;
    --glass: rgba(255, 255, 255, 0.86);
    --glass-strong: rgba(255, 255, 255, 0.96);
    --glass-soft: rgba(11, 32, 28, 0.04);
    --line: rgba(11, 32, 28, 0.1);
    --line-strong: rgba(11, 32, 28, 0.2);
    --text: #0c211d;
    --text-2: #2c443f;
    --muted: #5c7570;
    --shadow: 0 22px 54px rgba(9, 40, 33, 0.16);
    --shadow-sm: 0 8px 22px rgba(9, 40, 33, 0.1);
    --accent: #0b8457;
    --accent-fill: #0a7049;   /* lebih tua agar teks putih lolos AA (6,2:1) */
    --accent-text: #0a7049;   /* aksen sebagai teks (6,2:1 di latar putih) */
    --on-accent: #ffffff;
    --gold: #a3762a;
    --mesh-1: rgba(23, 211, 154, 0.35);
    --mesh-2: rgba(11, 132, 87, 0.28);
    --mesh-3: rgba(230, 196, 138, 0.34);
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

body.is-app { overflow: hidden; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(23, 211, 154, 0.32); }

/* ------------------------------------------------------------- tombol dasar */
.icon-btn {
    width: 40px; height: 40px;
    display: inline-grid; place-items: center;
    padding: 0; line-height: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
    font-size: 15px;
    transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }

/* Ikon toggle = SVG garis 18px, bukan glyph teks (☀/☾) yang duduk di baseline
   dan selalu terlihat naik dari pusat tombol. */
.ic-sun, .ic-moon { display: none; width: 18px; height: 18px; }
.icon-btn svg {
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
    overflow: visible;
}
html[data-theme="dark"] .ic-sun { display: block; }
html[data-theme="light"] .ic-moon { display: block; }

.ghost-btn {
    display: inline-flex; align-items: center;
    height: 40px; padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
    font-size: 12.5px; font-weight: 600;
    letter-spacing: .2px;
    transition: background .18s, color .18s, border-color .18s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--glass); }

/* ==========================================================================
   GERBANG LOGIN
   ======================================================================== */
.gate {
    display: grid;
    grid-template-columns: 1.12fr 1fr;
    min-height: 100dvh;
}

.gate-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 52px 38px;
    background: #06231b;      /* hijau tua solid, sama di mode terang & gelap */
    color: #eafaf4;
}

.gate-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(75% 70% at 30% 30%, #000 0%, transparent 88%);
    -webkit-mask-image: radial-gradient(75% 70% at 30% 30%, #000 0%, transparent 88%);
}

.gate-topline {
    position: relative;
    display: flex; align-items: center; gap: 16px;
    font-family: var(--font-display);
    font-weight: 700; letter-spacing: .1px;
    font-size: 19px;
    line-height: 1.3;
    max-width: 560px;
}
.gate-topline span { min-width: 0; flex: 1 1 auto; }

/* --------------------------------------------------- dropdown bahasa */
.langdd { position: relative; flex: none; }
.langdd > summary {
    list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 8px 6px 10px; border-radius: 9px;
    background: var(--glass-soft); border: 1px solid var(--line-strong);
    color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
    transition: background .16s, border-color .16s;
}
.langdd > summary::-webkit-details-marker { display: none; }
.langdd > summary::marker { content: ""; }
.langdd > summary:hover { background: var(--glass); border-color: var(--text-2); }
.langdd[open] > summary { background: var(--glass); border-color: var(--accent-fill); }
.langdd .langdd-caret { width: 12px; height: 12px; transition: transform .18s; }
.langdd[open] .langdd-caret { transform: rotate(180deg); }
.langdd-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
    min-width: 196px; padding: 6px; border-radius: 12px;
    background: var(--glass-strong); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.langdd-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 11px; border-radius: 8px; text-decoration: none;
    color: var(--text-2); font-size: 13px; font-weight: 600;
    transition: background .16s, color .16s;
}
.langdd-item:hover { background: var(--glass-soft); color: var(--text); }
.langdd-item.is-on { background: var(--glass-soft); color: var(--text); }
.langdd-code {
    min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 999px;
    background: var(--glass-soft); color: inherit;
    font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
}
.langdd-item.is-on .langdd-code { background: var(--accent-fill); color: var(--on-accent); }

/* Topbar peta member */
.tb-right .langdd { margin-right: 2px; }

/* Baris judul kartu (login / reset / profil) dengan dropdown di kanan */
.gate-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 0 0 22px;
}
.gate-card-head .gate-login-title,
.gate-card-head .reset-title { margin: 0; }

.gate-logo-sm {
    width: 46px; height: 46px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .92);
    padding: 4px;
    flex: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}

.gate-copy { position: relative; max-width: 560px; margin: auto 0; }

/* Blok teks kiri disejajarkan dengan kartu login di kolom kanan (dua kolom,
   layar cukup tinggi): kartu duduk 28,6px di atas sumbu tengah kolom karena
   gap + footer di bawahnya, sedangkan blok teks 25px di bawah sumbu itu karena
   topline di atasnya — jadi blok teks digeser -53,6px supaya titik tengah
   keduanya sebaris. Nilainya konstan untuk semua tinggi layar dan semua tinggi
   kartu (diukur 620–1080px tinggi layar, kartu 398–551px). Di bawah 620px
   tinggi layar geseran dilepas agar teks tidak menabrak topline. */
@media (min-width: 981px) and (min-height: 620px) {
    .gate-copy { top: -53.6px; }
}

.gate-copy h1 {
    margin: 20px 0 22px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(30px, 3.3vw, 46px);
    line-height: 1.1;
    letter-spacing: -.6px;
}

.gate-points {
    margin: 0; padding: 0; list-style: none;
    display: grid; gap: 14px;
    max-width: 480px;
}
.gate-points li {
    position: relative;
    padding-left: 30px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(234, 250, 244, .82);
}
.gate-points li::before {
    content: "";
    position: absolute; left: 0; top: 4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(23, 211, 154, .16);
    border: 1px solid rgba(23, 211, 154, .55);
}
.gate-points li::after {
    content: "";
    position: absolute; left: 5px; top: 9px;
    width: 8px; height: 4px;
    border-left: 1.6px solid #4ff0bc;
    border-bottom: 1.6px solid #4ff0bc;
    transform: rotate(-45deg);
}

.gate-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 42px 28px;
    background: var(--bg);
}


.gate-card {
    width: 430px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    padding: 34px 34px 32px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: var(--glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.gate-login-title {
    margin: 0 0 24px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    line-height: 1.15;
    color: var(--text);
}

.fld-label {
    display: block;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.fld {
    display: block;
    width: 100%;
    height: 48px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.fld::placeholder { color: var(--muted); font-family: var(--font-body); font-size: 14px; }
.fld:focus {
    border-color: rgba(23, 211, 154, .55);
    box-shadow: 0 0 0 4px rgba(23, 211, 154, .12);
    background: var(--glass-strong);
}

.fld-btn {
    height: 48px;
    margin-top: 4px;
    border: none;
    border-radius: var(--r-sm);
    background: var(--accent-fill);
    color: var(--on-accent);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .3px;
    box-shadow: 0 10px 24px rgba(11, 132, 87, .28);
    transition: transform .16s, box-shadow .16s, filter .16s;
}
.fld-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.fld-btn:active { transform: translateY(0); }

.gate-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255, 107, 107, .38);
    background: rgba(255, 107, 107, .1);
    color: #ffb3b3;
    font-size: 13px;
    line-height: 1.45;
}
html[data-theme="light"] .gate-alert { color: #8e1f1f; }

.gate-forgot {
    align-self: center;
    margin-top: 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 1px solid transparent;
    transition: color .18s, border-color .18s;
}
.gate-forgot:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.gate-forgot.gate-second { margin-top: 14px; font-size: 12px; }

/* "Lupa kata sandi?" tepat di bawah kolom kata sandi */
.gate-forgot.gate-forgot-inline {
    align-self: flex-end;
    margin: -6px 0 18px;
    font-size: 12px;
}
.fld.fld-pw { margin-bottom: 10px; }

.gate-back {
    font-size: 12.5px;
    color: var(--muted);
    letter-spacing: .2px;
    transition: color .18s;
}
.gate-back:hover { color: var(--text); }

/* ==========================================================================
   APLIKASI PETA
   ======================================================================== */
.app { height: 100dvh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- topbar */
.topbar {
    position: relative;
    z-index: 40;
    flex: 0 0 var(--tb-h);
    height: var(--tb-h);
    /* Tiga kolom: brand di kiri, kolom pencarian tepat di tengah header,
       kontrol akun di kanan. Dua kolom 1fr yang sama lebar mengunci kolom
       tengah di titik center header, bukan menempel setelah brand. */
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.tb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; justify-self: start; }
.tb-logo {
    width: 36px; height: 36px; border-radius: 12px;
    background: rgba(255, 255, 255, .9); padding: 3px; object-fit: contain;
    box-shadow: var(--shadow-sm);
}
.tb-brandtext { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tb-brandtext b {
    font-family: var(--font-display);
    font-size: 14.5px; font-weight: 700; letter-spacing: -.1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tb-search {
    position: relative;
    width: 100%;
    justify-self: center;
    display: flex; align-items: center;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.tb-search:focus-within {
    border-color: rgba(23, 211, 154, .5);
    box-shadow: 0 0 0 4px rgba(23, 211, 154, .1);
    background: var(--glass);
}
.tb-search-icon {
    width: 16px; height: 16px;
    margin: 0 10px 0 16px;
    border: 1.9px solid var(--muted);
    border-radius: 50%;
    position: relative;
    flex: none;
}
.tb-search-icon::after {
    content: "";
    position: absolute; right: -5px; bottom: -3px;
    width: 7px; height: 1.9px;
    background: var(--muted);
    transform: rotate(45deg);
    border-radius: 2px;
}
.tb-search input {
    flex: 1 1 auto;
    min-width: 0;            /* boleh menyusut: placeholder panjang tidak menabrak klaster kanan */
    height: 100%;
    border: none; outline: none; background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13.5px;
}
.tb-search input::placeholder { color: var(--muted); }
.tb-search input::-webkit-search-cancel-button { display: none; }

.tb-clear {
    width: 26px; height: 26px; margin-right: 8px;
    border: none; border-radius: 50%;
    background: var(--glass-soft);
    color: var(--text-2);
    font-size: 16px; line-height: 1;
}

.tb-right { display: flex; align-items: center; gap: 10px; justify-self: end; }

.userwrap { position: relative; }

.userchip {
    display: flex; align-items: center; gap: 11px;
    padding: 6px 14px 6px 6px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}
.userchip:hover,
.userwrap:hover .userchip,
.userwrap:focus-within .userchip,
.userchip[aria-expanded="true"] { border-color: var(--line-strong); background: var(--glass); }

.userchip-caret {
    width: 7px; height: 7px;
    margin-left: 2px;
    border-right: 1.6px solid var(--muted);
    border-bottom: 1.6px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s, border-color .2s;
}
.userwrap:hover .userchip-caret,
.userwrap:focus-within .userchip-caret,
.userchip[aria-expanded="true"] .userchip-caret {
    border-color: var(--text-2);
    transform: rotate(225deg) translateY(-2px);
}

.usermenu {
    position: absolute;
    z-index: 60;
    right: 0;
    top: calc(100% + 10px);
    min-width: 224px;
    padding: 7px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--glass-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .16s, transform .16s;
}
/* tampil saat chip di-hover, difokus keyboard, atau dibuka lewat klik (mobile) */
.userwrap:hover .usermenu,
.userwrap:focus-within .usermenu,
.usermenu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.usermenu-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px; font-weight: 600;
    line-height: 1.25;
    text-align: left;
    color: var(--text-2);
    cursor: pointer;
    transition: background .14s, color .14s;
}
/* kotak ikon seragam: SVG 16px, sejajar rata kiri */
.usermenu-item .umi-ic {
    flex: none;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    color: inherit;
    opacity: .9;
}
.usermenu-item .umi-ic svg { width: 16px; height: 16px; display: block; }
.usermenu-item .umi-label {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.usermenu-sep {
    height: 1px;
    margin: 6px 8px;
    background: var(--line);
}
.usermenu-item:hover { background: var(--glass-soft); color: var(--text); }
.usermenu-item.is-danger { color: #c8553f; }
html[data-theme="light"] .usermenu-item.is-danger { color: #a83a24; }
.usermenu-item.is-danger:hover { background: rgba(200, 85, 63, .12); color: #c8553f; }
html[data-theme="light"] .usermenu-item.is-danger:hover { color: #a83a24; }
.avatar {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent-fill);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 13px; font-weight: 800;
}
.userchip-text {
    display: grid;
    gap: 4px;
    padding-block: 2px;
    min-width: 0;
}
.userchip-text b {
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: .1px;
    text-transform: capitalize;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.userchip-text small {
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: .1px;
    color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- suggest */
.suggest {
    position: absolute;
    top: calc(100% + 8px); left: 0; right: 0;
    z-index: 60;
    padding: 6px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--glass-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    max-height: 340px; overflow: auto;
}
.suggest .item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 13px;
    cursor: pointer;
}
.suggest .item:hover, .suggest .item.is-on { background: var(--glass-soft); }
.suggest .item small {
    font-family: var(--font-mono);
    font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase;
    color: var(--muted);
}

/* ------------------------------------------------------------------ stage */
.stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.map { position: absolute; inset: 0; background: var(--bg-2); }
.map canvas { outline: none; }

/* Peta gelap/terang mengikuti tema UI saat basemap vektor */
html[data-theme="dark"] .maplibregl-ctrl-attrib {
    background: rgba(0, 0, 0, .42);
    border-radius: 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, .82);
}
html[data-theme="light"] .maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, .82);
    border-radius: 6px;
    font-size: 10px;
    color: #24322e;
}
html[data-theme="dark"] .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, .92); }
html[data-theme="light"] .maplibregl-ctrl-attrib a { color: #16241f; }
/* Struktur wilayah/jalan: sedikit kontras tambahan per jenis peta supaya
   jalan, batas, dan tata guna lahan tetap terbaca di kedua tema. */
.map[data-basemap="dark"] .maplibregl-canvas { filter: brightness(1.12) contrast(1.1) saturate(1.04); }
.map[data-basemap="street"] .maplibregl-canvas { filter: contrast(1.06) saturate(1.06); }
.map[data-basemap="sat"] .maplibregl-canvas { filter: saturate(1.06) contrast(1.04); }

.maplibregl-ctrl-attrib a { color: inherit; }
.maplibregl-ctrl-bottom-right { z-index: 5; }

/* ------------------------------------------------------------------ panel */
.panel {
    position: absolute;
    z-index: 20;
    top: 18px; left: 18px; bottom: 18px;
    width: var(--panel-w);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .28s;
}

.panel-grip { display: none; }

.kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kpi {
    padding: 12px 13px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    min-width: 0;
}
.kpi b {
    display: block;
    font-family: var(--font-display);
    font-size: 21px; font-weight: 800;
    letter-spacing: -.4px;
    line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi span {
    display: block;
    margin-top: 3px;
    font-family: var(--font-mono);
    font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi.is-accent { border-color: rgba(23, 211, 154, .34); background: rgba(23, 211, 154, .1); }
.kpi.is-accent b { color: var(--accent-text); }

.filters { display: flex; flex-direction: column; gap: 10px; }

.chips {
    display: flex; flex-wrap: wrap; gap: 7px;
    padding-bottom: 2px;
}
.chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
    font-size: 11.5px; font-weight: 600;
    white-space: nowrap;
    transition: background .16s, color .16s, border-color .16s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-on {
    color: var(--on-accent);
    background: var(--accent-fill);
    border-color: transparent;
}
.chip .n {
    font-family: var(--font-mono);
    font-size: 10px; opacity: .75;
}

.tenant-select {
    height: 38px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12.5px;
    outline: none;
    width: 100%;
}
.tenant-select:focus { border-color: rgba(23, 211, 154, .5); }
.tenant-select option { background: var(--bg-2); color: var(--text); }

.list-head {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0 2px;
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--muted);
}
.list-count { color: var(--text-2); }

.list {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 7px;
    margin: 0 -4px;
    padding: 0 4px 6px;
    scrollbar-width: thin;
}
.list::-webkit-scrollbar { width: 7px; }
.list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.row {
    position: relative;
    padding: 12px 13px 12px 15px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    background: var(--glass-soft);
    cursor: pointer;
    transition: background .16s, border-color .16s, transform .16s;
}
.row::before {
    content: "";
    position: absolute;
    left: 0; top: 12px; bottom: 12px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--row-color, #94a3a0);
    opacity: .85;
}
.row:hover { background: rgba(255, 255, 255, .075); transform: translateX(2px); }
html[data-theme="light"] .row:hover { background: rgba(11, 32, 28, .06); }
.row.is-active {
    border-color: rgba(23, 211, 154, .5);
    background: rgba(23, 211, 154, .1);
}
.row-top { display: flex; align-items: center; gap: 8px; }
.row-name {
    font-size: 13.5px; font-weight: 650;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub {
    margin-top: 4px; line-height: 1.5;
    font-size: 11.5px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-bot {
    margin-top: 7px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px; font-weight: 700;
    letter-spacing: .1px;
    /* warna latar & tinta dihitung per status supaya kontras >= 4,5:1 */
    background: var(--pill-bg, #94a3a0);
    color: var(--pill-ink, #04140f);
    white-space: nowrap;
}
.pill.ghost {
    color: var(--text-2);
    background: var(--glass-soft);
    border: 1px solid var(--line);
    font-weight: 600;
}
.row-val {
    font-family: var(--font-mono);
    font-size: 11.5px; font-weight: 600;
    color: var(--accent-text);
    white-space: nowrap;
}
html[data-theme="light"] .row-val { color: var(--accent-text); }

.list-empty {
    padding: 26px 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

/* --------------------------------------------------------------- mapctl   */
.mapctl {
    position: absolute;
    z-index: 18;
    left: calc(var(--panel-w) + 40px);
    bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: left .32s cubic-bezier(.4, 0, .2, 1);
}

.mapctl-group {
    display: flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.mapbtn {
    width: 40px; height: 40px;
    border: none; background: transparent;
    color: var(--text-2);
    font-size: 17px; font-weight: 600;
    display: grid; place-items: center;
    transition: background .16s, color .16s;
}
.mapbtn:hover { background: var(--glass-soft); color: var(--text); }
.mapctl-group .mapbtn + .mapbtn { border-left: 1px solid var(--line); }

.seg .segbtn {
    height: 40px;
    padding: 0 14px;
    border: none; background: transparent;
    color: var(--text-2);
    font-size: 12px; font-weight: 600;
    transition: background .16s, color .16s;
}
.seg .segbtn:hover { color: var(--text); }
.seg .segbtn.is-on {
    color: var(--on-accent);
    background: var(--accent-fill);
}
.seg .segbtn + .segbtn { border-left: 1px solid var(--line); }

/* --------------------------------------------------------------- legend   */
.legendbox {
    position: absolute;
    z-index: 16;
    right: 18px; bottom: 46px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--glass);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px);
    font-size: 11.5px;
    color: var(--text-2);
    display: grid; gap: 6px;
    transition: opacity .2s, transform .2s;
}
.legendbox .legend-title {
    font-family: var(--font-mono);
    font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}
.legendbox > div { display: flex; align-items: center; gap: 8px; }
.legendbox i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---------------------------------------------------------------- drawer  */
.drawer {
    position: absolute;
    z-index: 30;
    top: 18px; right: 18px; bottom: 18px;
    width: var(--drawer-w);
    display: flex;
    flex-direction: column;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--glass-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    overflow: hidden;
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
    transition: opacity .26s, transform .3s cubic-bezier(.4, 0, .2, 1);
}
.drawer.is-open { opacity: 1; transform: translateX(0); pointer-events: auto; }

.dw-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: thin;
}
.dw-scroll::-webkit-scrollbar { width: 7px; }
.dw-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.dw-hero {
    position: relative;
    padding: 20px 20px 18px;
    background: var(--glass-soft);
    border-bottom: 1px solid var(--line);
}
.dw-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dw-avatar {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 16px;
    background: var(--accent-fill);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 17px; font-weight: 800;
    box-shadow: var(--shadow-sm);
    flex: none;
}
.dw-titles { flex: 1 1 auto; min-width: 0; }
.dw-titles h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 19px; font-weight: 800;
    letter-spacing: -.3px;
    line-height: 1.25;
}
.dw-titles p {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--text-2);
}
.dw-close {
    width: 32px; height: 32px; flex: none;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
    line-height: 0;
    display: grid; place-items: center;
}
.dw-close svg {
    width: 15px; height: 15px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round;
}
.dw-close:hover { color: var(--text); }

.dw-statusline {
    margin-top: 16px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}

.dw-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    align-items: stretch;          /* tiga tombol selalu sama tinggi */
}
.dw-act {
    display: grid; grid-template-rows: 17px auto; justify-items: center; align-content: center;
    gap: 6px;
    min-height: 54px;              /* tinggi seragam, label 1–2 baris tetap muat */
    padding: 8px 4px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
    font-size: 10px; font-weight: 600; line-height: 1.25;
    text-align: center;
    transition: background .16s, color .16s, border-color .16s;
}
.dw-act:hover { color: var(--text); border-color: var(--line-strong); background: var(--glass); }
.dw-act.disabled { opacity: .4; pointer-events: none; }
/* Kotak ikon: ukuran sama untuk semua aksi, ikon = SVG garis (bukan glyph/emoji) */
.dw-act-ic {
    display: block; width: 17px; height: 17px; line-height: 0;
}
.dw-act-ic svg {
    display: block; width: 17px; height: 17px;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.dw-act-lbl { display: block; overflow-wrap: anywhere; }
.dw-act.is-done { color: var(--accent-text); border-color: var(--accent-fill); }

.dw-sec { padding: 18px; border-bottom: 1px solid var(--line); }
.dw-sec:last-child { border-bottom: none; }

.dw-sec-title {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1.7px; text-transform: uppercase;
    color: var(--text-2);
    opacity: .75;
    margin-bottom: 12px;
}

.kvlist {
    display: grid;
    gap: 0;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    overflow: hidden;
}
.kv {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px 13px;
    font-size: 12.5px;
    line-height: 1.55;
    border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: none; }
.kv b { font-weight: 500; color: var(--muted); }
.kv span { color: var(--text); word-break: break-word; }
.kv span.mono { font-size: 11.5px; letter-spacing: .1px; }
.kv span.dim { color: var(--muted); }

.dw-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-bottom: 12px;
}
.metric {
    padding: 12px 13px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    display: grid;
    gap: 5px;
    align-content: start;
}
.metric b {
    display: block;
    font-family: var(--font-display);
    font-size: 17px; font-weight: 800; letter-spacing: -.3px;
    line-height: 1.2;
}
.metric span {
    display: block;
    font-size: 9px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase;
    color: var(--muted);
    line-height: 1.3;
}

.progress {
    height: 8px;
    border-radius: 99px;
    background: var(--glass-soft);
    border: 1px solid var(--line);
    overflow: hidden;
    margin: 2px 0 10px;
}
.progress i {
    display: block; height: 100%;
    border-radius: 99px;
    background: var(--accent-fill);
}
.progress.is-ready i { background: #0b8457; }
.progress.is-warn i { background: #e0a800; }
.progress-line {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.hist { display: grid; gap: 8px; }
.hist-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    font-size: 12px;
}
.hist-row .h-main { min-width: 0; }
.hist-row .h-main b { font-weight: 650; }
.hist-row .h-main small {
    display: block; margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 10px; color: var(--muted);
}
.hist-row .h-pop {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 10.5px; color: var(--text-2);
    white-space: nowrap;
}

.grades { display: flex; gap: 4px; margin-top: 4px; }
.grades i {
    height: 8px; border-radius: 99px;
    display: block;
}

.note {
    margin-top: 10px;
    padding: 11px 12px;
    border-radius: var(--r-sm);
    border: 1px dashed var(--line-strong);
    background: var(--glass-soft);
    font-size: 12px;
    line-height: 1.55;
    color: var(--muted);
}

/* kelompok titik (beberapa GH memakai koordinat sama) */
.grp-list { display: grid; gap: 7px; }

/* ------------------------------------------------------------------- pin  */
/* Penting: marker MapLibre WAJIB position:absolute. Bila tertimpa
   position:relative, penanda ikut alur dokumen dan menumpuk ke bawah
   (posisi pin meleset dari koordinat aslinya). */
.pin-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
}
.pin-wrap.is-stack { width: 30px; height: 30px; }

.pin {
    position: relative;
    width: 26px; height: 26px;
    display: grid; place-items: center;
    cursor: pointer;
}
.pin i {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--pin-color, #94a3a0);
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
    transition: transform .16s;
}
.pin::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    border: 1.6px solid var(--pin-color, #94a3a0);
    opacity: 0;
}
.pin.is-ready::after { animation: pulse 2.4s ease-out infinite; }
.pin.is-hot i { box-shadow: 0 0 0 6px rgba(23, 211, 154, .22), 0 3px 12px rgba(0, 0, 0, .45); }
.pin:hover i { transform: scale(1.22); }
.pin-wrap.is-active .pin i {
    transform: scale(1.32);
    box-shadow: 0 0 0 7px rgba(23, 211, 154, .26), 0 4px 14px rgba(0, 0, 0, .5);
}

@keyframes pulse {
    0%   { transform: scale(.7); opacity: .9; }
    70%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

.pin-count {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: var(--accent-fill);
    color: var(--on-accent);
    font-family: var(--font-display);
    font-size: 12.5px; font-weight: 800;
    border: 2.5px solid rgba(255, 255, 255, .92);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .42);
    cursor: pointer;
    transition: transform .16s;
}
.pin-count:hover { transform: scale(1.1); }

.pin-tip {
    position: absolute;
    left: 50%; bottom: calc(100% + 4px);
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 11.5px; font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s, transform .16s;
}
.pin-wrap:hover .pin-tip { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* ==========================================================================
   RESPONSIF
   ======================================================================== */
@media (max-width: 1180px) {
    :root { --panel-w: 330px; --drawer-w: 372px; }
    .topbar { grid-template-columns: minmax(0, 1fr) minmax(0, 360px) minmax(0, 1fr); }
}

/* Kolom kanan topbar kini memuat pemilih bahasa: di bawah 1240px nama & level
   pengguna disembunyikan (tinggal avatar) agar kolom pencarian tetap center
   tanpa bertabrakan. */
@media (max-width: 1240px) {
    .userchip-text { display: none; }
    .userchip { padding: 4px; }
    .langdd > summary { padding: 5px 7px 5px 9px; font-size: 11px; }
}

@media (max-width: 980px) {
    /* kolom tunggal: tanpa minmax(0,1fr) lebar kartu 430px memaksa overflow */
    .gate { grid-template-columns: minmax(0, 1fr); }
    .gate-visual, .gate-panel { min-width: 0; }
    .gate-card { width: 100%; max-width: 430px; }
    .gate-visual {
        padding: 30px 26px 26px;
        min-height: 44vh;
        gap: 18px;
    }
    .gate-copy h1 { font-size: clamp(26px, 6.4vw, 34px); margin: 16px 0 16px; }
    .gate-points { gap: 10px; }
    .gate-points li { font-size: 13px; }
    .gate-panel { justify-content: flex-start; padding: 22px 20px 44px; gap: 14px; }
    .gate-card { padding: 26px 22px 24px; }
}

@media (max-width: 900px) {
    :root { --tb-h: 62px; }

    /* di layar sempit kolom tengah kembali mengisi sisa lebar, bukan dipatok 520px */
    .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 0 12px; }
    .tb-brandtext { display: none; }
    .tb-search { height: 38px; }
    .userchip-text { display: none; }
    .userchip { padding: 4px; }
    .ghost-btn { height: 36px; padding: 0 12px; font-size: 11.5px; }
    .icon-btn { width: 36px; height: 36px; }

    .panel {
        top: auto;
        left: 10px; right: 10px; bottom: 10px;
        width: auto;
        max-height: 50dvh;
        padding: 12px 12px 14px;
        gap: 11px;
    }
    .panel.is-min { max-height: 190px; }
    .panel-grip {
        display: block;
        height: 16px;
        margin: -6px auto 0;
        padding: 0;
        width: 60px;
        border: none; background: transparent;
    }
    .panel-grip span {
        display: block;
        width: 42px; height: 4px;
        margin: 6px auto 0;
        border-radius: 99px;
        background: var(--line-strong);
    }
    .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .kpi { padding: 9px 9px; }
    .kpi b { font-size: 15px; }
    .kpi span { font-size: 8.5px; letter-spacing: .6px; }
    .list { max-height: 24dvh; }
    /* chip jadi satu baris geser agar daftar tetap lega */
    .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
    .tb-search-icon { display: none; }
    .tb-search input { padding-left: 14px; }

    .mapctl {
        left: 10px; right: 10px;
        bottom: auto;
        top: 10px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    .seg .segbtn { padding: 0 11px; font-size: 11px; }
    .legendbox { display: none; }

    .drawer {
        top: auto;
        left: 0; right: 0; bottom: 0;
        width: auto;
        max-height: 86dvh;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        transform: translateY(30px);
    }
    .drawer.is-open { transform: translateY(0); }
    .dw-actions { grid-template-columns: repeat(3, 1fr); padding: 12px 14px; }
    .dw-sec { padding: 14px; }
    .kv { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 9px 11px; font-size: 12px; }
}

@media (max-width: 520px) {
    .gate-visual { min-height: 40vh; }
    .gate-points li:nth-child(3) { display: none; }
    .gate-topline { font-size: 15.5px; gap: 12px; }
    .gate-logo-sm { width: 38px; height: 38px; border-radius: 12px; padding: 3px; }
    .gate-panel { padding: 24px 16px 36px; }
    .gate-card { padding: 22px 18px 20px; border-radius: 20px; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tb-search input { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   MODAL (rubah password) & TOAST
   ======================================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    /* Track dibatasi minmax(0,1fr): dengan auto-track, `max-width:100%` pada kartu
       TIDAK mengecil karena track-nya ikut melebar selebar isi (kartu 430px),
       sehingga di layar 390px kartu meluber ~60px ke kanan. */
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(3, 8, 7, .62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal[hidden] { display: none; }

.modal-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: calc(100vh - 40px);   /* fallback browser tanpa dvh */
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 28px 30px 26px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: var(--glass-strong);
    box-shadow: var(--shadow);
    transform: translateY(10px);
    transition: transform .2s;
}
.modal.is-open .modal-card { transform: translateY(0); }

.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    padding: 0; line-height: 0;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--glass-soft);
    color: var(--text-2);
}
.modal-close svg {
    width: 15px; height: 15px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }

.modal-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.2px;
}
.modal-sub {
    margin: 0 0 20px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
}
.modal-card form { display: flex; flex-direction: column; }
.modal .fld { margin-bottom: 14px; }
.modal .gate-alert { margin: 0 0 16px; }
.modal-card .fld-btn { margin-top: 4px; }

/* Layar sempit: padding overlay & kartu dirapatkan supaya kartu tetap proporsional */
@media (max-width: 520px) {
    .modal { padding: 14px; }
    .modal-card { padding: 24px 20px 22px; }
    .modal-title { font-size: 17px; }
    .modal-sub { margin-bottom: 16px; }
}
@media (max-height: 560px) {
    .modal { align-items: start; }
    .modal-card { margin: 8px 0; }
}

.flash {
    position: absolute;
    z-index: 70;
    top: 18px; left: 50%;
    transform: translateX(-50%);
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--glass-strong);
    box-shadow: var(--shadow-sm);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.flash-ok { color: #0b8457; border-color: rgba(11, 132, 87, .45); }
html[data-theme="dark"] .flash-ok { color: #2ee6a8; border-color: rgba(46, 230, 168, .4); }
.flash-err { color: #a83a24; border-color: rgba(168, 58, 36, .45); }
html[data-theme="dark"] .flash-err { color: #ff9d86; border-color: rgba(255, 157, 134, .38); }

/* ==========================================================================
   HALAMAN RESET KATA SANDI
   ======================================================================== */
.resetwrap {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 32px 20px;
    background: #06231b;   /* hijau tua solid, sama di kedua tema */
}
.resetcard {
    width: 430px;
    max-width: 100%;
    box-shadow: var(--shadow);
}
.reset-title {
    margin: 0 0 20px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.2px;
    color: var(--text);
}
.reset-text {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-2);
}
.resetbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.gate-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(23, 211, 154, .38);
    background: rgba(23, 211, 154, .1);
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.55;
}

/* ==========================================================================
   HALAMAN UBAH PROFILE
   ======================================================================== */
.profilecard { width: 470px; }
.fld-hint {
    margin: -10px 0 16px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--muted);
}
.profile-ro {
    margin: 4px 0 20px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--glass-soft);
    overflow: hidden;
}
.profile-ro .kv {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--line);
}
.profile-ro .kv:last-child { border-bottom: none; }

/* dua tombol sejajar pada kartu profil */
.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.profile-actions .fld-btn { margin-top: 0; }
.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-soft);
    border: 1px solid var(--line);
    color: var(--text-2);
    box-shadow: none;
    text-decoration: none;
}
.btn-ghost:hover {
    background: var(--glass);
    border-color: var(--line-strong);
    color: var(--text);
    filter: none;
    transform: none;
}
@media (max-width: 400px) {
    .profile-actions { grid-template-columns: 1fr; }
}

/* ── Footer situs (halaman gerbang / reset / profil) ── */
.sitefoot.sitefoot-inline {
  display: block; width: 100%;
  margin-top: 22px; padding: 0 10px;
  text-align: center; font-size: 11.5px; line-height: 1.5;
  color: var(--muted);
}
@media (max-width: 520px) {
  .sitefoot.sitefoot-inline { margin-top: 18px; font-size: 11px; padding: 0 4px; }
}

/* ==========================================================================
   HALAMAN DAFTAR MEMBER (/daftar)
   ======================================================================== */
.daftarcard { width: 520px; max-width: 100%; }
/* sub-judul halaman daftar sudah dihapus: rapatkan judul kartu agar tidak
   menyisakan rongga kosong sebelum seksi pertama (kartu flex, gap 16px) */
.daftarcard .gate-card-head { margin-bottom: 4px; }
.daftarcard > .form-sec:first-of-type { margin-top: 6px; }
/* catatan status surel di layar sukses pendaftaran */
.daftar-note {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-2);
}
.daftar-note.daftar-note-warn { color: #a83a24; }
html[data-theme="dark"] .daftar-note.daftar-note-warn { color: #ff9d86; }
/* honeypot anti-bot: tak terlihat pengguna, tetap ada di DOM */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
/* kotak Turnstile Cloudflare */
.gate-card .cf-turnstile.ts-box {
    margin: 6px 0 10px;
    min-height: 65px;
}
/* judul seksi di dalam formulir panjang */
.form-sec {
    margin: 22px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.gate-card > .form-sec:first-of-type { margin-top: 6px; border-top: none; padding-top: 0; }
/* select paket langganan: sama tinggi & radius dengan .fld */
.fld-select {
    -webkit-appearance: none; appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237e8f8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5 12 15.5 18 9.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    font-family: var(--font-body);
    font-size: 13.5px;
    cursor: pointer;
}
.fld-select option { background: var(--bg-2); color: var(--text); }
/* tautan "belum punya akun" di gerbang login.
   width fit-content + margin auto: garis bawah saat hover mengikuti lebar teks,
   bukan selebar kartu (sebelumnya garis melintang penuh, tidak proporsional). */
.gate-register {
    display: block;
    width: fit-content;
    margin: 14px auto 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.gate-register:hover { border-bottom-color: var(--accent-text); }
