/* === ЦВЕТОВЫЕ СХЕМЫ === */
/* Синяя (по умолчанию) */
:root {
    --primary-color: #5d5dff;
    --primary-light: #7a7aff;
    --primary-dark: #4a4ac7;
    --gradient-start: #4a4ac7;
    --gradient-end: #7979ff;
}

/* Фиолетовая тема */
.purple-theme {
    --primary-color: #9d4edd;
    --primary-light: #b576f5;
    --primary-dark: #7a3ca9;
    --gradient-start: #7a3ca9;
    --gradient-end: #b576f5;
}

/* Красная тема */
.red-theme {
    --primary-color: #ff4d4d;
    --primary-light: #ff7070;
    --primary-dark: #cc3d3d;
    --gradient-start: #cc3d3d;
    --gradient-end: #ff7070;
}

/* === ОБЩИЕ ПЕРЕМЕННЫЕ === */
:root,
.purple-theme,
.red-theme {
    --secondary-color: #1e1e2f;
    --bg-color: #0a0a0b;
    --text-color: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2a2a3a;
    --card-bg: #12121a;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* === Сброс и базовые стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Open Sans', sans-serif;
    transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 10%, rgba(93, 93, 255, 0.07), transparent 50%);
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-color);
}

/* === Анимированный логотип: быстрая пульсация слева-направо === */
.fluid-logo {
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    display: inline-block;
    white-space: nowrap;
    line-height: 1.1;
    position: relative;
    color: white; /* всегда виден */
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.fluid-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Яркий бело-серебристый градиент */
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.6),
        rgba(255, 255, 255, 0.4),
        rgba(255, 255, 255, 0.15),
        transparent
    );
    background-size: 300% 100%;
    background-position: -100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmerLoop 2.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes shimmerLoop {
    0% {
        background-position: -100% 0;
    }
    50% {
        background-position: 150% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Поддержка высококонтрастного режима */
@media (forced-colors: active) {
    .fluid-logo {
        color: canvasText !important;
        text-shadow: none !important;
    }
    .fluid-logo::before {
        display: none;
    }
}

/* Центральные функции */
.header-center {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.func-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    padding: 6px 0;
    white-space: nowrap;
}

.func-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.func-link:hover {
    color: var(--text-color);
}

.func-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Кнопки справа */
.header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.auth-btn {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(93, 93, 255, 0.2);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(93, 93, 255, 0.3);
}

/* Основной контент */
main {
    padding-top: 100px;
}

/* === Модальные окна === */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.4s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 500px;
    animation: scaleIn 0.4s ease;
}

.modal.show .modal-content {
    margin: 0;
    width: 100%;
    max-width: 520px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-light);
}

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

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === Формы === */
.form-box {
    width: 100%;
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2),
                0 5px 15px rgba(93, 93, 255, 0.1),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    animation: formAppear 0.8s ease-out forwards;
}

.form-box .close {
    top: 12px;
    right: 12px;
    font-size: 22px;
}

.form-content form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@keyframes formAppear {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.form-content h2 {
    text-align: center;
    margin-bottom: 17px;
    color: white;
    font-size: 1.8rem;
    position: relative;
    z-index: 1;
}


/* Стиль для ссылки Telegram в модалке восстановления */
.telegram-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    margin: 12px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(93, 93, 255, 0.2);
}

.telegram-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 93, 255, 0.3);
}



.form-content h2::after {
    content: '';
    position: absolute;
    margin-bottom: 15px;
    margin-top: 8px;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 1.5px;
}

.form-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Поля ввода */
.form-group {
    margin-bottom: 10px;
    position: relative;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 10px;
    background-color: rgba(30, 30, 47, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-icon-wrapper:focus-within {
    background-color: rgba(40, 40, 67, 0.7);
    box-shadow: 0 0 0 2px rgba(93, 93, 255, 0.3);
}

.input-icon-wrapper .icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
}

.input-icon-wrapper svg {
    width: 18px;
    height: 18px;
}

.input-icon-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 15px 15px 15px 45px;
    color: white;
    font-size: 16px;
    outline: none;
}

.input-icon-wrapper input::placeholder {
    color: rgba(160, 160, 160, 0.6);
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
}

.input-icon-wrapper input:focus ~ .focus-border {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-light);
}

.remember-group,
.terms-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.terms-group {
    margin-top: 15px;
}

/* Чекбоксы */
.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-wrapper label {
    margin: -17px 0px 5px 0px;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    user-select: none;
}

.checkbox-wrapper label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + label::before {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    left: 5px;
    top: -1px;
    color: white;
    font-size: 14px;
}

.checkbox-wrapper label a {
    color: var(--primary-light);
    text-decoration: none;
}

.checkbox-wrapper label a:hover {
    text-decoration: underline;
}

.forgot-password {
    color: var(--primary-light);
    font-size: 0.9rem;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Кнопка отправки */
.submit-btn {
    width: 100%;
    margin-top: -35px;
    padding: 9px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(93, 93, 255, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(93, 93, 255, 0.3);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Сообщения */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: -33px;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message {
    background: rgba(255, 82, 82, 0.1);
    border-left: 4px solid #ff5252;
    color: #ff5252;
}

.success-message {
    background: rgba(76, 217, 100, 0.1);
    border-left: 4px solid #4cd964;
    color: #4cd964;
}

/* === Выпадающее меню пользователя === */
.user-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(93, 93, 255, 0.3);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(93, 93, 255, 0.5);
}

.link-button {
    color: var(--primary-light);
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    display: inline;
}


.user-avatar img,
.user-avatar-initial {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
}

.username-display {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

.dropdown-arrow {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-menu-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 10px 0;
}

.user-menu-wrapper:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.user-dropdown a:hover {
    background: rgba(93, 93, 255, 0.05);
    color: var(--primary-light);
    transform: translateX(5px);
}

.user-dropdown a::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-dropdown a:hover::before {
    opacity: 1;
}

.admin-link {
    color: #ffd700 !important;
}

.admin-link:hover {
    color: #ffed4e !important;
    background: rgba(255, 215, 0, 0.05) !important;
}

/* === Адаптив для мобильных === */
@media (max-width: 600px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 1.6rem;
        margin-right: 12px;
    }

    .header-center {
        order: 2;
        width: auto;
        flex: 1;
        justify-content: center;
        gap: 8px;
        margin-top: 0;
        flex-wrap: wrap;
    }

    .func-link {
        font-size: 0.9rem;
        padding: 6px 8px;
        white-space: nowrap;
        min-width: max-content;
    }

    .header-right {
        display: flex;
        gap: 8px;
        align-items: center;
        flex: 0 0 auto;
    }

    .auth-btn {
        padding: 8px 14px;
        font-size: 0.95rem;
        border-radius: 8px;
        min-width: 75px;
        max-width: 130px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
    }

    .auth-btn:nth-child(2) {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    main {
        padding-top: 130px;
    }

    .main-content p {
        font-size: 1.1rem;
        padding-top: 90px;
        line-height: 1.5;
        margin: 0 16px;
    }

    
}