/* =========================================================
   bluepay — Shared chrome
   Used by every page. Page-specific CSS stays inline in each
   file's own <style> block.
   ========================================================= */

/* Google serves Nunito as a variable font (axis 200-1000), so a
   single file covers weights 400/600/700/800. */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url('../fonts/nunito-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
        U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url('../fonts/nunito-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
        U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --primary: #377BD3;
    --secondary: #3EC4C6;
    --text-dark: #1A202C;
    --text-light: #4A5568;
    --text-muted: #A0AEC0;
    --bg-light: #F7FAFC;
    --white: #FFFFFF;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 32px rgba(55, 123, 211, 0.08);
    --transition: all 0.3s ease;
    --primary-dark: #235FAF;
    --cyan-glow: rgba(62, 196, 198, .35);
    --bg-card: rgba(255, 255, 255, .75);
    --radius-xl: 40px;
    --shadow-xl: 0 40px 100px rgba(55, 123, 211, .18);
    --glass: rgba(255, 255, 255, .65);
    --border: rgba(255, 255, 255, .45);
}

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

/* The closed drawer is parked off-canvas and, being position:fixed, is not
   clipped by body's overflow-x — it stretched the document's scrollable
   width by its own width on every page below 993px. `clip` trims it without
   turning <html> into a scroll container, so the sticky nav keeps working. */
html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

/* `clip`, never `hidden`: hidden here would make <body> a scroll container
   and detach the sticky nav from the scrollport. clip trims the off-canvas
   drawer without creating one. Both html and body need it. */
body {
    overflow-x: clip;
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: radial-gradient(circle at top left, rgba(55, 123, 211, .12), transparent 40%),
        radial-gradient(circle at top right, rgba(62, 196, 198, .15), transparent 45%),
        linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Legal pages reset .legal-list to bring its bullets back —
   see the "LEGAL PAGE" block in each of those files. */
ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Shared by the three legal pages whose .toc-sidebar scrolls. Both syntaxes
   are needed: Chrome and Safari ignore scrollbar-color. */
.toc-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(55, 123, 211, 0.35) transparent;
}

.toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(55, 123, 211, 0.3);
    border-radius: var(--radius-full);
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(55, 123, 211, 0.55);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #377BD3, #3EC4C6) !important;
    color: var(--white);
    box-shadow: 0 15px 40px rgba(55, 123, 211, .30);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--bg-light);
    transform: translateY(-2px);
}

#main-nav {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* The blur sits on a pseudo-element, not on #main-nav itself: backdrop-filter
   makes an element the containing block for its position:fixed descendants,
   which anchored the drawer to the nav box instead of the viewport. */
#main-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: inherit;
}

#main-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* An inline <img> sits on the text baseline and leaves descender space
   underneath, which pushed the logo ~4px above the nav's centre line. */
.nav-logo,
.nav-logo a {
    display: flex;
    align-items: center;
}

/* width: auto is required: the <img> carries width/height attributes for its
   aspect ratio, and the width attribute alone would otherwise stretch the
   box to 1080px. Same for every logo sized by height below. */
.nav-logo img {
    display: block;
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 800;
}

/* Below 993px this same markup becomes the accordion inside the drawer. */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* A <button>, not <a href="#">: main.js closes the drawer on any link click,
   which would shut it the moment this trigger is tapped. */
.dropdown-trigger {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.dropdown-trigger:hover,
.nav-dropdown.open .dropdown-trigger {
    color: var(--primary);
}

.dropdown-trigger.active {
    color: var(--primary);
    font-weight: 800;
}

.dropdown-trigger i {
    transition: transform 0.3s ease;
}

.nav-dropdown.open .dropdown-trigger i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    min-width: 200px;
    padding: 8px 0;
    background-color: var(--white);
    border: 1px solid #edf2f7;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

/* Spans the 12px gap above the menu so the pointer keeps :hover on its way
   down from the trigger. */
.dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 12px;
}

.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Real pointers only: a tap fakes a sticky :hover the menu could not be tapped
   out of. Desktop only: in the drawer it would unhide a collapsed accordion. */
@media (hover: hover) and (min-width: 993px) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
}

/* No indent on hover or for the current page, unlike v2: the items stay flush. */
.dropdown-menu a:hover,
.dropdown-menu a.active {
    background-color: var(--bg-light);
    color: var(--primary);
}

/* It is a <button> for accessibility, so the UA chrome has to be reset —
   otherwise the browser paints a grey bordered box around the icon. */
.menu-toggle {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--primary);
}

.mobile-menu-header {
    display: none;
}

/* Created by main.js so every page gets it without repeating markup. It is
   what a tap outside the drawer lands on. */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s linear 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0s;
}

#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 10000;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

/* position/z-index keeps the footer above the radial circles of
   #bottom-cta:before/:after (700-900px) on home & become-a-merchant. */
#main-footer {
    padding: 80px 0 32px;
    background-color: var(--bg-light);
    position: relative;
    z-index: 2;
}

/* Equal, not 1.5fr first: the gaps are 48px either way, but the wider first
   column left dead space after the contact lines and read as an uneven gap. */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
    margin-bottom: 60px;
}

.footer-title {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-light);
}

.footer-item i {
    font-size: 20px;
    line-height: 1;
    color: var(--primary);
}

.footer-links li {
    margin-bottom: 16px;
}

.footer-links a,
.social-item a {
    color: var(--text-light);
    font-weight: 600;
    transition: var(--transition);
}

.footer-links a:hover,
.social-item a:hover {
    color: var(--primary);
}

.social-desc {
    color: var(--text-light);
    margin-bottom: 24px;
}

.social-item i.ri-instagram-fill { color: #E1306C; }
.social-item i.ri-tiktok-fill { color: #000000; }
.social-item i.ri-youtube-fill { color: #FF0000; }
.social-item i.ri-facebook-circle-fill { color: #1877F2; }

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid #edf2f7;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.8;
}

.playstore-download-button {
    display: inline-block;
    margin-top: 24px;
    transition: var(--transition);
}

.playstore-download-button:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}

@media (max-width: 992px) {
    .menu-toggle { display: block; }
    .nav-cta { display: none; }

    /* Cancels the home-only pill nav on mobile */
    #main-nav {
        width: 100%;
        border-radius: 0;
        margin: 0;
        top: 0;
    }

    /* Parked with transform, not right:-100% — the latter widened the
       document's scroll area to 2x the viewport on every page below 993px. */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        /* Inset on all four sides so the panel floats rather than welding
           itself to the viewport edges. */
        top: 12px;
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
        max-width: 400px;
        background-color: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
        padding: 24px;
        box-sizing: border-box;
        gap: 0;
        text-align: left;
        z-index: 9999;
        /* +12px so the parked panel also clears its own right offset */
        transform: translateX(calc(100% + 12px));
        /* visibility, not transform alone: the parked panel still peeked ~21px
           into the viewport (the transform distance and the gap to the right
           edge differ by the scrollbar width), showing a white strip. */
        visibility: hidden;
        transition: transform 0.3s ease-in-out, visibility 0s linear 0.3s;
        overflow-y: auto;
        margin: 0;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.3s ease-in-out, visibility 0s;
    }

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid #edf2f7;
    }

    .mobile-menu-header img {
        display: block;
        height: 35px;
        width: auto;
    }

    .mobile-menu-header > a {
        display: flex;
        align-items: center;
    }

    .close-menu {
        -webkit-appearance: none;
        appearance: none;
        font-size: 32px;
        color: var(--primary);
        cursor: pointer;
        transition: var(--transition);
        line-height: 1;
        background: none;
        border: none;
        padding: 0;
    }

    /* The dropdown trigger is a <button>, so every drawer-row rule names it
       next to the links — `> a` alone would leave it unstyled. */
    .nav-links > a:not(.cta-mobile),
    .nav-links .dropdown-trigger {
        padding: 16px;
        font-size: 1.125rem;
        color: var(--text-dark);
        border-bottom: 1px solid #f7fafc;
        pointer-events: auto;
        display: block;
        border-radius: 12px;
        transition: all 0.3s ease;
        margin-bottom: 4px;
    }

    .nav-links > a:not(.cta-mobile):hover {
        color: var(--primary);
        background-color: rgba(55, 123, 211, 0.08);
        transform: translateX(10px);
        border-bottom-color: transparent;
    }

    /* A tapped trigger stays on screen, so a touch screen's sticky :hover would
       keep it lit after closing: highlight follows .open, hover is pointer-only. */
    .nav-dropdown.open .dropdown-trigger {
        color: var(--primary);
        background-color: rgba(55, 123, 211, 0.08);
        border-bottom-color: transparent;
    }

    @media (hover: hover) {
        .nav-links .dropdown-trigger:hover {
            color: var(--primary);
            background-color: rgba(55, 123, 211, 0.08);
            border-bottom-color: transparent;
        }
    }

    .nav-links > a:not(.cta-mobile):active {
        color: var(--primary-dark);
        background-color: rgba(55, 123, 211, 0.15);
        transform: translateX(6px) scale(0.98);
    }

    /* Pressed state without the nudge: the trigger stays put while the menu
       below it opens, so only the colour answers the tap. */
    .nav-links .dropdown-trigger:active {
        color: var(--primary-dark);
        background-color: rgba(55, 123, 211, 0.15);
    }

    /* The drawer link colour above outranks .nav-links a.active, so the
       current page needs its colour restated here. */
    .nav-links > a:not(.cta-mobile).active,
    .nav-links .dropdown-trigger.active {
        color: var(--primary);
    }

    .nav-dropdown {
        display: block;
    }

    .nav-links .dropdown-trigger {
        display: flex;
        justify-content: space-between;
        width: 100%;
        text-align: left;
    }

    /* Drawer accordion: height runs 0 -> --menu-height (main.js measures it; auto
       cannot transition). A 0fr -> 1fr grid row stretched the trigger mid-way.
       - no vertical padding/margin here: it would show while collapsed
       - only the height moves; the links stay still, no fade or slide
       - visibility keeps hidden links out of the tab order, delayed until shut */
    .dropdown-menu {
        position: static;
        min-width: 0;
        height: 0;
        overflow: hidden;
        margin: 0;
        padding: 0 0 0 16px;
        background: none;
        border: none;
        box-shadow: none;
        opacity: 1;
        visibility: hidden;
        transform: none;
        transition: height 0.3s ease-in-out, visibility 0s linear 0.3s;
    }

    .dropdown-menu::before {
        display: none;
    }

    .nav-dropdown.open .dropdown-menu {
        height: var(--menu-height, auto);
        visibility: visible;
        transition: height 0.3s ease-in-out, visibility 0s;
    }

    .dropdown-menu a {
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: 12px;
        margin-bottom: 4px;
    }

    .dropdown-menu a:hover,
    .dropdown-menu a.active {
        color: var(--primary);
        background-color: rgba(55, 123, 211, 0.08);
    }

    .cta-mobile {
        display: inline-flex;
        margin-top: 32px;
        justify-content: center;
        background: linear-gradient(135deg, #377BD3, #3EC4C6) !important;
        color: #ffffff !important;
        border: none !important;
        box-shadow: 0 8px 20px rgba(55, 123, 211, 0.25) !important;
        padding: 16px 24px !important;
        border-radius: var(--radius-full) !important;
        width: 100%;
        font-weight: 700;
        font-size: 1.125rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 993px) {
    .menu-toggle { display: none; }
    .cta-mobile { display: none; }

    /* Desktop only: in the drawer's column this would shrink every row to
       its text width. Keeps the dropdown trigger on the links' centre line. */
    .nav-links { align-items: center; }
}

/* Phones: the 40px logo is oversized next to the hamburger on a narrow bar. */
@media (max-width: 600px) {
    .nav-logo img { height: 32px; }

    /* The single-column footer reads left-aligned on phones, so the licence
       and copyright lines follow the columns above instead of centring. */
    .footer-bottom { text-align: left; }
}

@media (min-width: 601px) and (max-width: 992px) {
    .container { padding: 0 40px; }

    /* 28px reads as oversized against the logo on a tablet's wider bar. */
    .menu-toggle { font-size: 24px; }

    /* Two-up here, three-up from 768px (below); the <=992px block collapses
       to one column, which is a phone layout. Qualified by #main-footer
       because index, about-us and become-a-merchant repeat the plain
       .footer-grid rule inline, which outranks this file at equal weight. */
    #main-footer .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
}

/* Three-up needs ~196px a column: contact@bluepay.co.id is one unbreakable
   160px token beside a 24px icon. 768px is the first width that clears it. */
@media (min-width: 768px) and (max-width: 992px) {
    #main-footer .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Small laptops: the four Indonesian labels plus logo and CTA do not fit
   at 1024px, so tighten them instead of wrapping onto a second line. */
@media (min-width: 993px) and (max-width: 1200px) {
    /* Breathing room on 1024-class laptops, where the 1200px container
       otherwise runs almost edge to edge. */
    .container { padding: 0 48px; }

    #main-nav .container { gap: 16px; }
    .nav-links { gap: 20px; }
    .nav-links a,
    .dropdown-trigger { font-size: 0.875rem; }
    .nav-cta .btn {
        padding: 12px 20px;
        font-size: 0.875rem;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
