/* ================================================================
   PayHub Layout — базовые стили страниц (идентично PayScrowing)
   ================================================================ */

/* ── Глобальный сброс body ──────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--ph-font-family, 'Roboto', sans-serif);
    font-size: var(--ph-font-size-base, 14px);
    font-weight: var(--ph-font-weight-normal, 400);
    color: var(--ph-text-primary, #2A2F5B);
    background-color: var(--ph-bg-body, #f8f9fa);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Карточки ───────────────────────────────────────────────── */
.ph-card {
    background: var(--ph-bg-card);
    border: 1px solid var(--ph-border-color);
    border-radius: var(--ph-border-radius);
    box-shadow: var(--ph-shadow-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

html.app-dark .ph-card {
    background: var(--ph-bg-card);
    border-color: var(--ph-border-color);
}

/* ── Кнопки подтверждения / отмены (out-pay) ───────────────── */
.out-btn {
    flex: 1;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    border: 1px solid transparent;
}

.out-btn-confirm {
    background: #e8f5ed;
    color: #246b40;
    border-color: #a8d8b8;
}
.out-btn-confirm:hover { background: #d4edde; }

.out-btn-cancel {
    background: #fce8e8;
    color: #922b2b;
    border-color: #f0b8b8;
}
.out-btn-cancel:hover { background: #f8d5d5; }

html.app-dark .out-btn-confirm,
html.app-dark .out-btn-cancel {
    filter: brightness(0.72) saturate(0.85);
}
html.app-dark .out-btn-confirm:hover,
html.app-dark .out-btn-cancel:hover {
    filter: brightness(0.62) saturate(0.85);
}

/* ── Toggle switch ──────────────────────────────────────────── */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 24px;
}
.switch input { display: none; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider { background-color: #716aca; }
input:focus + .slider { box-shadow: 0 0 1px #716aca; }
input:checked + .slider:before { transform: translateX(36px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* ── SignalR / загрузка overlay ─────────────────────────────── */
.signalr-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18, 8, 45, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: signalr-fadein 0.25s ease;
}
@keyframes signalr-fadein { from { opacity: 0; } to { opacity: 1; } }

.signalr-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 44px 52px 36px;
    text-align: center;
    box-shadow: 0 12px 60px rgba(40, 20, 80, 0.28), 0 2px 12px rgba(0,0,0,0.10);
    min-width: 280px; max-width: 360px;
    animation: signalr-slidein 0.3s cubic-bezier(.22,.68,0,1.2);
}
@keyframes signalr-slidein {
    from { transform: translateY(28px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.signalr-spinner-wrap {
    position: relative; width: 72px; height: 72px;
    margin: 0 auto 22px;
    display: flex; align-items: center; justify-content: center;
}
.signalr-ring {
    position: absolute; inset: 0;
    border: 4px solid #ede9f8;
    border-top-color: #3b2a6e;
    border-radius: 50%;
    animation: signalr-spin 0.85s linear infinite;
}
@keyframes signalr-spin { to { transform: rotate(360deg); } }

.signalr-shield-icon { font-size: 1.9rem; color: #3b2a6e; position: relative; z-index: 1; }
.signalr-brand { font-size: 1.35rem; font-weight: 700; color: #2e2a45; letter-spacing: 0.04em; margin-bottom: 8px; }
.signalr-text { color: #6b6490; font-size: 0.85rem; margin: 0 0 18px; line-height: 1.45; }
.signalr-dots { display: flex; justify-content: center; gap: 6px; }
.signalr-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: #3b2a6e; opacity: 0.25;
    animation: signalr-dot 1.2s ease-in-out infinite;
}
.signalr-dots span:nth-child(2) { animation-delay: 0.2s; }
.signalr-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes signalr-dot {
    0%, 80%, 100% { opacity: 0.20; transform: scale(0.85); }
    40%           { opacity: 1;    transform: scale(1.15); }
}

html.app-dark .signalr-overlay { background: rgba(1, 4, 9, 0.75); }
html.app-dark .signalr-card { background: rgba(13, 17, 23, 0.97); box-shadow: 0 12px 60px rgba(0,0,0,0.6), 0 2px 12px rgba(0,0,0,0.4); }
html.app-dark .signalr-brand { color: #c9d1d9; }
html.app-dark .signalr-text { color: #8b949e; }
html.app-dark .signalr-ring { border-color: #30363d; border-top-color: #58a6ff; }
html.app-dark .signalr-shield-icon { color: #58a6ff; }
html.app-dark .signalr-dots span { background: #58a6ff; }

/* ── Страница авторизации ───────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--ph-bg-body);
}
.auth-card {
    width: 420px;
    max-width: 94%;
    background: var(--ph-bg-card);
    border: 1px solid var(--ph-border-color);
    border-radius: var(--ph-border-radius);
    box-shadow: var(--ph-shadow-lg);
    padding: 2rem 2.25rem;
}

/* ── Скроллбар (глобально) ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(113, 106, 202, 0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(113, 106, 202, 0.6); }

html.app-dark ::-webkit-scrollbar-thumb { background: rgba(48, 54, 61, 0.8); }
html.app-dark ::-webkit-scrollbar-thumb:hover { background: rgba(72, 79, 88, 0.9); }

/* ── Панель баланса (правый дровер) ────────────────────────── */
.balance-panel {
    min-width: 160px;
}

.balance-card {
    display: flex;
    flex-direction: column;
}

.balance-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ph-color-secondary);
    line-height: 1.1;
}

.balance-currency {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ph-text-muted);
    margin-left: 2px;
}

.balance-info {
    font-size: 0.8rem;
    color: var(--ph-text-secondary);
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.wallet-addr {
    font-family: monospace;
    font-size: 0.75rem;
    max-width: 140px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
