:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #4895ef;
    --secondary: #f72585;
    --success: #4cc9f0;
    --error: #f72585;
    --warning: #f8961e;
    --text: #2b2d42;
    --text-light: #8d99ae;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --border: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-mini {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-align: center;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

ol li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

code {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: var(--card-bg);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-telegram {
    background-color: #0088cc;
    color: white;
    padding-left: 2.5rem;
    position: relative;
}

.btn-telegram:hover {
    background-color: #0077b3;
}

.btn-telegram::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-sm);
}

.badge-warning {
    color: white;
    background-color: var(--warning);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-check {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    gap: 1rem;
}

.auth-message {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/*Стили для кнопки перехода на ПРО*/
#goToProBtn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

#goToProBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

#telegram-login-widget {
    display: flex;
    justify-content: center;
}

/*КОНЕЦ Стили для кнопки перехода на ПРО*/

.copy-box {
    background: rgba(67, 97, 238, 0.05);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    padding-bottom: 1.5rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: var(--transition);
    position: relative;

}

.copy-box:hover {
    background: rgba(67, 97, 238, 0.1);
}

.copy-box::after {
    content: "Нажмите чтобы скопировать";
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    /* Растягиваем на всю ширину */
    text-align: center;
    /* Выравниваем текст по центру */
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0 0.5rem;
    /* Небольшие отступы по бокам */
}

#copyText {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 1.5rem 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-none {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.5rem;
    }

    .modal-content {
        width: 95%;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 1rem 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.75rem 1.4rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* Стили для личного кабинета в модальном окне */
#dashboardModalBody .card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

#dashboardModalBody .card.primary-setting {
    border-left: 5px solid var(--primary);
    background: linear-gradient(135deg, #e8f4fd 0%, #d4e9fa 100%);
}

#dashboardModalBody .primary-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

#dashboardModalBody .subscription-card {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-left: 5px solid #00bcd4;
    border-radius: 0.75rem;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.15);
}

#dashboardModalBody .subscription-card.paid {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 5px solid #4caf50;
}

#dashboardModalBody .subscription-card.expired {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 5px solid #f44336;
}

#dashboardModalBody .subscription-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

#dashboardModalBody .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    margin-top: 0.5rem;
}

#dashboardModalBody .btn-primary {
    background-color: var(--primary);
    color: white;
}

#dashboardModalBody .btn-primary:hover {
    background-color: var(--primary-dark);
}

#dashboardModalBody .btn-secondary {
    background-color: var(--text-light);
    color: white;
}

#dashboardModalBody .btn-secondary:hover {
    background-color: var(--text);
}

#dashboardModalBody .telegram-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

#dashboardModalBody .toast {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

@media (max-width: 768px) {
    #dashboardModalBody .subscription-info {
        grid-template-columns: 1fr;
    }
}

/* Premium button styles - исправленная версия */
.btn-primary.premium {
    position: relative;
    overflow: hidden;
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    font-weight: 600 !important;
    transition: all 0.18s ease !important;
}

.btn-primary.premium::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8e2de2, #4a00e0, #00c6ff, #0078ff);
    background-size: 300% 300%;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(24px) saturate(120%);
    z-index: 0;
}

.btn-primary.premium:hover::before {
    opacity: 0.16;
}

.btn-primary.premium:active,
.btn-primary.premium.selected {
    transform: scale(1.02) !important;
    box-shadow: 0 18px 50px rgba(67, 97, 238, 0.12) !important;
    border-color: rgba(67, 97, 238, 0.45) !important;
}

.btn-primary.premium:active::before,
.btn-primary.premium.selected::before {
    opacity: 0.9;
}

.btn-primary.premium span {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #8e2de2, #4a00e0, #00c6ff, #0078ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-shimmer-pulse 3s ease-in-out infinite;
}

.btn-primary.premium:active span,
.btn-primary.premium.selected span {
    background: none !important;
    -webkit-text-fill-color: white !important;
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 30px rgba(255, 255, 255, 0.4);
    animation: white-glow 1.5s ease-in-out infinite alternate !important;
}

@keyframes text-shimmer-pulse {

    0%,
    100% {
        background-position: 0% 50%;
        opacity: 1;
    }

    50% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
}

@keyframes white-glow {
    from {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.8),
            0 0 10px rgba(255, 255, 255, 0.6),
            0 0 15px rgba(255, 255, 255, 0.4);
    }

    to {
        text-shadow: 0 0 10px rgba(255, 255, 255, 1),
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 30px rgba(255, 255, 255, 0.6),
            0 0 40px rgba(255, 255, 255, 0.4);
    }
}
