/* BlendVPN — Тёмная тема, мобильный дизайн */

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #e5e5e5;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* === Логотип === */

.logo {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

.logo-small {
    font-size: 18px;
    font-weight: 600;
}

/* === Лендинг === */

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 32px 16px;
}

.landing-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.landing-subtitle {
    font-size: 16px;
    color: #888;
    margin-bottom: 32px;
}

/* === Страница ошибки авторизации === */

.auth-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 32px 16px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

/* === Кнопки === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background-color: #fff;
    color: #0a0a0a;
}

.btn-primary:hover {
    background-color: #e5e5e5;
}

.btn-outline {
    background-color: transparent;
    color: #e5e5e5;
    border: 1px solid #333;
}

.btn-outline:hover {
    border-color: #555;
    background-color: #1a1a1a;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-device {
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    font-size: 16px;
    background-color: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid #333;
}

.btn-device:hover {
    border-color: #555;
    background-color: #252525;
}

.btn-android:hover {
    border-color: #4ade80;
}

.btn-ios:hover {
    border-color: #60a5fa;
}

.btn-windows:hover {
    border-color: #a78bfa;
}

/* === Header === */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #222;
}

.btn-logout {
    font-size: 14px;
    color: #888;
    text-decoration: none;
}

.btn-logout:hover {
    color: #e5e5e5;
}

/* === Карточки === */

.card {
    background-color: #141414;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #222;
}

.card-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.card-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.card-buttons .btn {
    flex: 1;
}

/* === Баланс === */

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.balance-days {
    font-size: 14px;
    color: #666;
}

/* === Устройства === */

.device-count {
    font-size: 13px;
    color: #666;
    display: block;
    margin-top: 4px;
}

.devices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.devices-empty {
    text-align: center;
    color: #666;
    padding: 24px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.device-item:hover {
    background-color: #252525;
}

.device-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 28px;
    text-align: center;
}

.device-icon-android {
    color: #4ade80;
}

.device-icon-ios {
    color: #60a5fa;
}

.device-icon-windows {
    color: #a78bfa;
}

.device-name {
    flex: 1;
    font-size: 14px;
}

.device-date {
    font-size: 12px;
    color: #666;
}

/* === Тариф === */

.tariff-info {
    text-align: center;
    font-size: 13px;
    color: #666;
    padding: 16px;
}

/* === Модалки === */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #141414;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #333;
}

.modal-small {
    max-width: 320px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #222;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #e5e5e5;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #222;
}

.modal-footer .btn {
    flex: 1;
}

/* === Креды === */

.credentials {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.credential-row {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 8px;
}

.credential-label {
    font-size: 12px;
    color: #666;
    width: 60px;
    flex-shrink: 0;
}

.credential-value {
    flex: 1;
    font-size: 14px;
    font-family: monospace;
    word-break: break-all;
}

.credential-psk {
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-copy:hover {
    opacity: 1;
}

/* === Редактирование названия === */

.device-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-name-edit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-name {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #e5e5e5;
    font-family: inherit;
    flex: 1;
}

.input-name:focus {
    outline: none;
    border-color: #555;
}

.btn-edit,
.btn-save,
.btn-cancel {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
}

.btn-edit:hover,
.btn-save:hover,
.btn-cancel:hover {
    opacity: 1;
}

.btn-save {
    color: #4ade80;
}

.btn-cancel {
    color: #f87171;
}

/* === Инструкция === */

.instruction {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #aaa;
    margin-top: 16px;
}

/* === Кнопка скачивания === */

.btn-download {
    display: inline-block;
    padding: 12px 20px;
    margin: 12px 0;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #0a0a0a;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

/* === Создание устройства === */

.device-created-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* === Вкладки === */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background-color: #1a1a1a;
    padding: 4px;
    border-radius: 8px;
}

.tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
    color: #888;
    font-family: inherit;
}

.tab:hover {
    color: #e5e5e5;
}

.tab.active {
    background-color: #333;
    color: #e5e5e5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === VLESS ссылка === */

.credential-vless {
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #60a5fa;
}

/* === Широкая модалка === */

.modal-wide {
    max-width: 440px;
}

/* === XRay секция === */

.xray-info {
    margin-bottom: 16px;
}

.xray-description {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.credential-link {
    font-size: 11px;
    word-break: break-all;
    color: #60a5fa;
}

/* === История === */

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.transactions-empty {
    text-align: center;
    color: #666;
    padding: 24px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 8px;
    font-size: 13px;
    gap: 12px;
}

.transaction-date {
    color: #666;
    flex-shrink: 0;
}

.transaction-amount {
    font-weight: 600;
    flex-shrink: 0;
    min-width: 60px;
}

.amount-positive {
    color: #4ade80;
}

.amount-negative {
    color: #f87171;
}

.transaction-description {
    color: #aaa;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Сообщения === */

.topup-unavailable {
    text-align: center;
    color: #888;
    padding: 24px 0;
}

.error-message {
    text-align: center;
    color: #f87171;
    padding: 24px;
}

/* === Toast уведомление === */

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #4ade80;
    color: #0a0a0a;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* === Скроллбар === */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}
