/* ----- БАЗОВЫЕ СТИЛИ ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #cfe7fa, #a1c4fd);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 30px 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: background 0.3s, box-shadow 0.3s;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.subscription-info-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.status {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0 20px;
    padding: 12px;
    border-radius: 16px;
    background: #f1f5f9;
}

.user-id {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
}

.instruction-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 20px 0 10px;
    text-align: center;
}

.key-label {
    font-size: 14px;
    color: #475569;
    margin: 0 0 8px;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

.key-box {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 16px;
    margin: 8px 0 16px;
    word-break: break-all;
}

.blur-text {
    filter: blur(4px);
    cursor: pointer;
    transition: filter 0.2s;
    display: inline-block;
    width: 100%;
}

.blur-text.revealed {
    filter: none;
}

.step-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 16px 0 8px;
    text-align: center;
}

button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
}

button:active {
    transform: scale(0.97);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.install-btn {
    background: #3b82f6;
}

.add-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.copy-btn {
    background: #475569;
}

.trial-btn {
    background: #f59e0b;
}

.google-btn {
    background: #4285f4;
}

.hidden {
    display: none !important;
}

.info-text {
    font-size: 14px;
    color: #475569;
    margin: 8px 0;
    line-height: 1.4;
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
}

.instruction-box {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    margin-top: 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* ----- КАРТОЧКИ ТАРИФОВ (подготовка) ----- */
.tariffs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.tariff-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    cursor: pointer;
}

.tariff-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.tariff-card.popular {
    border: 2px solid #8b5cf6;
    background: #f5f3ff;
    position: relative;
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #8b5cf6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tariff-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.tariff-price {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    margin: 8px 0;
}

.tariff-duration {
    font-size: 14px;
    color: #64748b;
}

/* ----- АДАПТИВНОСТЬ ----- */
@media (min-width: 480px) {
    .tariffs-grid {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .tariff-card {
        flex: 1 1 130px;
    }
}

/* ----- ТЁМНАЯ ТЕМА ----- */
body.dark {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

body.dark .card {
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body.dark .logo {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
}

body.dark .subscription-info-label,
body.dark .user-id,
body.dark .info-text,
body.dark .key-label {
    color: #94a3b8;
}

body.dark .status {
    background: #1e293b;
    color: #e2e8f0;
}

body.dark .key-box {
    background: #0f172a;
}

body.dark button {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark .divider {
    background: #334155;
}

body.dark .instruction-box {
    background: #1e293b;
    border-left-color: #60a5fa;
    color: #cbd5e1;
}

body.dark .tariff-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .tariff-card:hover {
    border-color: #60a5fa;
    background: #2d3a52;
}

body.dark .tariff-card.popular {
    background: #312e81;
    border-color: #a78bfa;
}

body.dark .tariff-name {
    color: #f1f5f9;
}

body.dark .tariff-price {
    color: #60a5fa;
}

body.dark .tariff-duration {
    color: #94a3b8;
}

/* ----- КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ ----- */
.theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
    padding: 0;
    margin: 0;
    width: 40px !important;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

body.dark .theme-toggle {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

/* ----- TOAST-УВЕДОМЛЕНИЯ ----- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 90%;
    width: 400px;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    background: rgba(16, 185, 129, 0.9);
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ----- ИСПРАВЛЕНИЯ ДЛЯ ТЁМНОЙ ТЕМЫ ----- */
body.dark,
body.dark .card,
body.dark p,
body.dark span,
body.dark div:not(.toast):not(.popular-badge) {
    color: #e2e8f0;
}

body.dark button {
    color: white;
}

body.dark .info-text,
body.dark .key-label,
body.dark .step-text,
body.dark .instruction-title,
body.dark .user-id {
    color: #cbd5e1 !important;
}

body.dark .status {
    color: #f1f5f9 !important;
    background: #1e293b !important;
}

body.dark .blur-text {
    color: #94a3b8;
}

body.dark .blur-text.revealed {
    color: #f1f5f9;
}

body.dark .instruction-box {
    color: #cbd5e1;
}

body.dark .popular-badge {
    color: white;
    background: #a78bfa;
}

/* Кнопки в тёмной теме */
body.dark .copy-btn,
body.dark .install-btn,
body.dark .trial-btn,
body.dark .google-btn {
    color: white;
}

body.dark .copy-btn {
    background: #334155;
}

/* ----- СКЕЛЕТОН-ЗАГРУЗКА ----- */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 8px;
    margin: 8px 0;
}

body.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

.skeleton-text {
    height: 20px;
    width: 80%;
}

.skeleton-text-small {
    height: 16px;
    width: 60%;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----- ПЛАВНЫЕ ПЕРЕХОДЫ ПАНЕЛЕЙ ----- */
.panel {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.panel.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* ----- ПРОГРЕСС-БАР ----- */
.progress-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 16px 0 8px;
    overflow: hidden;
}

body.dark .progress-container {
    background: #1e293b;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border-radius: 10px;
    transition: width 0.1s ease;
    animation: progress-glow 1.5s infinite;
}

@keyframes progress-glow {
    0%, 100% { box-shadow: 0 0 5px #2563eb; }
    50% { box-shadow: 0 0 15px #7c3aed; }
}

/* ----- ИКОНКИ В КАРТОЧКАХ ТАРИФОВ ----- */
.tariff-card i {
    margin-right: 6px;
    color: #2563eb;
}

body.dark .tariff-card i {
    color: #60a5fa;
}

/* ----- УЛУЧШЕННЫЕ КНОПКИ ----- */
button i {
    margin-right: 8px;
}

/* Анимация нажатия */
button:active {
    transform: scale(0.97);
}

/* ----- АНИМАЦИЯ ПОЯВЛЕНИЯ TOAST ----- */
.toast {
    animation: slideUp 0.3s ease;
}

/* ----- ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ----- */
.card {
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.dark .card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ----- ДАШБОРД ----- */
.dashboard-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark .dashboard-card {
    background: #1e293b;
}

.dashboard-card i {
    margin-right: 8px;
    color: #2563eb;
}

.dashboard-card progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.dashboard-card ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.dashboard-card li {
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .dashboard-card li {
    border-bottom-color: #334155;
}

/* ----- МОДАЛЬНОЕ ОКНО МАСТЕРА ----- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 24px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

body.dark .modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

.close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
}

.close:hover {
    color: #0f172a;
}

body.dark .close:hover {
    color: #f1f5f9;
}

.wizard-step {
    text-align: center;
}

.wizard-step h3 {
    margin-bottom: 16px;
    color: #1e293b;
}

body.dark .wizard-step h3 {
    color: #f1f5f9;
}

.platform-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.platform-buttons button {
    width: auto;
    padding: 12px 20px;
}

/* Подсветка выбранной платформы */
.platform-buttons button.selected {
    background: #2563eb;
    color: white;
    border: 2px solid #1e40af;
    transform: scale(1.05);
}
body.dark .platform-buttons button.selected {
    background: #3b82f6;
    border-color: #60a5fa;
}

/* ----- МАСТЕР: ПОДСВЕТКА ВЫБРАННОЙ ПЛАТФОРМЫ ----- */
.platform-buttons button.selected {
    background: #2563eb;
    color: white;
    border: 2px solid #1e40af;
    transform: scale(1.05);
}
body.dark .platform-buttons button.selected {
    background: #3b82f6;
    border-color: #60a5fa;
}

/* ----- СТИЛИ ДЛЯ ШАГОВ МАСТЕРА ----- */
.wizard-step ol {
    padding-left: 20px;
    color: #1e293b;
}
body.dark .wizard-step ol {
    color: #cbd5e1;
}
.wizard-step li {
    margin-bottom: 6px;
}
#wizardResult {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: #d1fae5;
    color: #065f46;
}
body.dark #wizardResult {
    background: #064e3b;
    color: #d1fae5;
}

/* ----- ВЕРТИКАЛЬНЫЕ КНОПКИ ВЫБОРА ПЛАТФОРМЫ ----- */
.platform-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.platform-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.2s;
    width: 100%;
    margin: 0;
}

body.dark .platform-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.platform-btn.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

body.dark .platform-btn.selected {
    border-color: #3b82f6;
    background: #1e3a8a;
}

.platform-icon {
    width: 32px;
    font-size: 24px;
    margin-right: 12px;
    text-align: center;
}

.platform-text {
    flex: 1;
    text-align: center;
}

.platform-badge {
    font-size: 12px;
    font-weight: 400;
    padding: 4px 8px;
    border-radius: 20px;
    background: #e2e8f0;
    color: #475569;
}

body.dark .platform-badge {
    background: #334155;
    color: #94a3b8;
}

.safety-note {
    margin: 16px 0 8px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.safety-note i {
    margin-right: 6px;
    color: #10b981;
}

/* ----- ТЕКСТОВЫЕ ПОДСКАЗКИ В МАСТЕРЕ ----- */
.key-hint {
    font-size: 13px;
    color: #64748b;
    margin: 16px 0 8px;
    text-align: center;
    line-height: 1.4;
}
body.dark .key-hint {
    color: #94a3b8;
}
.key-hint i {
    margin-right: 6px;
    color: #f59e0b;
}

/* ----- КНОПКА ВЫХОДА ----- */
.logout-btn {
    position: absolute;
    top: 16px;
    right: 70px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    color: #1e293b;
}
body.dark .logout-btn {
    background: rgba(0, 0, 0, 0.3);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
}
.logout-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}
body.dark .logout-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ----- ФУТЕР КАРТОЧКИ ----- */
.card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
body.dark .card-footer {
    border-top-color: #334155;
}
.logout-link {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.logout-link i {
    margin-right: 6px;
}
.logout-link:hover {
    color: #ef4444;
}
body.dark .logout-link {
    color: #94a3b8;
}
body.dark .logout-link:hover {
    color: #f87171;
}

/* ----- ИНФОРМАЦИЯ ОБ ИСТОЧНИКЕ СКАЧИВАНИЯ ----- */

.source-info {
    background: #f0f9ff;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    text-align: center;
    border-left: 4px solid #3b82f6;
}
body.dark .source-info {
    background: #1e293b;
    border-left-color: #60a5fa;
}


/* ГАРАНТИРОВАННОЕ ОТОБРАЖЕНИЕ ИНФОРМАЦИОННОГО БЛОКА */
.source-info {
    display: block;
    visibility: visible;
    opacity: 1;
    background: #f0f9ff;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    text-align: center;
    border-left: 4px solid #3b82f6;
}
body.dark .source-info {
    background: #1e293b;
    border-left-color: #60a5fa;
}

/* ИНФОРМАЦИОННЫЙ БЛОК В МАСТЕРЕ — НЕЙТРАЛЬНЫЙ */
.source-info {
    background: #f8fafc;
    border-radius: 20px;
    padding: 18px 16px;
    margin: 20px 0;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2f6;
}
body.dark .source-info {
    background: #1e293b;
    border-color: #334155;
    box-shadow: none;
}
