@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Noto+Serif+Bengali:wght@500;600;700&display=swap');

/* ==================================================================
   ডিজাইন টোকেন
   ভাষা: পাসপোর্ট ও ভিসা ডকুমেন্ট — নেভি কভার, সিকিউরিটি পেপার,
   স্ট্যাম্প-টিল কালি, MRZ মনোস্পেস স্ট্রিপ।
================================================================== */
:root {
    --ink:        #12263F;   /* পাসপোর্ট কভার নেভি */
    --ink-deep:   #0A1728;
    --paper:      #EDF0F3;   /* সিকিউরিটি পেপার */
    --surface:    #FFFFFF;
    --stamp:      #157A6E;   /* ভিসা স্ট্যাম্প টিল — primary action */
    --stamp-dark: #0F5B52;
    --coin:       #B4690E;   /* টাকা / ব্যালান্স */
    --alert:      #A4243B;   /* স্ট্যাম্প লাল */
    --muted:      #5D6E80;
    --line:       #D3DBE3;

    --sans:  'Hind Siliguri', system-ui, sans-serif;
    --serif: 'Noto Serif Bengali', Georgia, serif;
    --mono:  ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

    --r: 6px;
    --shadow: 0 1px 2px rgba(18,38,63,.06), 0 8px 24px -16px rgba(18,38,63,.28);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.35; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; max-width: 68ch; }
a  { color: var(--stamp-dark); }

.muted { color: var(--muted); font-size: .92rem; }
.mono  { font-family: var(--mono); letter-spacing: .04em; }
.coin  { color: var(--coin); font-weight: 600; }

:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

/* ==================================================================
   অ্যাপ শেল
================================================================== */
.shell { min-height: 100vh; }

.side { display: none; }

.main { padding: 1.25rem 1rem 6rem; }
.wrap { max-width: 880px; }
.page-head { margin-bottom: 1.5rem; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--ink); color: #fff; padding: .8rem 1rem;
    position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-family: var(--serif); font-size: 1rem; }
.topbar .bal   { font-family: var(--mono); font-size: .9rem; color: #F0C987; }

.tabs {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
    padding: .55rem 0 .5rem; text-align: center; text-decoration: none;
    color: var(--muted); font-size: .72rem; line-height: 1.3;
}
.tabs a span { display: block; font-size: 1.15rem; }
.tabs a.on { color: var(--stamp-dark); font-weight: 600; }

/* ডেস্কটপ/ট্যাবলেট — ৮৬১px বা তার বেশি চওড়া স্ক্রিনে সাইডবার দেখানো হয়।
   মোবাইলে এই মিডিয়া কোয়েরি লোড না হলেও (ধীর নেটওয়ার্ক, আংশিক CSS) উপরের
   বেস স্টাইলগুলোই থাকে, তাই ফোনে সবসময় কমপ্যাক্ট লেআউটই দেখা যাবে। */
@media (min-width: 861px) {
    .shell { display: flex; }
    .side {
        display: flex; width: 248px; flex: 0 0 248px;
        background: var(--ink); color: #DCE4EC;
        flex-direction: column; padding: 1.25rem 0;
    }
    .side .brand {
        font-family: var(--serif); font-size: 1.05rem; color: #fff;
        padding: 0 1.25rem 1.1rem; margin-bottom: .5rem;
        border-bottom: 1px solid rgba(255,255,255,.12);
    }
    .side nav a {
        display: flex; align-items: center; gap: .6rem;
        padding: .62rem 1.25rem; color: #C3D0DD; text-decoration: none;
        border-left: 3px solid transparent; font-size: .96rem;
    }
    .side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
    .side nav a.on    { background: rgba(21,122,110,.22); border-left-color: var(--stamp); color: #fff; font-weight: 600; }
    .side .spacer { flex: 1; }
    .side .foot { padding: 0 1.25rem; font-size: .8rem; color: #8FA3B6; }

    .main { flex: 1; min-width: 0; padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 5rem; }

    .topbar { display: none; }
    .tabs   { display: none; }
}

/* ==================================================================
   ওয়ালেট কার্ড — পেজের একমাত্র সাহসী উপাদান।
   পাসপোর্টের ডেটা-পেজের মতো, নিচে MRZ স্ট্রিপ।
================================================================== */
.wallet {
    background: var(--ink);
    color: #fff; border-radius: var(--r);
    overflow: hidden; margin-bottom: 1.75rem;
    box-shadow: var(--shadow);
}
.wallet .body { padding: 1.35rem 1.5rem 1.1rem; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.wallet .label { font-size: .78rem; color: #93A8BC; margin-bottom: .1rem; }
.wallet .amount { font-family: var(--serif); font-size: 2.3rem; line-height: 1; color: #F0C987; }
.wallet .who { font-size: .95rem; color: #C3D0DD; }
.wallet .acts { margin-left: auto; display: flex; gap: .5rem; }
.wallet .mrz {
    font-family: var(--mono); font-size: .74rem; letter-spacing: .14em;
    background: var(--ink-deep); color: #6E88A3;
    padding: .5rem 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge-agency {
    display: inline-block; font-size: .72rem; font-weight: 600;
    background: var(--stamp); color: #fff; padding: .1rem .5rem; border-radius: 3px;
    margin-left: .4rem; vertical-align: middle;
}

/* ==================================================================
   কার্ড ও সার্ভিস গ্রিড
================================================================== */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r); padding: 1.15rem 1.25rem; margin-bottom: 1.1rem;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.svc {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r); padding: 1.1rem 1.15rem;
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    position: relative;
}
.svc:hover { border-color: var(--stamp); }
.svc.disabled { opacity: .6; cursor: default; }
.svc.disabled:hover { border-color: var(--line); }
.svc .ico  {
    font-size: 1.3rem; line-height: 1; margin-bottom: .55rem;
    width: 2.4rem; height: 2.4rem; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--chip, #EAF1FB);
}
.svc h3    { margin: 0 0 .25rem; }
.svc .tag  { font-size: .86rem; color: var(--muted); flex: 1; margin-bottom: .8rem; }
.svc .cost { font-family: var(--mono); font-size: .95rem; color: var(--coin); font-weight: 600; }
.svc .was  { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-left: .35rem; font-size: .82rem; }
.svc-badge {
    position: absolute; top: .8rem; right: .8rem;
    font-size: .68rem; font-weight: 700; letter-spacing: .02em;
    background: var(--ink); color: #F0C987;
    padding: .18rem .5rem; border-radius: 999px; white-space: nowrap;
}

/* কুইক অ্যাকশন বার — ড্যাশবোর্ডের উপরে, একনজরে সবচেয়ে দরকারি কাজ */
.quickbar { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: 1.25rem; }
.quickbar a {
    flex: 0 0 auto; display: flex; align-items: center; gap: .4rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    padding: .45rem .9rem; font-size: .86rem; font-weight: 600; color: var(--ink); text-decoration: none;
}
.quickbar a:hover { border-color: var(--stamp); color: var(--stamp-dark); }
.quickbar a.primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }

/* স্ট্যাট স্ট্রিপ — ব্যালান্স/অর্ডার/ইমেইলের মতো ছোট তথ্য পাশাপাশি */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.statrow .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; }
.statrow .stat .k { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.statrow .stat .v { font-family: var(--serif); font-size: 1.3rem; word-break: break-word; }

/* রেফারেল ব্যানার — গ্র্যাডিয়েন্ট, উৎসাহব্যঞ্জক */
.referral-banner {
    background: linear-gradient(120deg, #3D2B6B, #157A6E);
    color: #fff; border-radius: var(--r); padding: 1rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.referral-banner strong { font-family: var(--serif); font-size: 1.05rem; }
.referral-banner p { margin: .15rem 0 0; font-size: .85rem; color: #E4DCF5; max-width: 46ch; }

/* ==================================================================
   ফর্ম
================================================================== */
.stack { display: grid; gap: .95rem; }
.two   { display: grid; gap: .95rem; grid-template-columns: 1fr; }
@media (min-width: 561px) { .two { grid-template-columns: 1fr 1fr; } }

label { display: block; font-size: .9rem; font-weight: 500; }
input, select, textarea {
    width: 100%; margin-top: .3rem;
    font-family: inherit; font-size: 1rem; color: var(--ink);
    padding: .58rem .7rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r);
}
input.up { text-transform: uppercase; font-family: var(--mono); letter-spacing: .05em; }
textarea { min-height: 76px; resize: vertical; }
.hint { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: .25rem; }

.station-suggest {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 15;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; margin-top: .25rem;
}
.station-opt {
    display: flex; justify-content: space-between; gap: .6rem;
    padding: .55rem .8rem; cursor: pointer; font-size: .92rem; border-bottom: 1px solid var(--line);
}
.station-opt:last-child { border-bottom: none; }
.station-opt:hover { background: var(--paper); }
.station-code { color: var(--stamp-dark); white-space: nowrap; font-size: .82rem; }
.station-opt span:first-child { min-width: 0; }

.btn {
    display: inline-block; font-family: inherit; font-size: .97rem; font-weight: 600;
    padding: .6rem 1.15rem; border-radius: var(--r); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--stamp); color: #fff; }
.btn-primary:hover { background: var(--stamp-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); }
.btn-bad { background: var(--alert); color: #fff; }
.btn-sm { font-size: .84rem; padding: .35rem .7rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ==================================================================
   অ্যালার্ট ও টেবিল
================================================================== */
.alert { border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1.1rem; font-size: .94rem; border: 1px solid; }
.alert-good { background: #E8F4F1; border-color: #9CCEC5; color: #0F5B52; }
.alert-bad  { background: #FAEAED; border-color: #E0A9B4; color: #7E1B2C; }
.alert-note { background: #FBF3E4; border-color: #E3C68C; color: #7A4708; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.scroll-x { overflow-x: auto; }

.pill { font-size: .76rem; font-weight: 600; padding: .12rem .5rem; border-radius: 3px; white-space: nowrap; }
.pill-ok   { background: #E8F4F1; color: #0F5B52; }
.pill-wait { background: #FBF3E4; color: #7A4708; }
.pill-no   { background: #FAEAED; color: #7E1B2C; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* ==================================================================
   একক পাতা (লগইন / ইনস্টল)
================================================================== */
body.plain { display: grid; place-items: center; padding: 2rem 1rem; min-height: 100vh; }
.sheet {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 2rem; width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.doc-h1 { font-size: 1.45rem; margin-bottom: .3rem; }

/* ==================================================================
   ল্যান্ডিং
================================================================== */
.hero { background: var(--ink); color: #fff; padding: 3.5rem clamp(1rem,5vw,3rem) 3rem; }
.hero .inner { max-width: 880px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 2.7rem); max-width: 18ch; }
.hero p  { color: #C3D0DD; max-width: 52ch; }
.hero .cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.landing-body { max-width: 880px; margin: 0 auto; padding: 2.5rem clamp(1rem,5vw,3rem) 4rem; }
.steps { counter-reset: s; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); }
.steps li { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; }
.steps li::before {
    counter-increment: s; content: counter(s);
    font-family: var(--mono); font-size: .8rem; color: var(--stamp-dark);
    border: 1px solid var(--stamp); border-radius: 50%;
    width: 1.6rem; height: 1.6rem; display: grid; place-items: center; margin-bottom: .5rem;
}

/* ==================================================================
   জেনারেট করা ডকুমেন্ট (A4, প্রিন্ট → PDF)
================================================================== */
.doc {
    background: #fff; width: 210mm; min-height: 297mm; margin: 1.5rem auto;
    padding: 18mm 16mm; box-shadow: var(--shadow); color: #000;
    font-size: 11pt;
}
.doc-top { display: flex; justify-content: space-between; align-items: flex-start;
           border-bottom: 2px solid var(--ink); padding-bottom: .7rem; margin-bottom: 1.3rem; }
.doc-top .org { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.doc-top .ref { font-family: var(--mono); font-size: .8rem; text-align: right; }
.doc h2 { font-family: var(--sans); font-size: .95rem; letter-spacing: .1em; color: var(--muted);
          border-bottom: 1px solid var(--line); padding-bottom: .3rem; margin: 1.5rem 0 .7rem; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.5rem; }
.doc-grid .k { font-size: .75rem; color: var(--muted); }
.doc-grid .v { font-family: var(--mono); font-size: .95rem; word-break: break-word; }
.doc-note { margin-top: 2rem; padding: .8rem 1rem; border: 1px solid var(--line);
            font-size: .78rem; color: var(--muted); }
.doc-mrz { margin-top: 1.5rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .16em;
           border-top: 1px solid var(--ink); padding-top: .5rem; color: var(--ink); word-break: break-all; }
.print-bar { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff;
             padding: .7rem 1rem; display: flex; gap: .6rem; align-items: center; justify-content: center; }

@media print {
    .print-bar, .side, .topbar, .tabs { display: none !important; }
    body { background: #fff; }
    .doc { box-shadow: none; margin: 0; width: auto; min-height: 0; padding: 0; }
    @page { size: A4; margin: 16mm; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
