:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 280px;
}


/* Стили для экрана загрузки */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.logo-container {
    text-align: center;
}

.logo {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    /* animation: pulse 2s infinite; */
    animation: pulse 2s infinite, spin 1s linear infinite;
}

.loading-text {
    font-size: 18px;
    color: #333;
    margin-top: 10px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes slide {
    0% {
        transform: translateX(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(250px) scale(0.7);
        opacity: 0.5;
    }
    100% {
        transform: translateX(9999px) scale(0.1);
        opacity: 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; transform: rotate(0deg); }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; transform: rotate(360deg); }
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding-bottom: 60px;
    font-size: 0.85rem;
}

body.logged-in {
    padding-top: 60px;
}

body.desktop {
    padding-bottom: 0;
    padding-left: 0;
}

body.desktop.logged-in {
    padding-top: 0;
}
#bottom-navbar .logged-in {
    margin-bottom: 80px;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    display: none;
}

body.desktop .top-navbar {
    display: none !important;
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-color) !important;
    font-size: 1rem;
    padding-bottom: 0px !important;
    margin-bottom: 0px !important;
}

.user-name-small {
    font-size: 0.7rem;
    margin-bottom: 0px !important;
    top:0px;
    bottom:0px;
}

.balance-info {
    text-align: right;
}

.balance-label {
    font-size: 0.7rem;
    color: var(--secondary-color);
    margin-bottom: 0;
}

.balance-amount {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1rem;
    margin-left: 15px;
    cursor: pointer;
}

.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    border: none;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0 !important;
    font-weight: bold;
    padding: 10px 15px;
    font-size: 0.9rem;
}

.card-body {
    padding: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-size: 0.8rem;
}

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

.status-active {
    color: var(--success-color);
    font-weight: bold;
}

.status-blocked {
    color: var(--danger-color);
    font-weight: bold;
}

/* Боковое меню для десктопа */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-right: 30px;
    flex-shrink: 0;
    display: none;
}

.sidebar-header {
    padding: 30px 25px 25px 25px;
    border-bottom: 2px solid var(--light-color);
    margin-bottom: 0;
}

.sidebar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    text-align: center;
}

.sidebar-user {
    padding: 25px;
    border-bottom: 2px solid var(--light-color);
    margin-bottom: 0;
}

.sidebar-user-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--dark-color);
    text-align: center;
}

.sidebar-user-balance {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
}

.sidebar-nav {
    padding: 20px 15px;
}

.sidebar-nav .nav-link {
    color: var(--secondary-color);
    padding: 18px 20px;
    margin: 8px 0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    border: 2px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 86, 179, 0.05);
    border-color: rgba(0, 86, 179, 0.1);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: var(--primary-color);
    font-weight: bold;
    border-color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    margin-right: 15px;
    font-size: 1.4rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 25px 25px 25px;
    border-top: 2px solid var(--light-color);
    margin-top: auto;
}

.sidebar-logout {
    color: var(--danger-color);
    background: none;
    border: 2px solid var(--danger-color);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    font-weight: 500;
}

.sidebar-logout:hover {
    color: white;
    background: var(--danger-color);
}

.sidebar-logout i {
    margin-right: 15px;
    font-size: 1.4rem;
    width: 24px;
    text-align: center;
}

/* Основной контейнер для десктопа */
.desktop-container {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

body.desktop .desktop-container {
    display: flex;
}

.desktop-content {
    flex: 1;
    min-width: 0;
}

.sidebar-placeholder {
    width: var(--sidebar-width);
    margin-right: 30px;
    flex-shrink: 0;
    visibility: hidden;
}

.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 6px 0;
    display: none;
}

body.desktop .bottom-navbar {
    display: none !important;
}

.bottom-navbar .nav-link {
    color: var(--secondary-color);
    text-align: center;
    font-size: 0.65rem;
    padding: 4px 6px;
}

.bottom-navbar .nav-link.active {
    color: var(--primary-color);
}

.bottom-navbar .nav-link i {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.65rem;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d82 100%);
}

.login-card {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
}

.login-header {
    text-align: center;
    padding: 15px 0;
    background-color: transparent;
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
}

.login-title {
    font-size: 1.3rem;
}

.login-subtitle {
    font-size: 0.8rem;
}

.forgot-password {
    font-size: 0.75rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 1.3rem;
}

body.desktop .page-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    font-weight: bold;
}

.services-list {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.services-list li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.8rem;
}

body.desktop .services-list li {
    padding: 12px 0;
    font-size: 1.2rem;
}

.services-list li:last-child {
    border-bottom: none;
}

.service-label {
    font-weight: bold;
    color: var(--secondary-color);
}

body.desktop .service-label {
    font-size: 1.3rem;
}

.service-value {
    color: var(--dark-color);
}

body.desktop .service-value {
    font-size: 1.3rem;
}

/* Основной блок с информацией пользователя */
.main-info-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d82 100%);
    color: white;
    border: none;
}

body.desktop .main-info-card {
    padding: 30px;
}

.user-name {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: white;
}

body.desktop .user-name {
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.contract-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
}

body.desktop .contract-balance-row {
    margin-bottom: 25px;
}

.contract-section {
    flex: 1;
    text-align: center;
}

.balance-section {
    flex: 1;
    text-align: center;
}

.contract-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

body.desktop .contract-label {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.contract-number {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

body.desktop .contract-number {
    font-size: 2.2rem;
}

.balance-label-main {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

body.desktop .balance-label-main {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.balance-amount-large {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

body.desktop .balance-amount-large {
    font-size: 2.2rem;
}

.payment-main-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
}

body.desktop .payment-main-btn {
    padding: 15px 40px;
    font-size: 1.4rem;
    border-width: 2px;
}

.payment-main-btn:hover {
    background-color: white;
    color: var(--primary-color);
    border-color: white;
}

.vertical-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 40%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.3);
}

body.desktop .vertical-divider {
    height: 60%;
    width: 2px;
}

.tariff-title {
    font-size: 1.1rem;
}

body.desktop .tariff-title {
    font-size: 2rem;
}

.tariff-features {
    font-size: 0.8rem;
    padding-left: 1.2rem;
}

body.desktop .tariff-features {
    font-size: 1.3rem;
    padding-left: 2rem;
}

.tariff-option-title {
    font-size: 1rem;
}

body.desktop .tariff-option-title {
    font-size: 1.8rem;
}

.tariff-option-features {
    font-size: 0.75rem;
    padding-left: 1.2rem;
}

body.desktop .tariff-option-features {
    font-size: 1.2rem;
    padding-left: 2rem;
}

/* Стили для страницы оплаты */
.payment-features-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

body.desktop .payment-features-row {
    gap: 25px;
    margin-bottom: 35px;
}

.payment-feature-card {
    flex: 1;
    border-radius: 10px;
    color: white;
    min-height: 120px;
    position: relative;
    overflow: hidden;
    border: none;
}

body.desktop .payment-feature-card {
    min-height: 180px;
    border-radius: 15px;
}

.payment-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    z-index: 1;
}

.payment-feature-card .card-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

body.desktop .payment-feature-card .card-body {
    padding: 25px;
}

.promise-payment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.promise-payment::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" opacity="0.1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.recommended-payment {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.recommended-payment::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" opacity="0.1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91 2.56.62 4.18 1.63 4.18 3.71 0 1.76-1.37 2.92-3.12 3.25z"/></svg>');
}

.payment-feature-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
}

body.desktop .payment-feature-title {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.payment-feature-desc {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

body.desktop .payment-feature-desc {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.payment-amount-input {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

body.desktop .payment-amount-input {
    font-size: 2rem;
    padding: 20px;
    border-radius: 12px;
    border-width: 3px;
}

.payment-amount-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

.payment-method-btn {
    padding: 12px;
    font-size: 0.9rem;
    border-radius: 8px;
}

body.desktop .payment-method-btn {
    padding: 20px;
    font-size: 1.4rem;
    border-radius: 12px;
}

/* Основной контент для десктопа */
body.desktop .container {
    max-width: none;
    margin-left: 0;
    padding: 0;
}

body.desktop .card {
    border-radius: 15px;
    margin-bottom: 25px;
}

body.desktop .card-header {
    padding: 20px 25px;
    font-size: 1.4rem;
    border-radius: 15px 15px 0 0 !important;
}

body.desktop .card-body {
    padding: 25px;
}

body.desktop .btn {
    font-size: 1.2rem;
}

body.desktop .btn-sm {
    font-size: 1.1rem;
    padding: 10px 20px;
}

body.desktop .table {
    font-size: 1.2rem;
}

body.desktop .form-label {
    font-size: 1.3rem;
}

body.desktop .form-control {
    font-size: 1.2rem;
    padding: 12px;
}

/* Мобильные устройства */
@media (max-width: 1024px) {
    .balance-info {
        text-align: left;
        margin-top: 6px;
    }
    
    .contract-balance-row {
        flex-direction: row;
    }
    
    .vertical-divider {
        display: block;
    }
    .top-navbar {
        padding-top: 16px;
    }
    
    .bottom-navbar .nav-link {
        font-size: 0.6rem;
        padding: 3px 4px;
    }
    
    .nav-label {
        font-size: 0.6rem;
    }

    .payment-features-row {
        flex-direction: row;
        gap: 10px;
    }
    
    .payment-feature-card {
        min-height: 100px;
    }
    
    .payment-feature-title {
        font-size: 0.8rem;
    }
    
    .payment-feature-desc {
        font-size: 0.7rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .contract-number {
        font-size: 1rem;
    }
    
    .balance-amount-large {
        font-size: 1rem;
    }
    
    .contract-label,
    .balance-label-main {
        font-size: 0.7rem;
    }
    
    .vertical-divider {
        height: 30%;
    }
    
    .user-name {
        font-size: 1.1rem;
    }
    
    .payment-features-row {
        flex-direction: column;
    }
}

/* Планшеты и большие телефоны */
@media (min-width: 360px) and (max-width: 1024px) {
    .contract-number {
        font-size: 1.05rem;
    }
    
    .balance-amount-large {
        font-size: 1.05rem;
    }
    
    .payment-features-row {
        flex-direction: row;
    }
}

/* Десктопы */
@media (min-width: 1024px) {
    .contract-balance-row {
        flex-direction: row;
    }
    
    .vertical-divider {
        display: block;
    }
    
    .payment-features-row {
        flex-direction: row;
    }
    
    .sidebar {
        display: block;
    }
}

/* Стили для предотвращения нежелательного поведения при касании */
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.page {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

* {
    -webkit-tap-highlight-color: transparent;
}

/* Добавить в конец файла styles.css */

body:not(.logged-in) .desktop-container {
    display: none !important;
}


