/* ============================================================================
   aj-h4-dokumen.css — halaman dokumen dalam desain baru: Kebijakan Privasi
   (privacy.html), Ketentuan Penggunaan (terms.html), dan Hapus Akun
   (delete-account.html).

   Kerangka bersamanya (hero ringkas, seksi isi, .h4-prose, tombol, footer
   tanpa penutup) ada di aj-home4.css; berkas ini cuma tata letak dokumen
   (daftar isi + kolom baca) dan formulir Hapus Akun. Isi dokumennya teks
   hukum — jangan diubah kata per katanya.
   ========================================================================== */

/* ── Dokumen: daftar isi + kolom baca ────────────────────────────────────── */

.h4-doc {
    padding-top: 40px;
}

/* Rata kiri seperti judul hero (tepi --h4-pad, sejajar logo navbar). */
.h4-doc-in {
    display: grid;
    gap: 28px;
    max-width: 1100px;
}

/* Kolom baca ±70 karakter. */
.h4-doc-body {
    max-width: 720px;
    min-width: 0;
}

/* Paragraf pembuka sedikit lebih besar dari isi. */
.h4-doc-body > p:first-child {
    font-size: 18px;
    line-height: 1.65;
}

.h4-doc-body > h2:first-of-type {
    margin-top: 1.8em;
}

/* Ponsel & tablet: daftar isi terlipat di atas dokumen. */
.h4-toc-d {
    display: none;
}

.h4-toc-m {
    border-radius: 16px;
    background: var(--h4-card);
}

.h4-toc-m > summary {
    position: relative;
    padding: 16px 52px 16px 20px;
    font-family: var(--h4-sub);
    font-size: 17px;
    font-stretch: 112%;
    font-weight: 600;
    line-height: 1.3;
    list-style: none;
    cursor: pointer;
}

.h4-toc-m > summary::-webkit-details-marker {
    display: none;
}

/* Chevron yang berputar saat terbuka. */
.h4-toc-m > summary::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 22px;
    width: 9px;
    height: 9px;
    margin-top: -7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.h4-toc-m[open] > summary::after {
    margin-top: -2px;
    transform: rotate(-135deg);
}

.h4-toc-m > summary:focus-visible {
    outline: 2px solid var(--h4-sec-ink);
    outline-offset: 2px;
    border-radius: 16px;
}

.h4-toc-m .h4-toc-list {
    padding: 0 12px 14px;
}

.h4-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.h4-toc-list a {
    display: flex;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 10px;
    color: var(--h4-sec-soft);
    font-family: var(--h4-text);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.h4-toc-list a:hover {
    background: var(--h4-card-edge);
    color: var(--h4-sec-ink);
}

.h4-toc-list a:focus-visible {
    outline: 2px solid var(--h4-sec-ink);
    outline-offset: 1px;
}

/* Nomor pasal di kolom sendiri, angkanya sejajar. */
.h4-toc-n {
    flex: none;
    min-width: 1.6em;
    font-variant-numeric: tabular-nums;
    color: var(--h4-sec-soft);
}

/* Pasal yang sedang dibaca (aj-h4-dokumen.js). */
.h4-toc-list a[aria-current='true'] {
    color: var(--h4-sec-ink);
    font-weight: 600;
}

.h4-toc-list a[aria-current='true'] .h4-toc-n {
    color: var(--h4-blue);
}

.uc-dark .h4-toc-list a[aria-current='true'] .h4-toc-n {
    color: #b3b3ff;
}

/* Desktop: daftar isi menempel di kiri selama dokumen digulir — di bawah
   kapsul navbar yang muncul saat menggulir ke atas. */
@media (min-width: 1024px) {
    .h4-doc {
        padding-top: 72px;
    }

    .h4-doc-in {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 72px;
    }

    .h4-toc-m {
        display: none;
    }

    .h4-toc-d {
        display: block;
        position: sticky;
        top: calc(var(--h4-nav-h) + 24px);
        max-height: calc(100vh - var(--h4-nav-h) - 48px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .h4-toc-title {
        margin: 0 0 10px 8px;
        font-family: var(--h4-sub);
        font-size: 15px;
        font-stretch: 112%;
        font-weight: 600;
        color: var(--h4-sec-ink);
    }

    .h4-doc-body > p:first-child {
        font-size: 19px;
    }
}

/* ── Hapus Akun: kartu formulir ──────────────────────────────────────────── */

.h4-hapus {
    padding-top: 40px;
}

.h4-hapus-card {
    max-width: 760px;
    padding: 28px 20px;
    border-radius: 24px;
    background: var(--h4-card);
}

.h4-form-head h2,
.h4-hapus-done h2 {
    margin: 0;
    font-family: var(--h4-display);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-wrap: balance;
}

.h4-form-head p {
    margin: 10px 0 0;
    font-family: var(--h4-text);
    font-size: 15px;
    line-height: 1.55;
    color: var(--h4-sec-soft);
}

.h4-form-grid {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.h4-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.h4-field label {
    font-family: var(--h4-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.h4-field input,
.h4-field select,
.h4-field textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 13px 14px;
    border: 1.5px solid var(--h4-sec-edge);
    border-radius: 12px;
    background: var(--h4-sec-bg);
    color: var(--h4-sec-ink);
    font-family: var(--h4-text);
    font-size: 16px;
    line-height: 1.4;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.h4-field select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23696970'%3E%3Cpath d='M12 13.17 16.95 8.22 18.36 9.64 12 16 5.64 9.64 7.05 8.22z'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-size: 20px;
    background-repeat: no-repeat;
}

.h4-field textarea {
    min-height: 96px;
    resize: vertical;
}

.h4-field input::placeholder,
.h4-field textarea::placeholder {
    color: var(--h4-sec-soft);
    opacity: 0.8;
}

.h4-field input:focus,
.h4-field select:focus,
.h4-field textarea:focus {
    outline: none;
    border-color: var(--h4-blue);
    box-shadow: 0 0 0 3px rgba(48, 48, 176, 0.16);
}

.uc-dark .h4-field input:focus,
.uc-dark .h4-field select:focus,
.uc-dark .h4-field textarea:focus {
    border-color: #8f8ff5;
    box-shadow: 0 0 0 3px rgba(143, 143, 245, 0.22);
}

/* Pesan galat: tampil sesudah percobaan kirim (.was-validated). */
.h4-field-err {
    display: none;
    margin: 0;
    font-family: var(--h4-text);
    font-size: 14px;
    line-height: 1.4;
    color: #c4314b;
}

.uc-dark .h4-field-err {
    color: #ff8a9c;
}

.was-validated .h4-field input:invalid,
.was-validated .h4-field select:invalid,
.was-validated .h4-field textarea:invalid {
    border-color: #c4314b;
}

.was-validated .h4-field :invalid ~ .h4-field-err,
.was-validated .h4-check:has(:invalid) + .h4-field-err {
    display: block;
}

.h4-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 22px;
    font-family: var(--h4-text);
    font-size: 15px;
    line-height: 1.55;
    cursor: pointer;
}

.h4-check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--h4-blue);
    cursor: pointer;
}

.uc-dark .h4-check input {
    accent-color: #8f8ff5;
}

.h4-form-submit {
    width: 100%;
    margin-top: 24px;
}

.h4-form-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* Sesudah terkirim. */
.h4-hapus-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    text-align: center;
}

.h4-hapus-done[hidden] {
    display: none;
}

.h4-hapus-done-ico {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(24, 140, 84, 0.12);
    color: #188c54;
}

.uc-dark .h4-hapus-done-ico {
    background: rgba(74, 210, 140, 0.14);
    color: #4ad28c;
}

.h4-hapus-done-ico svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.h4-hapus-done p {
    max-width: 34em;
    margin: 0;
    font-family: var(--h4-text);
    font-size: 16px;
    line-height: 1.6;
    color: var(--h4-sec-soft);
}

.h4-hapus-done p strong {
    color: var(--h4-sec-ink);
}

.h4-hapus-done .h4-hapus-small {
    font-size: 14px;
}

.h4-hapus-done a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.h4-hapus-done .h4-btn {
    margin-top: 6px;
}

/* Penjelasan di bawah formulir: kolom baca yang sama dengan dokumen. */
.h4-hapus-info {
    max-width: 760px;
}

@media (min-width: 600px) {
    .h4-hapus-card {
        padding: 36px;
    }

    .h4-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .h4-field.is-wide {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .h4-hapus {
        padding-top: 72px;
    }

    .h4-hapus-card {
        padding: 44px;
    }

    .h4-form-head h2,
    .h4-hapus-done h2 {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .h4-toc-m > summary::after,
    .h4-toc-list a,
    .h4-field input,
    .h4-field select,
    .h4-field textarea {
        transition: none;
    }
}
