/* Halaman unduh reloadpulsa.co.id — APK Mitra */
:root {
    --brand: #0c4a6e;
    --brand-mid: #0369a1;
    --brand-light: #38bdf8;
    --brand-soft: #e0f2fe;
    --accent: #059669;
    --accent-soft: #d1fae5;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --warn-bg: #fffbeb;
    --warn-border: #fcd34d;
    --warn-text: #92400e;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --sticky-h: 0px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #f8fafc;
        --text-muted: #94a3b8;
        --border: #334155;
        --bg: #0b1220;
        --card: #1e293b;
        --brand-soft: #0c2d44;
        --accent-soft: #064e3b;
        --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
        --warn-bg: #422006;
        --warn-border: #b45309;
        --warn-text: #fde68a;
    }
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(var(--sticky-h) + var(--safe-b) + 12px);
}

a { color: var(--brand-mid); text-decoration: none; }
a:active { opacity: 0.85; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    padding: calc(10px + var(--safe-t)) 16px 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
@media (prefers-color-scheme: dark) {
    .site-header { background: rgba(30, 41, 59, 0.92); }
}
.site-header__inner {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.brand__name {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}
.brand__sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
}
.header-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-mid);
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
}

.page {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 16px 24px;
}

.rp-dl-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 22px 18px 20px;
    margin-bottom: 14px;
    background: linear-gradient(145deg, var(--brand) 0%, var(--brand-mid) 55%, #0ea5e9 100%);
    color: #fff;
    box-shadow: 0 10px 36px rgba(3, 105, 161, 0.4);
    text-align: center;
}
.rp-dl-hero::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.rp-dl-hero__icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}
.rp-dl-hero__icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: #fff;
}
.rp-dl-hero__badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.rp-dl-hero h1 {
    margin: 10px 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}
.rp-dl-hero__sub {
    margin: 0;
    font-size: 0.84rem;
    opacity: 0.92;
    line-height: 1.45;
}
.rp-dl-hero__version {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rp-dl-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--warn-border);
    background: var(--warn-bg);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--warn-text);
}
.rp-dl-notice__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    font-size: 0.95rem;
}
.rp-dl-notice strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.85rem;
    color: var(--text);
}

.rp-dl-actions { margin-bottom: 14px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: transform 0.12s, opacity 0.12s;
    -webkit-user-select: none;
    user-select: none;
}
.btn:active { transform: scale(0.98); opacity: 0.92; }
.btn--primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 16px rgba(12, 74, 110, 0.35);
    margin-bottom: 8px;
}
.btn--ghost {
    background: var(--card);
    color: var(--brand-mid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.88rem;
    min-height: 44px;
}
.btn--sm {
    min-height: 42px;
    font-size: 0.84rem;
    padding: 9px 14px;
    width: auto;
}

.rp-dl-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.rp-dl-section__title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.rp-dl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rp-dl-meta__item {
    flex: 1 1 calc(50% - 4px);
    min-width: 130px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
}
.rp-dl-meta__item dt {
    margin: 0 0 2px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.rp-dl-meta__item dd {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.chip__icon { font-size: 1rem; flex-shrink: 0; }

/* Download cards */
.rp-dl-builds { display: flex; flex-direction: column; gap: 10px; }
.rp-dl-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}
.rp-dl-card--featured {
    border-color: var(--brand-mid);
    background: var(--brand-soft);
}
@media (prefers-color-scheme: dark) {
    .rp-dl-card--featured { background: rgba(3, 105, 161, 0.15); }
}
.rp-dl-card__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.rp-dl-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.rp-dl-card__title {
    margin: 0 0 3px;
    font-size: 0.92rem;
    font-weight: 800;
}
.rp-dl-card__desc {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.rp-dl-card__dev {
    margin: 4px 0 0;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.rp-dl-card__badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rp-dl-card__badge--alt {
    background: var(--text-muted);
}
.rp-dl-section-lead {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Everluck */
.notice-everluck {
    display: none;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(5, 150, 105, 0.35);
    background: var(--accent-soft);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--accent);
}
.notice-everluck strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
}
body.is-everluck .notice-everluck { display: flex; }
body.is-everluck #section-ios { display: none; }

.ss-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 10px;
}
.screenshots {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.screenshots::-webkit-scrollbar { display: none; }
.screenshots img {
    width: 42vw;
    max-width: 150px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    scroll-snap-align: start;
    box-shadow: var(--shadow);
}

.rp-dl-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: rpstep;
}
.rp-dl-steps li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.rp-dl-steps li:last-child { margin-bottom: 0; }
.rp-dl-steps li::before {
    counter-increment: rpstep;
    content: counter(rpstep);
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--brand-soft);
    color: var(--brand-mid);
    border: 1px solid rgba(3, 105, 161, 0.25);
}

.rp-dl-accordion {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--card);
}
.rp-dl-accordion summary {
    padding: 13px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rp-dl-accordion summary::-webkit-details-marker { display: none; }
.rp-dl-accordion summary::after {
    content: "›";
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.rp-dl-accordion[open] summary::after { transform: rotate(90deg); }
.rp-dl-accordion__body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--border);
}
.rp-dl-changelog {
    margin: 10px 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.rp-dl-changelog li { margin-bottom: 5px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.8rem;
}
.footer-grid h3 {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 700;
}
.footer-grid p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.4;
}
.legal {
    margin-top: 14px;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.sticky-dl {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    padding: 10px 16px calc(10px + var(--safe-b));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
    .sticky-dl { background: rgba(30, 41, 59, 0.96); }
}
body.has-sticky-dl { --sticky-h: 68px; }
body.has-sticky-dl .sticky-dl { display: block; }
.sticky-dl__inner {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}
.sticky-dl__info { flex: 1; min-width: 0; }
.sticky-dl__label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.sticky-dl__name {
    font-size: 0.88rem;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sticky-dl .btn { width: auto; min-width: 120px; flex-shrink: 0; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-overlay.is-open { display: flex; }
.modal-sheet {
    background: var(--card);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 520px;
    padding: 10px 18px calc(18px + var(--safe-b));
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    animation: sheetUp 0.28s ease;
}
@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 0 auto 14px;
}
.modal-sheet h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
}
.modal-sheet p {
    margin: 0 0 12px;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.modal-sheet ol {
    margin: 0 0 14px;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.modal-sheet li { margin-bottom: 6px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--sticky-h) + var(--safe-b) + 16px);
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    max-width: calc(100% - 32px);
    text-align: center;
}
.toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 600px) {
    .page { padding: 24px 20px 32px; }
    .rp-dl-hero h1 { font-size: 1.5rem; }
    .chips { grid-template-columns: repeat(4, 1fr); }
    .modal-overlay { align-items: center; padding: 20px; }
    .modal-sheet { border-radius: 16px; animation: none; }
    .modal-handle { display: none; }
    .modal-actions { flex-direction: row; justify-content: flex-end; }
    .modal-actions .btn { width: auto; }
    body.has-sticky-dl .sticky-dl { display: none; }
}
