/* Signed-in user panel: payment flow, order cards, mobile tab bar. Loaded after style.css. */

/* Payment card */
.pay-card {
    background: var(--card);
    border: 1px solid rgba(16, 185, 129, .35);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}
.pay-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.pay-amount-label { font-size: 13px; color: var(--muted); }
.pay-amount-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1.2; }
.pay-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.pay-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--emerald);
    color: #06281d;
    font-size: 13px;
    font-weight: 800;
}

/* Payment method options */
.pm-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pm-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 12px 14px;
    text-align: left;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--surface-2);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    transition: border-color .15s, background .15s;
}
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pm-change { background: none; border: 0; padding: 6px 2px; color: var(--emerald); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pm-options.is-collapsed { grid-template-columns: 1fr; }
.pm-options.is-collapsed .pm-option:not(.is-active) { display: none; }
.pm-wait-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #10b981; }
.pm-option:hover { border-color: #475569; }
.pm-option:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
.pm-option.is-active { border-color: var(--emerald); background: rgba(16, 185, 129, .1); }
.pm-radio { flex: none; width: 18px; height: 18px; border: 2px solid #475569; border-radius: 50%; }
.pm-option.is-active .pm-radio { border: 5px solid var(--emerald); }
.pm-icon { flex: none; width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.pm-text { flex: 1; min-width: 0; }
.pm-name { display: block; font-size: 14.5px; font-weight: 700; }
.pm-sub { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.pm-tag {
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, .14);
    padding: 3px 7px;
    border-radius: 999px;
}
.pm-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.pm-panel[hidden], .pm-wait[hidden], #manual_pay_form[hidden] { display: none; }
.pm-panel p { margin: 0 0 14px; font-size: 14px; color: #cbd5e1; line-height: 1.5; }
.pm-pay-btn { width: 100%; justify-content: center; padding: 15px; font-size: 16px; font-weight: 700; }
.pm-wait { margin: 12px 0 0; font-size: 13.5px; color: #34d399; }
.pm-qr { text-align: center; margin-bottom: 14px; }
.pm-qr img { width: 100%; max-width: 200px; height: auto; border-radius: 12px; border: 3px solid #fff; }
.pm-qr div { margin-bottom: 10px; font-size: 13px; color: var(--muted); }

.copy-rows { display: grid; gap: 8px; }
.copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.copy-row > div { min-width: 0; }
.copy-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.copy-value { margin-top: 2px; font-size: 15px; font-weight: 700; color: #7dd3fc; word-break: break-all; }
.copy-btn {
    flex: none;
    min-height: 36px;
    padding: 0 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
}
.copy-btn.is-copied { color: #34d399; border-color: var(--emerald); }

.pay-submit { margin-top: 18px; }
.pay-submit .btn-primary { width: 100%; justify-content: center; padding: 14px; font-size: 15.5px; font-weight: 700; }
.pay-cancel { margin-top: 14px; text-align: center; }
.pay-cancel button {
    min-height: 40px;
    padding: 0 12px;
    font: inherit;
    font-size: 13.5px;
    color: #f87171;
    background: none;
    border: 0;
    cursor: pointer;
}
.pay-cancel button:hover { text-decoration: underline; }
.btn:disabled { opacity: .6; cursor: progress; }

/* Exchange form */
.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 14px; }
.amount-chips[hidden], .saved-chip[hidden] { display: none; }
.amount-chip {
    min-height: 36px;
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 999px;
    cursor: pointer;
}
.amount-chip:hover { border-color: var(--emerald); color: #fff; }
.saved-chip {
    display: block;
    max-width: 100%;
    margin-bottom: 8px;
    padding: 7px 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #34d399;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .3);
    border-radius: 8px;
    cursor: pointer;
}
.rate-lock { margin-top: 10px; text-align: center; font-size: 12.5px; color: #94a3b8; }

/* Order cards */
.order-list { display: grid; gap: 10px; }
.order-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    align-items: center;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .15s;
}
.card .order-card { background: var(--bg); }
.order-card:hover { border-color: #475569; }
.order-card-main { font-size: 15.5px; font-weight: 700; }
.order-card-meta { font-size: 12.5px; color: var(--muted); }
.order-card-action { color: #34d399; font-size: 13.5px; font-weight: 700; text-align: right; }
.order-card-action.is-muted { color: var(--muted); font-weight: 500; }

/* Mobile tab bar */
.tabbar { display: none; }
@media (max-width: 768px) {
    body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    body.has-tabbar .lx-footer { display: none; }
    body.has-tabbar .lx-fab-wrap { bottom: calc(76px + env(safe-area-inset-bottom)); }
    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding-bottom: env(safe-area-inset-bottom);
        background: #0b111d;
        border-top: 1px solid var(--border);
    }
    .tabbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 62px;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--muted);
        text-decoration: none;
    }
    .tabbar a.is-active { color: var(--emerald); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
    .grid-4 .stat { min-width: 0; padding: 14px; }
    .grid-4 .stat .n { font-size: 18px; overflow-wrap: anywhere; }
    .pay-card { padding: 16px; }
}
