/* জমা ওয়ালেট — shared styles for the login page and the dashboard. */

@font-face { font-family: "Hind Siliguri"; font-weight: 400; font-display: swap; src: url("../fonts/hind-siliguri-bengali-400-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 500; font-display: swap; src: url("../fonts/hind-siliguri-bengali-500-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 600; font-display: swap; src: url("../fonts/hind-siliguri-bengali-600-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 700; font-display: swap; src: url("../fonts/hind-siliguri-bengali-700-normal.woff2") format("woff2"); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: "Hind Siliguri"; font-weight: 400; font-display: swap; src: url("../fonts/hind-siliguri-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Hind Siliguri"; font-weight: 500; font-display: swap; src: url("../fonts/hind-siliguri-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Hind Siliguri"; font-weight: 600; font-display: swap; src: url("../fonts/hind-siliguri-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Hind Siliguri"; font-weight: 700; font-display: swap; src: url("../fonts/hind-siliguri-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
    --bg: #F3F6F4;
    --surface: #FFFFFF;
    --surface-2: #F7FAF8;
    --text: #10201A;
    --muted: #5B6B64;
    --line: #DFE7E3;
    --brand: #0B6E4F;
    --brand-strong: #075A40;
    --brand-soft: #E2F2EB;
    --gold: #F2B441;
    --in: #15803D;
    --in-soft: #DCFCE7;
    --out: #B42318;
    --out-soft: #FEE4E2;
    --send: #1D4ED8;
    --send-soft: #DBEAFE;
    --focus: #0B6E4F;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgb(16 32 26 / 6%), 0 4px 16px rgb(16 32 26 / 6%);
    --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0C1512;
        --surface: #13201B;
        --surface-2: #182822;
        --text: #E7F0EC;
        --muted: #9AABA4;
        --line: #26372F;
        --brand: #2FB383;
        --brand-strong: #46C795;
        --brand-soft: #173A2D;
        --in: #4ADE80;
        --in-soft: #143323;
        --out: #F97066;
        --out-soft: #3A1A18;
        --send: #7FA7FF;
        --send-soft: #1A2742;
        --focus: #46C795;
        --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.muted { color: var(--muted); font-size: 0.94rem; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.94rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn-outline { background: var(--surface); border-color: var(--line); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn-icon { width: 20px; height: 20px; flex: none; }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 20px; height: 20px;
    border: 2.5px solid rgb(255 255 255 / 45%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}
.btn-outline.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--line); border-top-color: var(--brand); }

.icon-btn {
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    cursor: pointer;
    font-size: 1rem;
}
.icon-btn:hover { background: var(--brand-soft); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- forms */

.form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 0.95rem; }
.field small { color: var(--muted); font-size: 0.86rem; }
.field input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 1.02rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field input[aria-invalid="true"] { border-color: var(--out); }

.form-error {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--out-soft);
    color: var(--out);
    font-size: 0.94rem;
}

.recipient.is-found { color: var(--in); font-weight: 600; }
.recipient.is-missing { color: var(--out); }

.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -6px; }
.quick-amounts button {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    cursor: pointer;
    font-weight: 500;
}
.quick-amounts button:hover { border-color: var(--brand); color: var(--brand); }

.methods { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.methods legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 0.95rem; }
.methods label { position: relative; }
.methods input { position: absolute; opacity: 0; inset: 0; }
.methods span {
    display: grid;
    place-items: center;
    min-height: 46px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}
.methods input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.methods input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------- auth page */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    gap: 48px;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
}

.auth-brand { display: grid; gap: 18px; align-content: center; }
.brand-mark {
    width: 64px; height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--brand);
    color: #fff;
}
.brand-mark svg { width: 40px; height: 40px; }
.brand-mark-sm { width: 34px; height: 34px; border-radius: 10px; }
.brand-mark-sm svg { width: 22px; height: 22px; }
.auth-brand h1 { font-size: clamp(2.1rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.01em; }
.tagline { font-size: 1.25rem; color: var(--muted); }
.features { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.features li { display: flex; align-items: center; gap: 12px; }
.feature-icon {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}
.demo-badge {
    justify-self: start;
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--gold) 22%, transparent);
    font-size: 0.88rem;
    font-weight: 500;
}

.auth-card {
    display: grid;
    gap: 22px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.tab {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(16 32 26 / 12%); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alt-logins { display: grid; gap: 12px; }
.google-slot { min-height: 44px; display: grid; justify-items: center; }

/* ------------------------------------------------------------- dashboard */

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px max(16px, calc((100% - 1040px) / 2));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.topbar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.avatar {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.dash { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 20px; }

.balance-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 6px;
    padding: 26px 28px;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 92% 8%, rgb(255 255 255 / 16%) 0 90px, transparent 91px),
        radial-gradient(circle at 80% 120%, rgb(242 180 65 / 28%) 0 140px, transparent 141px),
        linear-gradient(135deg, #0B6E4F, #0E8A63);
    box-shadow: 0 10px 30px rgb(11 110 79 / 28%);
}
.balance-top { display: flex; justify-content: space-between; align-items: center; font-weight: 500; opacity: 0.92; }
.balance-toggle {
    padding: 4px 12px;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 999px;
    background: rgb(255 255 255 / 12%);
    color: #fff;
    font-size: 0.88rem;
    cursor: pointer;
}
.balance-amount { font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.balance-amount.is-hidden { letter-spacing: 0.15em; }
.balance-stats { display: flex; gap: 32px; margin-top: 10px; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 20%); }
.balance-stats div { display: grid; }
.balance-stats span { font-size: 0.86rem; opacity: 0.85; }
.balance-stats strong { font-size: 1.08rem; font-variant-numeric: tabular-nums; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.action {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 18px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 120ms ease, border-color 150ms ease;
}
.action:hover { border-color: var(--brand); }
.action:active { transform: scale(0.97); }
.action-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; }
.action-icon svg { width: 24px; height: 24px; }
.action-in { background: var(--in-soft); color: var(--in); }
.action-send { background: var(--send-soft); color: var(--send); }
.action-out { background: var(--out-soft); color: var(--out); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.card {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.card h2 { font-size: 1.15rem; }

.tx-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 700; }
.tx-icon svg { width: 20px; height: 20px; }
.tx-in .tx-icon { background: var(--in-soft); color: var(--in); }
.tx-out .tx-icon { background: var(--out-soft); color: var(--out); }
.tx-send .tx-icon { background: var(--send-soft); color: var(--send); }
.tx-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { color: var(--muted); font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amount { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-in .tx-amount { color: var(--in); }
.tx-amount small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.tx-new { animation: tx-in 500ms ease; }
@keyframes tx-in { from { background: var(--brand-soft); } }

.tx-skeleton { grid-template-columns: 1fr; }
.skeleton { display: block; height: 42px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-amount { width: 220px; height: 52px; background: linear-gradient(90deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 28%), rgb(255 255 255 / 12%)); background-size: 200% 100%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { display: grid; gap: 6px; justify-items: center; padding: 24px 8px; text-align: center; color: var(--muted); }
.empty-title { color: var(--text); font-weight: 600; }
.empty .btn { margin-top: 8px; }

.passkey-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.passkey {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}
.passkey-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.passkey-icon svg { width: 18px; height: 18px; }
.passkey-name { font-weight: 600; }
.passkey-meta { color: var(--muted); font-size: 0.82rem; }
.passkey-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 0.92rem; text-align: center; }

.account-info { margin: 6px 0 0; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-info div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.account-info dt { color: var(--muted); }
.account-info dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* --------------------------------------------------------------- dialogs */

.sheet {
    width: min(460px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    padding: 22px;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 60px rgb(0 0 0 / 25%);
}
.sheet::backdrop { background: rgb(8 20 16 / 50%); }
.sheet[open] { animation: sheet-in 200ms ease-out; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 1.2rem; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }

/* ----------------------------------------------------------------- toast */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 20;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 14px;
    background: #10201A;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
    animation: toast-in 200ms ease-out;
}
.toast.is-error { background: #9A1B12; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------------------------------------ setup page */

.setup { max-width: 560px; margin: 0 auto; padding: 40px 16px 64px; display: grid; gap: 22px; }
.setup-head { display: flex; align-items: center; gap: 16px; }
.setup-head h1 { font-size: 1.6rem; line-height: 1.25; }
.setup .auth-card h2 { font-size: 1.25rem; }
.setup code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 0.9em; }
.checks { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 6px; border-radius: var(--radius); background: var(--surface-2); font-size: 0.94rem; }
.checks li { display: flex; gap: 10px; }
.checks .ok span { color: var(--in); font-weight: 700; }
.checks .bad { color: var(--out); font-weight: 600; }
.setup-group { margin: 0; padding: 16px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.setup-group legend { padding: 0 6px; font-weight: 600; font-size: 0.92rem; color: var(--muted); }
.setup-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.config-box { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font: 0.82rem/1.5 ui-monospace, monospace; color: var(--text); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; gap: 28px; padding: 28px 16px; align-content: start; }
    .auth-brand { gap: 12px; }
    .features, .demo-badge { display: none; }
    .auth-card { padding: 22px; }
    .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .topbar-name { display: none; }
    .balance-card { padding: 22px; }
    .balance-stats { gap: 20px; }
    .action { padding: 14px 4px; font-size: 0.92rem; }
    .methods { grid-template-columns: repeat(2, 1fr); }
    .sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
