/* =============================================================================
   AshrithPay — theme
   Layered on Bootstrap 5.3. Palette aligned with the legacy AshrithPay app:
   orange brand (#f58d0a) + violet accent (#8a2be2). Per-service accent overrides
   --brand on .app-shell (Insurance = orange, Education = violet).
   ============================================================================= */

:root {
    --ink: #1f2733;
    --ink-soft: #33405a;
    --brand: #f58d0a;
    --brand-600: #e07d08;
    --brand-700: #c56a06;
    --teal: #0ea5a4;
    --gold: #f59e0b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;

    --bg: #f5f7fc;
    --surface: #ffffff;
    --surface-2: #fbfcfe;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --border: #e6ebf3;
    --border-strong: #d5deec;

    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 59, .06), 0 1px 3px rgba(15, 27, 59, .05);
    --shadow: 0 10px 30px -12px rgba(15, 27, 59, .22);
    --shadow-lg: 0 24px 60px -20px rgba(15, 27, 59, .35);

    --grad-hero: radial-gradient(1200px 600px at 15% -10%, #f9a03f 0%, transparent 55%),
                 radial-gradient(900px 500px at 100% 0%, #f58d0a 0%, transparent 45%),
                 linear-gradient(160deg, #3a2410 0%, #4a2f12 55%, #d97907 100%);
    --sidebar-w: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }

.text-brand { color: var(--brand) !important; }
.text-muted-2 { color: var(--muted-2) !important; }
.fw-750 { font-weight: 750; }

/* ---- Buttons -------------------------------------------------------------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1.1rem; }
.btn-lg { padding: .8rem 1.4rem; border-radius: 12px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-brand:disabled { background: var(--brand); border-color: var(--brand); opacity: .5; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #071230; color: #fff; }
.btn-outline-brand { color: var(--brand); border-color: var(--border-strong); background: #fff; }
.btn-outline-brand:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-soft { background: #fff3e6; color: var(--brand-700); border: 1px solid #ffe0bf; }
.btn-soft:hover { background: #ffe9d2; color: var(--brand-700); }

/* ---- Cards ---------------------------------------------------------------- */
.ai-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.ai-card .ai-card-head {
    padding: 1.15rem 1.4rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: .7rem;
}
.ai-card .ai-card-body { padding: 1.4rem; }
.ai-title { font-weight: 750; font-size: 1.05rem; margin: 0; color: var(--ink); }
.ai-sub { color: var(--muted); font-size: .875rem; margin: 0; }

.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--brand); }

/* ---- Badges --------------------------------------------------------------- */
.badge-soft { border-radius: 999px; padding: .34em .7em; font-weight: 650; font-size: .74rem; display: inline-flex; align-items: center; gap: .35rem; }
.badge-success { background: #e7f6ec; color: #12813f; }
.badge-danger { background: #fdeaea; color: #c02626; }
.badge-warning { background: #fdf1de; color: #b26206; }
.badge-info { background: #fff3e6; color: var(--brand-700); }
.badge-neutral { background: #eef1f6; color: #475569; }
.badge-soft .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* =============================================================================
   AUTH / LANDING
   ============================================================================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-left { display: flex; flex-direction: column; padding: 2.2rem clamp(1.5rem, 5vw, 4.5rem); background: var(--surface); }
.auth-right { position: relative; overflow: hidden; background: var(--grad-hero); color: #eaf0ff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.auth-right::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: .7rem; }
.auth-brand img { height: 34px; }
.auth-brand .name { font-weight: 800; color: var(--ink); font-size: 1.06rem; letter-spacing: -.02em; }
.auth-card { max-width: 420px; width: 100%; margin: auto; }
.auth-card h1 { font-weight: 800; font-size: 1.7rem; letter-spacing: -.03em; }

.form-control, .form-select { border-radius: 11px; border-color: var(--border-strong); padding: .68rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(245,141,10,.15); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-soft); }
.input-affix { position: relative; }
.input-affix .form-control { padding-left: 2.5rem; }
.input-affix .bi { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

/* ---- Searchable biller picker (typeahead) --------------------------------- */
.biller-picker { position: relative; }
.bp-control { position: relative; }
.bp-input { padding-left: 2.5rem; padding-right: 2.4rem; }
.bp-search-ic { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.bp-clear { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted-2); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.bp-clear:hover { color: var(--brand); background: #fff3e6; }
.bp-results { position: absolute; z-index: 40; left: 0; right: 0; margin-top: 6px; background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; padding: 6px; }
.bp-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: 9px; cursor: pointer; }
.bp-item:hover, .bp-item.active { background: #fff3e6; }
.bp-item .bp-ic { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: #f1f5f9; color: var(--brand); display: grid; place-items: center; }
.bp-item:hover .bp-ic, .bp-item.active .bp-ic { background: var(--brand); color: #fff; }
.bp-item .bp-txt { min-width: 0; }
.bp-item .bp-name { display: block; font-weight: 600; color: var(--ink); font-size: .9rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-item .bp-cat { display: block; color: var(--muted); font-size: .74rem; }
.bp-item mark { background: #ffe0bf; color: inherit; padding: 0 1px; border-radius: 2px; }
.bp-msg { padding: .8rem .7rem; color: var(--muted); font-size: .86rem; text-align: center; }

.hero-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .8rem; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .78rem; font-weight: 600; position: relative; z-index: 1; }
.hero-title { font-size: clamp(1.9rem, 3.2vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; position: relative; z-index: 1; }
.hero-list { list-style: none; padding: 0; margin: 1.6rem 0 0; position: relative; z-index: 1; display: grid; gap: .9rem; }
.hero-list li { display: flex; gap: .75rem; align-items: flex-start; }
.hero-list .ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.14); display: grid; place-items: center; color: #fff; }
.hero-list .t { font-weight: 700; }
.hero-list .d { color: #b9c6ee; font-size: .86rem; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.2rem; position: relative; z-index: 1; }
.hero-stats .n { font-size: 1.5rem; font-weight: 800; }
.hero-stats .l { color: #b9c6ee; font-size: .8rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 2.4rem; position: relative; z-index: 1; color: #cdd8f5; font-size: .8rem; }
.trust-row span { display: inline-flex; align-items: center; gap: .4rem; }

/* =============================================================================
   APP SHELL
   ============================================================================= */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app-shell > div { min-width: 0; }   /* let the content column shrink so wide tables don't blow out the grid */
/* Backdrop must be out of normal flow on ALL widths, otherwise it becomes a third grid item
   and breaks the 2-column desktop layout. */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(11,27,59,.5); z-index: 1040; display: none; }
.sidebar-backdrop.open { display: block; }
.sidebar { background: #ffffff; color: #475569; padding: 1.1rem .85rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem 1.1rem; border-bottom: 1px solid var(--border); margin-bottom: .8rem; }
.sidebar .brand img { height: 30px; border-radius: 8px; }
.sidebar .brand .name { font-weight: 750; color: var(--ink); font-size: .98rem; line-height: 1.1; }
.sidebar .brand .name small { display: block; color: var(--brand); font-weight: 600; font-size: .68rem; }
.nav-label { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; color: var(--muted-2); margin: 1rem .7rem .35rem; }
.nav-link-ai { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; color: #475569; font-weight: 600; font-size: .9rem; margin-bottom: .15rem; transition: background .15s, color .15s; }
.nav-link-ai .bi { font-size: 1.05rem; opacity: .9; }
.nav-link-ai:hover { background: #fff3e6; color: var(--brand-700); }
.nav-link-ai.active { background: linear-gradient(90deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff; box-shadow: 0 8px 20px -8px rgba(245,141,10,.6); }
.sidebar .side-foot { margin-top: auto; padding: .8rem .7rem 0; border-top: 1px solid var(--border); color: var(--muted-2); font-size: .75rem; }

.topbar { height: 66px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.6rem; position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-weight: 750; font-size: 1.05rem; }
.topbar .page-title small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; }
.user-chip .av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* Content column holds the topbar, page content and the footer as a flex column so the
   shared footer bottom-anchors on short pages. */
.content-col { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.content-col > .main-content { flex: 1 1 auto; }
.main-content { padding: 1.7rem clamp(1rem, 3vw, 2.2rem); max-width: 1240px; margin: 0 auto; width: 100%; }

/* ---- Shared application footer (orange primary) --------------------------- */
.auth-body, .public-body { min-height: 100vh; display: flex; flex-direction: column; }
.public-body > main { flex: 1 1 auto; }
.ap-footer { margin-top: auto; width: 100%; background: linear-gradient(135deg, #f58d0a 0%, #d97907 100%); border-top: 1px solid rgba(255, 255, 255, .25); }
.ap-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 22px; padding: 14px clamp(18px, 3vw, 28px); max-width: 1240px; margin: 0 auto; }
.ap-footer-brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-footer-copy { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.ap-footer-powered { color: rgba(255, 255, 255, .85); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.ap-footer-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ap-footer-contact a { color: #fff; font-size: 12.5px; font-weight: 500; }
.ap-footer-contact a:hover { color: #fff; text-decoration: underline; }
.ap-footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.ap-footer-links a { color: #fff; font-size: 13px; font-weight: 500; padding: 2px 0; border-bottom: 1px solid transparent; }
.ap-footer-links a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, .85); }
.ap-footer-dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .55); flex-shrink: 0; }
@media (max-width: 767.98px) {
    .ap-footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .ap-footer-brand, .ap-footer-contact, .ap-footer-links { align-items: center; justify-content: center; }
}

/* ---- Stepper -------------------------------------------------------------- */
.stepper { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.stepper .step { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-weight: 650; font-size: .86rem; }
.stepper .step .num { width: 27px; height: 27px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: .8rem; background: #fff; }
.stepper .step.active .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .step.done .num { background: var(--success); border-color: var(--success); color: #fff; }
.stepper .step.active, .stepper .step.done { color: var(--ink); }
.stepper .bar { flex: 1; height: 2px; background: var(--border); min-width: 20px; max-width: 60px; }

/* ---- Gateway / radio cards ------------------------------------------------ */
.pick-card { border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 1rem 1.1rem; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; display: flex; align-items: center; gap: .9rem; }
.pick-card:hover { border-color: var(--brand); }
.pick-card.selected { border-color: var(--brand); background: #fff7ee; box-shadow: 0 0 0 3px rgba(245,141,10,.12); }
.pick-card .pg-ic { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }

/* ---- Amount summary ------------------------------------------------------- */
.amount-row { display: flex; justify-content: space-between; padding: .55rem 0; color: var(--muted); }
.amount-row.total { border-top: 1px dashed var(--border-strong); margin-top: .4rem; padding-top: .8rem; color: var(--ink); font-weight: 750; font-size: 1.15rem; }
.amount-hero { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }

/* ---- Detail list ---------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 40% 60%; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); font-weight: 600; word-break: break-word; }

/* ---- Tables (DataTables) -------------------------------------------------- */
table.dataTable { border-collapse: separate !important; }
table.dataTable thead th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border) !important; }
table.dataTable tbody td { vertical-align: middle; font-size: .88rem; border-bottom: 1px solid var(--border) !important; }
.dataTables_wrapper .dataTables_filter input { border: 1px solid var(--border-strong); border-radius: 9px; padding: .4rem .7rem; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }
.action-btns { display: inline-flex; gap: .3rem; }
.action-btns .btn { padding: .35rem .5rem; border-radius: 8px; }
.ins-chips { display: flex; flex-wrap: wrap; gap: .3rem; max-width: 260px; }
.ins-chip { background: #eef2f9; color: #475569; border-radius: 7px; padding: .12rem .5rem; font-size: .72rem; font-weight: 600; }

/* ---- Footer / static pages ------------------------------------------------ */
.app-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; padding: 1.4rem 0; margin-top: 2rem; }
.legal { max-width: 860px; margin: 0 auto; }
.legal h2 { font-weight: 750; font-size: 1.25rem; margin-top: 1.8rem; }
.legal p, .legal li { color: #334155; line-height: 1.7; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 991px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-right { display: none; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -300px; z-index: 1050; transition: left .25s; width: 280px; }
    .sidebar.open { left: 0; }
}
@media (min-width: 992px) { .nav-toggle { display: none; } }

/* ---- Legacy-style auth (login / OTP / forgot) ----------------------------- */
.lgn-page {
    flex: 1 1 auto;
    background: linear-gradient(rgba(28,20,40,.35), rgba(28,20,40,.35)), url('../images/ashrithpay_bg.png') center center / cover no-repeat fixed;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}
.lgn-shell { width: 100%; max-width: 1580px; margin: 0 auto; display: flex; justify-content: flex-end; }
.lgn-card {
    width: 100%;
    max-width: 530px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .55);
    padding: 2.4rem 2.2rem;
}
.lgn-logo { display: block; margin: 0 auto .9rem; max-width: 230px; height: auto; }
.lgn-card h1 { font-size: 1.32rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .1rem; color: var(--ink); }
.lgn-card .lgn-sub { color: var(--muted); font-size: .92rem; margin-bottom: 1.3rem; }
.lgn-svc-chip { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .78rem; color: var(--brand-700); background: #fff3e6; border: 1px solid #ffe0bf; padding: .32rem .75rem; border-radius: 999px; }
.lgn-badge { width: 54px; height: 54px; border-radius: 15px; background: #fff3e6; display: grid; place-items: center; margin: 0 auto .9rem; }
.lgn-powered { text-align: center; color: var(--muted-2); font-size: .74rem; margin-top: 1.35rem; }
.lgn-powered strong { color: var(--muted); font-weight: 700; }
/* password show / hide toggle (sits inside .input-affix) */
.pwd-wrap .form-control { padding-right: 42px; }
.pwd-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; border-radius: 7px; z-index: 2; }
.pwd-toggle:hover { color: var(--brand); background: rgba(245, 141, 10, .1); }
@media (max-width: 767px) {
    .lgn-shell { justify-content: center; }
    .lgn-card { max-width: 480px; padding: 2rem 1.5rem; }
}
