* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* ========== Auth ========== */
.auth-body { display: flex; justify-content: center; align-items: center; padding: 20px; }
.auth-card {
    background: white; border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 40px; max-width: 440px; width: 100%;
}
.payment-card { max-width: 500px; }

.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 26px; margin-bottom: 6px; }
.auth-header p { color: #666; font-size: 14px; }

.auth-error {
    background: #ffe9e9; border: 1px solid #ffc4c4; color: #a33;
    padding: 12px; border-radius: 8px; font-size: 13px;
    margin-bottom: 18px; text-align: center;
}

.auth-providers { display: flex; flex-direction: column; gap: 12px; }
.auth-provider {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border: 2px solid #e6e6f0; border-radius: 10px;
    background: white; cursor: pointer;
    font-size: 15px; font-weight: 600; color: #333;
    transition: all .15s ease; text-align: left; width: 100%;
}
.auth-provider:not(:disabled):hover {
    border-color: #667eea; background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102,126,234,.18);
}
.auth-provider__icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: #f0f3ff; color: #667eea;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.auth-provider--telegram {
    flex-direction: column; align-items: stretch; gap: 8px; cursor: default;
}
.auth-provider--telegram .auth-provider__title { font-size: 13px; color: #555; }
.auth-provider--disabled { opacity: .55; cursor: not-allowed; background: #fafafa; }
.auth-provider__badge {
    margin-left: auto; background: #eee; color: #777;
    font-size: 11px; padding: 2px 8px; border-radius: 100px;
    text-transform: uppercase;
}
.auth-foot { font-size: 11px; color: #aaa; text-align: center; margin-top: 22px; }

/* ========== LK ========== */
.lk-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.lk-topbar {
    display: flex; align-items: center; justify-content: space-between;
    color: white; margin-bottom: 18px;
}
.lk-topbar__title { font-size: 22px; font-weight: 700; }
.lk-topbar__user { display: flex; align-items: center; gap: 12px; font-size: 13px; opacity: .9; }
.lk-topbar__user a { color: white; text-decoration: underline; }

.card {
    background: white; border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    padding: 22px; margin-bottom: 18px;
}

.balance-row { display: flex; justify-content: space-between; align-items: center; }
.balance-amount { font-size: 30px; font-weight: 800; color: #5d4cd6; }
.balance-label { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: .5px; }

.btn {
    border: none; border-radius: 10px; cursor: pointer;
    padding: 11px 18px; font-size: 14px; font-weight: 600;
    transition: all .15s ease; display: inline-block; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2); color: white;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102,126,234,.35);
}
.btn-ghost {
    background: white; color: #5d4cd6;
    border: 1.5px solid #d8dafc;
}
.btn-ghost:hover:not(:disabled) { background: #f3f4ff; }
.btn-danger {
    background: #ffe7e7; color: #c53030;
    border: 1.5px solid #ffd4d4;
}
.btn-danger:hover:not(:disabled) { background: #ffd4d4; }

.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.section-head h2 { font-size: 17px; }

.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-empty {
    text-align: center; color: #888; font-size: 14px;
    padding: 30px 10px; border: 2px dashed #e5e5f0; border-radius: 10px;
}
.key-card {
    border: 1.5px solid #ececf6; border-radius: 12px;
    padding: 14px 16px;
    display: grid; grid-template-columns: 1fr auto; gap: 12px;
    align-items: center;
}
.key-card__info { min-width: 0; }
.key-card__country { font-weight: 700; margin-bottom: 4px; }
.key-card__meta { font-size: 12px; color: #888; }
.key-card__connect {
    background: #f6f7ff; border-radius: 8px;
    padding: 8px 10px; margin-top: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px; color: #444; word-break: break-all;
    max-height: 80px; overflow: auto;
}
.key-card__actions { display: flex; flex-direction: column; gap: 6px; }

/* ========== Payment ========== */
.user-info {
    background: #f0f4ff; border: 1px solid #d4e0ff;
    border-radius: 8px; padding: 12px; margin-bottom: 22px;
    font-size: 13px; color: #555; text-align: center;
}
.payment-options { display: grid; gap: 12px; margin-bottom: 24px; }
.payment-button {
    background: white; border: 2px solid #e0e0e0; border-radius: 10px;
    padding: 18px 20px; cursor: pointer;
    transition: all 0.25s ease;
    font-size: 16px; font-weight: 600; color: #333;
    display: flex; justify-content: space-between; align-items: center;
    text-align: left; width: 100%;
}
.payment-button:hover {
    border-color: #667eea; background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}
.payment-button.active {
    border-color: #667eea; background: #f0f4ff;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}
.payment-button-label { display: flex; flex-direction: column; gap: 4px; }
.payment-button-title { font-size: 15px; font-weight: 600; color: #333; }
.payment-button-desc { font-size: 12px; color: #999; font-weight: 400; }
.payment-button-amount {
    font-size: 20px; color: #667eea; font-weight: 700;
    white-space: nowrap; margin-left: 15px;
}
.payment-button-bonus {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: #ff6b6b; margin-top: 2px; font-weight: 500;
}
.submit-button { width: 100%; padding: 14px; font-size: 16px; }
.loading { text-align: center; color: #667eea; margin: 16px 0; }
.spinner {
    border: 3px solid #f3f3f3; border-top: 3px solid #667eea;
    border-radius: 50%; width: 30px; height: 30px;
    animation: spin 1s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ========== Modal ========== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20,20,40,.5);
    display: none; align-items: center; justify-content: center;
    z-index: 50; padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: white; border-radius: 16px;
    width: 100%; max-width: 420px; padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.modal-row label { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: .5px; }
.modal-row select {
    padding: 10px 12px; border: 1.5px solid #ddd;
    border-radius: 8px; font-size: 14px; background: white;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #2a2a3d; color: white;
    padding: 12px 20px; border-radius: 10px;
    font-size: 14px; opacity: 0;
    transition: opacity .2s ease;
    z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; }

@media (max-width: 480px) {
    .auth-card { padding: 24px; }
    .balance-row { flex-direction: column; gap: 12px; align-items: stretch; }
    .balance-amount { font-size: 26px; text-align: center; }
    .key-card { grid-template-columns: 1fr; }
}
