/* ========================================
   ASTROVPN СТИЛИ
   ======================================== */

/* ----- RESET ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #070b15;
    color: #e0e6f0;
    min-height: 100vh;
    padding-bottom: 80px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ----- CONTAINER ----- */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ----- HEADER ----- */
.header {
    background: rgba(7, 11, 21, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(100, 140, 255, 0.06);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #6c8cff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vpn-status {
    font-size: 14px;
}

.profile-btn {
    background: rgba(100, 140, 255, 0.1);
    border: none;
    color: #8ab0ff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-btn:hover {
    background: rgba(100, 140, 255, 0.2);
}

/* ----- MAIN ----- */
.main {
    padding: 16px 0 20px;
}

/* ----- PAGES ----- */
.page {
    display: none;
    animation: fadeUp 0.35s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: 16px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #f0f4ff;
}

.page-header p {
    font-size: 14px;
    color: #7a8aa0;
    margin-top: 2px;
}

/* ----- WELCOME ----- */
.welcome-card {
    background: linear-gradient(145deg, rgba(16, 24, 48, 0.85), rgba(7, 11, 21, 0.95));
    border: 1px solid rgba(100, 140, 255, 0.06);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 16px;
}

.welcome-badge {
    display: inline-block;
    background: rgba(100, 140, 255, 0.12);
    border: 1px solid rgba(100, 140, 255, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #8ab0ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    color: #f0f4ff;
    margin-bottom: 8px;
}

.welcome-text {
    color: #b0bcd0;
    font-size: 15px;
    line-height: 1.6;
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 0;
}

.welcome-features span {
    background: rgba(100, 140, 255, 0.05);
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 12px;
    color: #8aa8ff;
    border: 1px solid rgba(100, 140, 255, 0.05);
}

/* ----- SUBSCRIPTION CARD ----- */
.subscription-card {
    background: rgba(12, 18, 34, 0.7);
    border: 1px solid rgba(100, 140, 255, 0.06);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.sub-icon {
    font-size: 16px;
}

.sub-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #7a8aa0;
}

.sub-details strong {
    color: #e0e8f0;
}

/* ----- QUICK ACTIONS ----- */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.quick-actions .quick-btn:first-child {
    grid-column: 1 / -1;
}

.quick-btn {
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quick-btn.primary {
    background: linear-gradient(135deg, #4a6cf7, #6c4af7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(74, 108, 247, 0.25);
}

.quick-btn.primary:active {
    transform: scale(0.97);
}

.quick-btn.secondary {
    background: rgba(30, 45, 75, 0.6);
    color: #c8d0e0;
    border: 1px solid rgba(100, 140, 255, 0.08);
}

.quick-btn.secondary:active {
    transform: scale(0.97);
    background: rgba(40, 55, 85, 0.7);
}

.quick-icon {
    font-size: 20px;
}

/* ----- PROMO BANNER ----- */
.promo-banner {
    background: linear-gradient(135deg, rgba(255, 200, 50, 0.1), rgba(255, 150, 50, 0.05));
    border: 1px solid rgba(255, 200, 50, 0.15);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #ffd93d;
}

.promo-banner button {
    background: rgba(255, 200, 50, 0.15);
    border: 1px solid rgba(255, 200, 50, 0.2);
    color: #ffd93d;
    padding: 6px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

/* ----- CONTENT CARD ----- */
.content-card {
    background: rgba(12, 18, 34, 0.6);
    border: 1px solid rgba(100, 140, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
}

.info-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.info-box p {
    color: #b0bcd0;
    font-size: 14px;
    margin-bottom: 4px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* ----- CODE BLOCK ----- */
.code-block {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(100, 140, 255, 0.06);
    margin-bottom: 14px;
}

.code-block span {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #a0d0ff;
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    background: rgba(100, 140, 255, 0.1);
    border: none;
    color: #8ab0ff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.copy-btn:active {
    background: rgba(100, 140, 255, 0.2);
}

/* ----- BUTTONS ----- */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.97);
}

.btn.primary {
    background: linear-gradient(135deg, #4a6cf7, #6c4af7);
    color: #fff;
}

.btn.primary:active {
    box-shadow: 0 4px 20px rgba(74, 108, 247, 0.3);
}

.btn.secondary {
    background: rgba(40, 60, 100, 0.3);
    color: #b0c0d8;
    border: 1px solid rgba(100, 140, 255, 0.08);
}

.btn.danger {
    background: rgba(255, 70, 70, 0.12);
    color: #ff6b6b;
    border: 1px solid rgba(255, 70, 70, 0.1);
}

.btn.success {
    background: rgba(70, 200, 120, 0.12);
    color: #6cdb9a;
    border: 1px solid rgba(70, 200, 120, 0.1);
}

.btn.full {
    width: 100%;
}

/* ----- PRICES GRID ----- */
.prices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.price-card {
    background: rgba(20, 30, 55, 0.4);
    border: 1px solid rgba(100, 140, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.price-card:active {
    transform: scale(0.96);
    border-color: rgba(100, 140, 255, 0.2);
}

.price-card .price-name {
    font-size: 14px;
    font-weight: 600;
    color: #d0d8e8;
}

.price-card .price-value {
    font-size: 20px;
    font-weight: 800;
    color: #8ab0ff;
    margin-top: 4px;
}

.price-card .price-days {
    font-size: 12px;
    color: #7a8aa0;
}

.price-card .discount-tag {
    background: rgba(255, 200, 50, 0.15);
    color: #ffd93d;
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 4px;
}

/* ----- STATS GRID ----- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #e0e8f0;
    display: block;
}

.stat-label {
    font-size: 11px;
    color: #7a8aa0;
}

/* ----- REF INFO ----- */
.ref-info {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

.ref-info p {
    font-size: 13px;
    color: #b0bcd0;
    margin-bottom: 2px;
}

/* ----- BALANCE DISPLAY ----- */
.balance-display {
    text-align: center;
    padding: 20px 0;
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    color: #6cdb9a;
    display: block;
}

.balance-label {
    font-size: 14px;
    color: #7a8aa0;
}

/* ----- PROFILE ----- */
.profile-avatar {
    font-size: 56px;
    text-align: center;
    margin-bottom: 12px;
}

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

.profile-info p {
    font-size: 14px;
    color: #b0bcd0;
    padding: 4px 0;
    border-bottom: 1px solid rgba(100, 140, 255, 0.04);
}

.profile-info p:last-child {
    border-bottom: none;
}

.profile-info strong {
    color: #e0e8f0;
}

/* ----- INPUT GROUP ----- */
.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #8a9ab0;
    margin-bottom: 4px;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(100, 140, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #e0e8f0;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

.input-with-btn input:focus {
    outline: none;
    border-color: rgba(100, 140, 255, 0.3);
}

.input-with-btn .btn {
    padding: 12px 18px;
    flex-shrink: 0;
}

/* ----- PROMO RESULT ----- */
#promoResult {
    margin-top: 10px;
}

#promoResult .success {
    color: #6cdb9a;
    padding: 10px 14px;
    background: rgba(70, 200, 120, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(70, 200, 120, 0.1);
}

#promoResult .error {
    color: #ff6b6b;
    padding: 10px 14px;
    background: rgba(255, 70, 70, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 70, 70, 0.1);
}

/* ----- PROMO LIST ----- */
.promo-list {
    margin-top: 12px;
}

.promo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}

.promo-item .promo-code {
    font-weight: 600;
    color: #8ab0ff;
}

.promo-item .promo-info {
    color: #7a8aa0;
    font-size: 12px;
}

/* ----- DOCKBAR ----- */
.dockbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(7, 11, 21, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(100, 140, 255, 0.06);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
    z-index: 200;
    max-width: 480px;
    margin: 0 auto;
}

.dock-item {
    background: none;
    border: none;
    color: #6a7a90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    min-width: 48px;
}

.dock-item .dock-icon {
    font-size: 22px;
    transition: transform 0.2s ease;
}

.dock-item .dock-label {
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.dock-item.active {
    color: #8ab0ff;
}

.dock-item.active .dock-icon {
    transform: translateY(-2px);
}

.dock-item.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #4a6cf7, #6c4af7);
    border-radius: 0 0 4px 4px;
}

.dock-item:active {
    transform: scale(0.92);
}

/* ----- MODAL ----- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(12, 18, 34, 0.98);
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(100, 140, 255, 0.06);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #6a7a90;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
}

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

.modal-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e8ecf8;
    margin-bottom: 12px;
}

.modal-content p {
    color: #b0bcd0;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ----- TOAST ----- */
.toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    max-width: 90%;
    width: 400px;
    pointer-events: none;
}

.toast {
    background: rgba(8, 12, 24, 0.95);
    color: #e0e8f0;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid rgba(100, 140, 255, 0.08);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.35s ease;
    pointer-events: auto;
    margin-bottom: 8px;
}

.toast:last-child {
    margin-bottom: 0;
}

.toast.success {
    border-color: rgba(70, 200, 120, 0.2);
    color: #6cdb9a;
}

.toast.error {
    border-color: rgba(255, 70, 70, 0.2);
    color: #ff6b6b;
}

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

/* ----- SCROLLBAR ----- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(7, 11, 21, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 140, 255, 0.15);
    border-radius: 4px;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 400px) {
    .welcome-title {
        font-size: 22px;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions .quick-btn:first-child {
        grid-column: 1 / -1;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .prices-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dock-item {
        padding: 4px 8px;
        min-width: 40px;
    }

    .dock-item .dock-label {
        font-size: 9px;
    }

    .dock-item .dock-icon {
        font-size: 20px;
    }
}

@media (min-width: 481px) {
    body {
        display: flex;
        justify-content: center;
        background: #050810;
    }

    .container,
    .dockbar {
        max-width: 420px;
    }

    .dockbar {
        border-radius: 20px 20px 0 0;
    }
}