/* Стили личного кабинета и auth-страниц */
.app-page {
    min-height: 100vh;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}
.app-page .app-main,
.app-page > main {
    flex: 1;
}
.dashboard-page {
    padding-bottom: 0;
}
.dashboard-page #siteFooter {
    margin-top: auto;
}
.dashboard-page .footer {
    padding: 48px 0 24px;
    margin-bottom: 0;
}

.app-main {
    padding: 40px 0 80px;
}

.app-header {
    text-align: center;
    margin-bottom: 40px;
}

.app-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: #94a3b8;
    font-size: 16px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.app-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.app-card h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #f8fafc;
}

.app-card p, .app-card li {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 8px;
}

.app-card .value {
    color: #f8fafc;
    font-weight: 600;
    font-size: 18px;
}

.app-card.wide {
    grid-column: 1 / -1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child { border-bottom: none; }

.auth-page .app-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 32px 0 48px;
}
.auth-shell {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}
.auth-box {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 36px 32px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}
.auth-box .app-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-box .app-header h1 {
    font-size: 26px;
    margin-bottom: 6px;
}
.auth-box .app-header p {
    font-size: 14px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 28px;
    font-size: 28px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: #f8fafc;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-input::placeholder { color: #64748b; }

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.tariff-card {
    background: rgba(30, 58, 138, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
}

.tariff-card h4 {
    color: #f8fafc;
    margin-bottom: 6px;
}

.tariff-price {
    color: #60a5fa;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 12px;
}
.tariff-price span {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.msg-error { color: #ef4444; font-size: 14px; margin-top: 12px; text-align: center; }
.msg-success { color: #10b981; font-size: 14px; margin-top: 12px; }
.msg-info { color: #94a3b8; font-size: 14px; margin-top: 8px; }

.code-box {
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 13px;
    color: #60a5fa;
    word-break: break-all;
    margin: 10px 0;
    border: 1px solid rgba(59,130,246,0.2);
}

.nav-menu .nav-auth-mobile {
    display: none;
}

.nav-auth {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-auth .btn {
    padding: 10px 22px;
    font-size: 14px;
}

.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-active { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #ef4444; }

.progress-bar {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin: 12px 0 6px;
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 14px;
}

.auth-footer a {
    color: #60a5fa;
    text-decoration: none;
}

.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(96,165,250,0.3);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page loader */
.page-loader {
    position: fixed; inset: 0; z-index: 12000;
    background: rgba(5, 11, 20, 0.95);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.page-loader.active { opacity: 1; pointer-events: auto; }
.page-loader-track {
    width: min(320px, 80vw); height: 4px;
    background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden;
}
.page-loader-bar {
    height: 100%; width: 40%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 4px;
    animation: loaderSlide 1.2s ease-in-out infinite;
}
@keyframes loaderSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}
.page-loader-text { margin-top: 16px; color: #94a3b8; font-size: 14px; }

/* Dashboard layout */
.dashboard-page .app-main {
    padding-top: 4px;
    padding-bottom: 24px;
}
.dash-layout {
    display: none;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    width: 100%;
    align-items: start;
}
.dash-layout.is-ready {
    display: grid;
    animation: dashFadeIn 0.35s ease;
}
@keyframes dashFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dash-sidebar {
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.12));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 20px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 88px;
    margin-top: 52px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.dash-content {
    min-height: 200px;
    align-self: start;
}
.dash-user-card {
    text-align: center; margin-bottom: 12px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dash-avatar {
    width: 48px; height: 48px; margin: 0 auto 6px;
    background: rgba(59,130,246,0.15); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.dash-user-name { font-weight: 700; color: #f8fafc; margin-bottom: 2px; font-size: 15px; }
.dash-user-balance { color: #60a5fa; font-size: 13px; font-weight: 600; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav-item {
    background: transparent;
    border: none;
    color: #94a3b8;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.dash-nav-item:hover { background: rgba(255,255,255,0.04); color: #f8fafc; }
.dash-nav-item.active { background: rgba(59,130,246,0.15); color: #60a5fa; }
.dash-logout { width: 100%; margin-top: 12px; }
.dash-panel { display: none; }
.dash-panel.active { display: block; }
.dash-panel h2 { font-size: 22px; margin-bottom: 16px; color: #f8fafc; font-weight: 700; }
.dash-cards { display: grid; gap: 16px; }
.dash-cards-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.dash-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dash-stat-card { text-align: center; padding: 20px 16px !important; }
.dash-stat-icon { font-size: 28px; margin-bottom: 8px; }
.dash-stat-label { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.dash-stat-value { color: #f8fafc; font-size: 18px; font-weight: 700; }
.dash-stat-hint { color: #64748b; font-size: 12px; margin-top: 4px; }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dash-card-header h3 { margin-bottom: 0 !important; }
.dash-balance-card { text-align: center; padding: 32px 24px !important; }
.dash-balance-label { color: #94a3b8; font-size: 14px; margin-bottom: 8px; }
.dash-balance-amount { font-size: 36px; font-weight: 800; color: #60a5fa; margin-bottom: 20px; }
.dash-balance-hint { color: #64748b; font-size: 12px; margin-top: 12px; }
.pay-info-list { display: flex; flex-direction: column; gap: 14px; }
.pay-info-item { display: flex; gap: 14px; align-items: flex-start; }
.pay-info-item span { font-size: 24px; }
.pay-info-item b { color: #f8fafc; display: block; margin-bottom: 2px; }
.pay-info-item p { color: #64748b; font-size: 13px; margin: 0; }
.tariff-card-actions { margin-top: 14px; }
.tariff-card-actions .btn { width: 100%; }
.tariff-pay-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tariff-pay-btns .pay-method-btn { padding: 12px 8px; }
.btn-hero-connect {
    background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.55), 0 4px 20px rgba(6, 182, 212, 0.35);
    animation: heroPulse 2.5s ease-in-out infinite;
}
.btn-hero-connect:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 36px rgba(59, 130, 246, 0.7), 0 6px 24px rgba(6, 182, 212, 0.45);
}
@keyframes heroPulse {
    0%, 100% { box-shadow: 0 0 28px rgba(59, 130, 246, 0.55), 0 4px 20px rgba(6, 182, 212, 0.35); }
    50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.75), 0 4px 28px rgba(6, 182, 212, 0.5); }
}
.guest-register-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 16px;
    line-height: 1.6;
    text-align: center;
}
.auth-divider {
    display: flex; align-items: center; text-align: center;
    margin: 20px 0; color: #64748b; font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-divider span { padding: 0 12px; }
.btn-telegram {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(34, 158, 217, 0.35);
}
.btn-telegram:hover { filter: brightness(1.08); transform: translateY(-1px); }
.credentials-form { max-width: 400px; }
.pay-qr-img { max-width: 100%; border-radius: 12px; display: block; margin: 0 auto; }
.deposit-form-inline {
    max-width: 360px;
    margin: 0 auto;
    text-align: left;
}
.deposit-form-inline .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-size: 14px;
}

/* Modals & toast */
.ui-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.ui-modal {
    background: #0f172a; border: 1px solid rgba(59,130,246,0.3);
    border-radius: 20px; padding: 28px; max-width: 420px; width: 100%;
}
.ui-modal h3 { color: #f8fafc; margin-bottom: 16px; font-size: 20px; }
.ui-modal-wide { max-width: 480px; }
.ui-modal-sub { color: #94a3b8; font-size: 14px; margin: -8px 0 16px; }
.ui-modal-body { color: #94a3b8; margin-bottom: 20px; }
.ui-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.pay-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-method-grid-compact { grid-template-columns: repeat(2, 1fr); }
.pay-method-btn {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; padding: 16px 10px; cursor: pointer; color: #f8fafc;
    font-family: inherit; transition: all 0.2s; text-align: center;
}
.pay-method-btn:hover, .pay-method-btn.active {
    border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.12);
}
.pay-method-debug {
    border-color: rgba(234, 179, 8, 0.35) !important;
    background: rgba(234, 179, 8, 0.08) !important;
}
.pay-method-debug:hover {
    border-color: rgba(234, 179, 8, 0.55) !important;
    background: rgba(234, 179, 8, 0.14) !important;
}
.pay-method-icon { display: block; font-size: 24px; margin-bottom: 6px; }
.pay-method-name { display: block; font-weight: 600; font-size: 14px; }
.pay-method-desc { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.amount-quick-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.amount-quick-btn {
    background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25);
    color: #60a5fa; border-radius: 10px; padding: 8px 14px; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.amount-quick-btn:hover { background: rgba(59,130,246,0.2); }
.ui-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1e293b; color: #f8fafc; padding: 12px 24px; border-radius: 12px;
    opacity: 0; transition: all 0.3s; z-index: 1100; pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
}
.ui-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ui-toast-success { border-color: #10b981; }
.ui-toast-error { border-color: #ef4444; }

@media (max-width: 768px) {
    .nav-auth { display: none; }
    .nav-menu .nav-auth-mobile { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
    .app-header h1 { font-size: 28px; }
    .auth-box { padding: 28px 22px; }
    .auth-page .app-main { padding: 24px 0 40px; }
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; margin-top: 12px; }
    .dash-content { order: -1; }
    .dash-nav { flex-direction: row; flex-wrap: wrap; }
    .dash-nav-item { flex: 1; min-width: 100px; text-align: center; font-size: 13px; padding: 10px; }
    .dash-logout { margin-top: 12px; }
    .pay-method-grid { grid-template-columns: 1fr; }
}
