/* =====================================================================
   App theme for inner pages (blue + gold glossy)
   Used with: inc/app_header.php, inc/app_footer.php, inc/app_nav.php
   Pages opt in with <body class="app-page">
   ===================================================================== */

body.app-page {
    background: linear-gradient(160deg, #0a2687 0%, #1546c4 55%, #2a6af0 100%) fixed !important;
    font-family: "Outfit", sans-serif !important;
    color: #1b1b1f !important;
    min-height: 100vh;
    overflow-x: hidden;
}

body.app-page button,
body.app-page input,
body.app-page select,
body.app-page textarea,
body.app-page .btn {
    font-family: "Outfit", sans-serif;
}

/* one font everywhere inside the new layout (icons keep their own font) */
body.app-page .ap-panel,
body.app-page .ap-panel *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.material-icons):not([class*="fa-"]) {
    font-family: "Outfit", sans-serif !important;
}

/* hide the old headers / navs */
body.app-page .page-header,
body.app-page #myHeader,
body.app-page .footer-app,
body.app-page .mobile-bottom-nav,
body.app-page div.content:empty,
body.app-page .top-bar-menu-con {
    display: none !important;
}

/* ---------- header ---------- */
.ap-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 20px 28px;
    color: #fff;
}

.ap-head .ap-back {
    color: #fff !important;
    font-size: 23px;
    line-height: 1;
    text-decoration: none !important;
    flex-shrink: 0;
}

.ap-head .ap-title {
    flex: 1;
    min-width: 0;
}

.ap-head h4 {
    margin: 0;
    font-size: 25px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-head .ap-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, .85);
    margin-top: 2px;
}

.ap-head .ap-right {
    flex-shrink: 0;
}

.ap-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 20px;
    border: 2px solid #f5c43c;
    background: linear-gradient(180deg, #2b56d8 0%, #0f2f98 55%, #0b2683 100%);
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(5, 20, 80, .4), inset 0 1px 0 rgba(255, 255, 255, .4);
}

/* ---------- white panel ---------- */
.ap-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
    border-radius: 40px 40px 0 0;
    min-height: calc(100vh - 88px);
    padding: 22px 16px 110px;
    box-shadow: 0 -8px 24px rgba(5, 20, 80, .25);
}

body.app-page.no-nav .ap-panel {
    padding-bottom: 30px;
}

.ap-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.ap-panel .container {
    padding-left: 0;
    padding-right: 0;
}

.ap-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #10225a;
    margin: 4px 2px 12px;
}

/* ---------- glossy card ---------- */
.ap-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fd 60%, #eaf0fb 100%);
    border: 1.5px solid #cbd9f3;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 6px 16px rgba(21, 70, 196, .10), inset 0 1px 0 #fff;
    color: #1b1b1f;
}

.ap-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .3) 30%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.ap-card > * {
    position: relative;
    z-index: 1;
}

/* ---------- gold icon bubble ---------- */
.ap-ic {
    position: relative;
    overflow: hidden;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: radial-gradient(circle at 50% 30%, #ffe08a 0%, #f5c43c 45%, #dc9c0c 100%);
    border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: 0 4px 10px rgba(220, 156, 12, .4), inset 0 -3px 5px rgba(150, 90, 0, .35);
    text-shadow: 0 1px 1px rgba(120, 70, 0, .5);
}

.ap-ic::after {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    top: 5%;
    height: 40%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0));
}

.ap-ic i {
    position: relative;
    z-index: 1;
}

.ap-ic.blue {
    background: radial-gradient(circle at 50% 30%, #7fa6ff 0%, #2f63e6 50%, #1240b8 100%);
    box-shadow: 0 4px 10px rgba(21, 70, 196, .35), inset 0 -3px 5px rgba(0, 20, 90, .35);
}

.ap-ic.green {
    background: radial-gradient(circle at 50% 30%, #8ff0b5 0%, #22c063 50%, #12924f 100%);
    box-shadow: 0 4px 10px rgba(18, 146, 79, .35), inset 0 -3px 5px rgba(0, 70, 30, .35);
}

.ap-ic.red {
    background: radial-gradient(circle at 50% 30%, #ffb0b0 0%, #ef4b4b 50%, #c62828 100%);
    box-shadow: 0 4px 10px rgba(198, 40, 40, .35), inset 0 -3px 5px rgba(90, 0, 0, .35);
}

/* ---------- list rows (menu style) ---------- */
.ap-row {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none !important;
    color: #1b1b1f !important;
}

.ap-row .ap-row-body {
    flex: 1;
    min-width: 0;
}

.ap-row .ap-row-title {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: #10225a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-row .ap-row-sub {
    display: block;
    font-size: 13px;
    color: #5b6478;
    margin-top: 3px;
}

.ap-row .ap-chev {
    color: #9aa8c7;
    font-size: 15px;
    flex-shrink: 0;
}

a.ap-card:active {
    transform: scale(.985);
}

/* ---------- 2 column tiles ---------- */
.ap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ap-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 118px;
    margin: 0;
    text-align: center;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    color: #10225a !important;
}

.ap-tile .ap-ic {
    width: 52px;
    height: 52px;
    font-size: 21px;
}

/* ---------- balance card (yellow / black) ---------- */
.ap-balance {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: radial-gradient(120% 90% at 50% 0%, #ffd768 0%, #f2bc34 55%, #e2a414 100%);
    box-shadow: 0 10px 22px rgba(226, 164, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
    text-align: center;
    margin-bottom: 18px;
}

.ap-balance::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 30%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.ap-balance .who {
    position: relative;
    padding: 14px 12px 12px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(120, 70, 0, .45);
}

.ap-balance .who b {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

.ap-balance .who span {
    display: block;
    font-size: 17px;
    letter-spacing: .5px;
}

.ap-balance .bal {
    position: relative;
    background: linear-gradient(180deg, #2e2e33 0%, #1d1d21 55%, #141417 100%);
    color: #fff;
    padding: 12px;
}

.ap-balance .bal small {
    display: block;
    font-size: 16px;
}

.ap-balance .bal b {
    display: block;
    font-size: 22px;
    font-weight: 600;
}

.ap-balance .acts {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.ap-balance .acts a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 14px;
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.ap-balance .acts .dep {
    background: linear-gradient(180deg, #2fd270 0%, #1aa957 100%);
}

.ap-balance .acts .wd {
    background: linear-gradient(180deg, #1650c9 0%, #0a3fae 100%);
}

.ap-balance:not(:has(.acts)) {
    padding-bottom: 22px;
}

/* ---------- buttons ---------- */
.ap-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 30px;
    background: linear-gradient(180deg, #1650c9 0%, #0a3fae 55%, #08349a 100%);
    color: #fff !important;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    box-shadow: 0 8px 18px rgba(10, 63, 174, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
    cursor: pointer;
}

.ap-btn::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .03));
    pointer-events: none;
}

.ap-btn.red {
    background: linear-gradient(180deg, #ef4b4b 0%, #d32f2f 55%, #b71c1c 100%);
    box-shadow: 0 8px 18px rgba(198, 40, 40, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.ap-btn.gold {
    background: radial-gradient(circle at 50% 20%, #ffe08a 0%, #f5c43c 55%, #e0a10f 100%);
    color: #10225a !important;
    text-shadow: none;
    box-shadow: 0 8px 18px rgba(224, 161, 15, .35), inset 0 1px 0 rgba(255, 255, 255, .7);
}

/* ---------- pills / status ---------- */
.ap-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.ap-pill.ok {
    background: #dcf5e4;
    color: #11793a;
}

.ap-pill.bad {
    background: #fde3e3;
    color: #c62828;
}

.ap-pill.wait {
    background: #fff3d1;
    color: #8a5a00;
}

.ap-pill.info {
    background: #e2ebff;
    color: #1546c4;
}

.ap-amt-plus {
    color: #11793a !important;
}

.ap-amt-minus {
    color: #c62828 !important;
}

/* ---------- forms ---------- */
.ap-field {
    margin-bottom: 14px;
}

.ap-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #10225a;
    margin-bottom: 6px;
}

.ap-field input,
.ap-field select,
.ap-field textarea,
.ap-panel input.ap-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid #d6deed;
    background: #fff;
    color: #1b1b1f;
    font-size: 16px;
    outline: none;
}

.ap-field input:focus,
.ap-field select:focus {
    border-color: #1546c4;
}

.ap-field input:disabled {
    background: #f1f4fa;
    color: #5b6478;
}

/* ---------- empty state ---------- */
.ap-empty {
    text-align: center;
    padding: 40px 16px;
    color: #5b6478;
}

.ap-empty i {
    font-size: 40px;
    color: #c4d3f0;
    margin-bottom: 12px;
    display: block;
}

/* ---------- bottom nav (same as home) ---------- */
.hm-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: linear-gradient(90deg, #1b3cba 0%, #2557d6 50%, #2a66e6 100%);
    border-top: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 -6px 18px rgba(11, 42, 143, .35), inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -8px 14px rgba(0, 0, 0, .18);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    padding: 0 4px env(safe-area-inset-bottom);
    box-sizing: content-box;
}

.hm-nav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .32) 0%, rgba(255, 255, 255, .08) 100%);
    pointer-events: none;
}

.hm-nav a {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.hm-nav svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35));
}

.hm-nav a.active {
    color: #ffd768 !important;
}

.hm-nav a.active svg {
    stroke: #ffd768;
    stroke-width: 2;
}

.hm-nav a.home span {
    position: relative;
    overflow: hidden;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #ffe08a 0%, #f5c43c 45%, #e0a10f 100%);
    border: 2px solid rgba(255, 255, 255, .7);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .35), inset 0 -4px 6px rgba(160, 100, 0, .45), inset 0 2px 3px rgba(255, 255, 255, .8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hm-nav a.home span::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    top: 4%;
    height: 42%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.hm-nav a.home svg {
    position: relative;
    z-index: 1;
    stroke: #10225a;
    stroke-width: 2;
    width: 22px;
    height: 22px;
}

@media (max-width: 380px) {
    .ap-head h4 {
        font-size: 21px;
    }

    .hm-nav a {
        font-size: 12px;
    }
}

/* ---------- payment result page (thankyou / imb_thankyou) ---------- */
body.ap-result-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px !important;
    text-align: center;
}

.ap-result-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6fd 100%);
    border-radius: 28px;
    padding: 32px 22px 24px;
    box-shadow: 0 20px 50px rgba(5, 20, 80, .45), inset 0 1px 0 #fff;
}

.ap-result-ic {
    position: relative;
    overflow: hidden;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
    border: 4px solid rgba(255, 255, 255, .9);
}

.ap-result-ic::after {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    top: 5%;
    height: 40%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0));
}

.ap-result-ic.ok {
    background: radial-gradient(circle at 50% 30%, #8ff0b5 0%, #22c063 50%, #12924f 100%);
    box-shadow: 0 10px 24px rgba(18, 146, 79, .4);
}

.ap-result-ic.bad {
    background: radial-gradient(circle at 50% 30%, #ffb0b0 0%, #ef4b4b 50%, #c62828 100%);
    box-shadow: 0 10px 24px rgba(198, 40, 40, .4);
}

.ap-result-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    color: #10225a;
}

.ap-result-card .txn {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #e2ebff;
    color: #1546c4;
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

.ap-result-card p {
    color: #5b6478;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 20px;
}

.ap-result-card .acts {
    display: grid;
    gap: 10px;
}

.ap-btn.outline {
    background: #fff;
    color: #1546c4 !important;
    border: 1.5px solid #cbd9f3;
    text-shadow: none;
    box-shadow: none;
}

.ap-btn.outline::before {
    display: none;
}

/* ---------- notice box ---------- */
.ap-notice {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    background: #fff7e0;
    border: 1.5px solid #f2bc34;
    color: #6b4a00;
}

.ap-notice a {
    color: #11793a !important;
    font-weight: 700;
}

/* ---------- key / value lines inside a card ---------- */
.ap-kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid #e3e9f5;
    font-size: 14px;
}

.ap-kv span {
    color: #5b6478;
}

.ap-kv b {
    color: #10225a;
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}
