/* CSS переменные для динамических цветов фракций */
:root {
    --faction-primary: #9ca3af;
    --faction-secondary: #d1d5db;
    --faction-accent: #e5e7eb;
    --faction-gradient-start: #9ca3af;
    --faction-gradient-end: #d1d5db;
    --faction-shadow: rgba(156, 163, 175, 0.3);
    
    /* Темные версии для меню */
    --faction-primary-dark: #6b7280;
    --faction-secondary-dark: #9ca3af;
    --faction-border-dark: rgba(107, 114, 128, 0.4);
    --faction-border-hover: rgba(107, 114, 128, 0.6);
}

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--faction-gradient-start) 0%, var(--faction-gradient-end) 100%);
    color: #333;
    min-height: 100vh;
    transition: background 0.3s ease;
}

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

/* Заголовок */
.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.logo a {
    text-decoration: none;
    color: #fff;
    display: inline-block;
}

.logo-image {
    max-height: 180px;
    width: auto;
    height: auto;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.logo p {
    color: #ccc;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    gap: 15px;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    color: white;
    border: 2px solid white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 25px var(--faction-shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--faction-shadow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--faction-accent) 0%, var(--faction-primary) 100%);
    color: white;
    border: 2px solid var(--faction-secondary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px var(--faction-shadow);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--faction-shadow);
}

/* Стили для кнопки входа в админку */
.admin-access-section {
    text-align: center;
    margin: 30px 0;
}

.btn-admin-access {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    color: white;
    border: 3px solid var(--faction-accent);
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 30px var(--faction-shadow);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    justify-content: center;
}

.btn-admin-access:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px var(--faction-shadow);
    border-color: var(--faction-primary);
}

.btn-admin-access .btn-icon {
    font-size: 1.5rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Стили для статуса пользователя */
.user-status {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px var(--faction-shadow);
    border: 2px solid var(--faction-accent);
    display: inline-block;
    min-width: 120px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Главная страница */
.hero {
    text-align: center;
    padding: 60px 0;
    color: white;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #ccc;
}

.factions-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.faction-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.faction-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.faction-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.features {
    padding: 60px 0;
    background: rgba(255, 255, 255, 0.05);
    margin: 40px 0;
    border-radius: 15px;
}

.features h2 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: white;
}

.feature h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Формы аутентификации */
.auth-container {
    max-width: 550px;
    margin: 40px auto;
    background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(156, 163, 175, 0.3);
    transition: all 0.5s ease;
    position: relative;
    border: 2px solid #9ca3af;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-container p {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Специальные стили для лейблов "Фракция" и "Аватар" */
#label_faction,
#label_avatar {
    color: black !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) !important;
}

.form-group input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* Специальный стиль для поля пригласителя */
.form-group:has(#inviter) {
    margin-bottom: 0;
}

/* Отступ для следующего поля после карточки пригласителя */
.form-group:has(#inviter) + .form-group {
    margin-top: 20px;
}

.factions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

.faction-option {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    padding: 18px 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.faction-option:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.faction-option:hover::before {
    left: 100%;
}

.faction-option.selected {
    border-color: white;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.faction-option h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: white;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.faction-option p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    text-align: center;
}

.faction-option ul {
    list-style: none;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.faction-option li {
    margin-bottom: 4px;
    padding: 2px 0;
}

.loading-factions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.faction-avatar-register {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.faction-logo-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faction-icon-overlay {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.faction-icon-only {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 3px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Динамические стили для выбранной фракции */
.auth-container.faction-selected {
    background: linear-gradient(135deg, var(--faction-gradient-start) 0%, var(--faction-gradient-end) 100%);
    box-shadow: 0 20px 40px var(--faction-shadow);
    border: 2px solid var(--faction-primary);
}

.auth-container.faction-selected h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-container.faction-selected p {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-container.faction-selected .form-group label {
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-container.faction-selected .form-group input {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--faction-primary);
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-container.faction-selected .form-group input:focus {
    border-color: var(--faction-accent);
    box-shadow: 0 0 20px var(--faction-shadow);
    background: white;
}

.auth-container.faction-selected .btn-primary {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    border: 2px solid white;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 25px var(--faction-shadow);
}

.auth-container.faction-selected .btn-primary:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--faction-shadow);
}

.auth-container.faction-selected .form-links a {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.auth-container.faction-selected .form-links a:hover {
    color: var(--faction-accent);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Дополнительные эффекты для выбранной фракции */
.auth-container.faction-selected::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--faction-primary), var(--faction-secondary), var(--faction-accent), var(--faction-primary));
    border-radius: 17px;
    z-index: -1;
    animation: factionGlow 3s ease-in-out infinite;
}

@keyframes factionGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.auth-container.faction-selected .factions-grid {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.auth-container.faction-selected .faction-option {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.auth-container.faction-selected .faction-option:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-8px);
}

.auth-container.faction-selected .faction-option.selected {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* Адаптивность для фракций */
@media (max-width: 768px) {
    .factions-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .auth-container {
        margin: 20px auto;
        padding: 30px 20px;
    }
}

.form-links {
    text-align: center;
    margin-top: 20px;
}

.form-links a {
    color: white;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.form-links a:hover {
    color: #adb5bd;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Сообщения */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    border: 1px solid #ffcdd2;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    border: 1px solid #c8e6c9;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Аккаунт */
.account-container {
    max-width: 900px;
    margin: 40px auto;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 50%, 
        rgba(255, 255, 255, 0.95) 100%);
    padding: 50px;
    border-radius: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.account-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--faction-gradient-start) 0%, 
        var(--faction-secondary) 50%, 
        var(--faction-gradient-end) 100%);
    opacity: 0.1;
    z-index: 1;
}

.account-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 70%);
    animation: shimmer 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(180deg); }
}

.account-container > * {
    position: relative;
    z-index: 2;
}

.account-container h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #1a202c;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, 
        var(--faction-header-primary, var(--faction-primary)) 0%, 
        var(--faction-header-secondary, var(--faction-secondary)) 50%, 
        var(--faction-header-primary, var(--faction-primary)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
    padding: 35px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 250, 252, 0.8) 50%, 
        rgba(255, 255, 255, 0.9) 100%);
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.08),
        0 5px 15px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.user-info:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.12),
        0 10px 25px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--faction-gradient-start) 0%, 
        var(--faction-secondary) 50%, 
        var(--faction-gradient-end) 100%);
    opacity: 0.05;
    z-index: 1;
}

.user-info > * {
    position: relative;
    z-index: 2;
}

.user-avatar {
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.avatar-placeholder {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, 
        var(--faction-gradient-start) 0%, 
        var(--faction-secondary) 50%, 
        var(--faction-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    color: white;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.avatar-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.2) 0%, 
        transparent 70%);
    animation: avatarShimmer 6s ease-in-out infinite;
}

@keyframes avatarShimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(180deg); }
}

/* Аватарка фракции в углу */
.faction-avatar-overlay {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 5px solid white;
    overflow: hidden;
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.faction-avatar-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Аватарка подфракции (клана) рядом с аватаркой фракции */
.clan-avatar-overlay {
    position: absolute;
    top: 45px;
    right: -18px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.clan-avatar-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details h2 {
    margin-bottom: 8px;
    color: #1a202c;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-details h3 {
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-email {
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.faction-badge {
    display: inline-block;
    background: linear-gradient(135deg, 
        var(--faction-primary) 0%, 
        var(--faction-secondary) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Специальный стиль для фракции с кланом */
.faction-badge.with-clan {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.faction-badge:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.15);
}

.faction-description {
    display: inline-block;
    background: linear-gradient(135deg, 
        var(--faction-primary) 0%, 
        var(--faction-secondary) 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-style: italic;
    line-height: 1.3;
    max-width: 100%;
    word-wrap: break-word;
}

.faction-description:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 3px 8px rgba(0, 0, 0, 0.1);
}


/* Стили для секций с дизайном фракций */
.additional-info-section,
.messengers-section {
    background: linear-gradient(135deg, 
        var(--faction-primary) 0%, 
        var(--faction-secondary) 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.additional-info-section::before,
.messengers-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.section-header {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.section-header h3,
.section-header h4 {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h4 {
    font-size: 1.1rem;
}

.section-content {
    position: relative;
    z-index: 1;
}

/* Стили для секции мессенджеров внутри формы профиля */
.messengers-section {
    margin-top: 20px;
}

.messengers-section .form-group label {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.messengers-main {
    margin-bottom: 20px;
}

.messengers-additional {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
    margin-top: 20px;
}

.additional-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.additional-header h5 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.additional-messengers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.messenger-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.messenger-field .form-group {
    flex: 1;
    margin-bottom: 0;
}

.messenger-field .form-group:first-child {
    flex: 0 0 200px;
}

/* Контейнер для полей формы */
.messenger-field .form-fields {
    display: flex;
    gap: 10px;
    align-items: end;
}

/* Кнопка удаления под формой */
.messenger-field .remove-messenger-btn {
    align-self: flex-end;
    margin-top: 5px;
}

.messenger-field .form-group label {
    color: #333 !important;
    text-shadow: none !important;
}

/* Стили для реферальной секции */
.referral-section {
    background: linear-gradient(135deg, var(--faction-primary, #667eea), var(--faction-secondary, #764ba2));
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.referral-section .section-header {
    text-align: center;
    margin-bottom: 15px;
}

.referral-section .section-header h4 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.referral-link-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.referral-link-display {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.referral-link-display input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
    color: #333;
    font-family: 'Courier New', monospace;
}

.referral-link-display input:focus {
    outline: none;
    border-color: var(--faction-primary, #667eea);
    background: #fff;
}

.copy-btn {
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    color: white;
    border: 2px solid var(--faction-accent);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px var(--faction-shadow);
}

.copy-btn:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--faction-shadow);
    border-color: var(--faction-primary);
}

.copy-btn:active {
    transform: translateY(0);
}

.referral-description {
    color: #666;
    font-size: 13px;
    margin: 0;
    font-style: italic;
    text-align: center;
}

.remove-messenger-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-messenger-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.registration-date {
    color: #4a5568;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.account-sections {
    display: grid;
    gap: 30px;
}

.section {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 50%, 
        rgba(255, 255, 255, 0.95) 100%);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.08),
        0 5px 15px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 20px 45px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--faction-gradient-start) 0%, 
        var(--faction-secondary) 50%, 
        var(--faction-gradient-end) 100%);
    opacity: 0.03;
    z-index: 1;
}

.section > * {
    position: relative;
    z-index: 2;
}

.section h3 {
    margin-bottom: 25px;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, 
        var(--faction-header-primary, var(--faction-primary)) 0%, 
        var(--faction-header-secondary, var(--faction-secondary)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.referral-code {
    margin-bottom: 20px;
}

.code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.code-display span {
    background: white;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: monospace;
    font-weight: 600;
}

.matrix-level {
    margin-bottom: 20px;
}

.matrix-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    transition: width 0.3s ease;
}

.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Футер */
.footer {
    text-align: center;
    padding: 40px 0;
    color: #ccc;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .factions-preview {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px;
    }
    
    .avatar-placeholder {
        width: 150px;
        height: 150px;
        font-size: 3.5rem;
    }
    
    .user-details h2 {
        font-size: 1.5rem;
    }
    
    .user-details h3 {
        font-size: 1.1rem;
    }
    
    .faction-badge {
        font-size: 0.9rem;
        padding: 6px 16px;
    }
    
    .account-container {
        margin: 20px auto;
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .account-container h1 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .section {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .section h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .profile-edit-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        justify-content: center;
    }
}

/* Стили для кнопки редактирования профиля */
.profile-actions {
    margin-top: 15px;
}

.profile-edit-btn {
    background: linear-gradient(135deg, 
        var(--faction-primary) 0%, 
        var(--faction-secondary) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 18px 35px;
    border-radius: 15px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 3px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.profile-edit-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: left 0.5s ease;
}

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

.profile-edit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, 
        var(--faction-secondary) 0%, 
        var(--faction-primary) 100%);
}

.profile-edit-btn .btn-icon {
    font-size: 1.2rem;
}

/* Стили для формы редактирования профиля */
.profile-edit-container {
    margin-top: 25px;
    animation: slideDown 0.3s ease-out;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(156, 163, 175, 0.3) 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(156, 163, 175, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 2px solid #d1d5db;
}

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

.profile-form {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(156, 163, 175, 0.3) 100%);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(156, 163, 175, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 2px solid #d1d5db;
}

/* Стили для выпадающего списка фракций с аватарами */
.faction-select {
    position: relative;
}

.faction-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.faction-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

.faction-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.faction-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.faction-name {
    font-weight: 500;
    color: #333;
}

/* Общие стили для всех select элементов */
select {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select option {
    padding: 10px;
    background: white;
    color: #333;
}

/* Кастомный select для фракций */
select[name="faction"] {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

select[name="faction"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select[name="faction"] option {
    padding: 10px;
    background: white;
    color: #333;
}

.form-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid rgba(0,0,0,0.1);
}

.form-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar-section {
    margin-bottom: 25px;
}

.avatar-container {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 10px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e9ecef;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.avatar-icon {
    font-size: 2.5rem;
    color: white;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 180px;
    max-height: 180px;
    border-radius: 50%;
}

.avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-info {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0;
}

.inviter-info {
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    color: #495057;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(0,0,0,0.1);
}

/* Динамическая цветовая схема для фракций - используем CSS переменные */
.profile-form,
.profile-edit-container {
    border: 3px solid var(--faction-primary);
    box-shadow: 0 8px 25px var(--faction-shadow);
}

/* Стили для кнопки "Дополнительно" */
.additional-section {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.additional-btn {
    background: linear-gradient(135deg, var(--faction-accent) 0%, var(--faction-primary) 100%);
    border: 2px solid var(--faction-secondary);
    padding: 12px 25px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px var(--faction-shadow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.additional-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--faction-shadow);
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-accent) 100%);
}

.additional-btn .btn-icon {
    font-size: 1.1rem;
}

/* Стили для дополнительных разделов */
.additional-sections {
    margin-top: 25px;
    animation: slideDown 0.3s ease-out;
}

.additional-sections .section {
    margin-bottom: 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.9) 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Стили для клона пригласителя */
.inviter-info {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.inviter-clone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 250, 252, 0.8) 50%, 
        rgba(255, 255, 255, 0.9) 100%);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.08),
        0 3px 10px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.inviter-clone:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.inviter-avatar {
    flex-shrink: 0;
    position: relative;
}

.inviter-avatar-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, 
        var(--faction-gradient-start) 0%, 
        var(--faction-secondary) 50%, 
        var(--faction-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.inviter-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Стили для отображения ФИО и логина пригласителя */
.inviter-fullname {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 4px;
}

.inviter-username {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

/* Аватарка фракции пригласителя в углу */
.inviter-faction-avatar-overlay {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.inviter-faction-avatar-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inviter-details {
    flex: 1;
}

.inviter-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.inviter-email {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.inviter-faction-badge {
    display: inline-block;
    background: linear-gradient(135deg, 
        var(--inviter-faction-primary, #9ca3af) 0%, 
        var(--inviter-faction-secondary, #6b7280) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    max-width: 100%;
    word-wrap: break-word;
}

.inviter-faction-badge:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Дополнительная адаптивность для формы профиля */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .inviter-clone {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 12px;
    }
    
    .inviter-avatar-placeholder,
    .inviter-avatar img {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .inviter-name {
        font-size: 1rem;
    }
    
    .inviter-faction {
        font-size: 0.8rem;
    }
    
    .avatar-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .profile-form {
        padding: 20px;
    }
    
    .additional-section {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .additional-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Стили для карточки пригласителя */
.inviter-card {
    position: relative;
    margin-top: 15px;
    animation: cardSlideIn 0.3s ease-out;
}

.inviter-card-content {
    background: linear-gradient(135deg, var(--inviter-faction-primary, #667eea), var(--inviter-faction-secondary, #764ba2));
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 400px;
}

.inviter-avatar-section {
    flex-shrink: 0;
}

.inviter-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.inviter-avatar .avatar-placeholder {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
}

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

.inviter-avatar .inviter-faction-avatar-overlay {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.inviter-avatar .inviter-faction-avatar-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inviter-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
}

.inviter-name {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: none;
    margin: 0;
}

.inviter-username {
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: none;
    margin: 0;
}

.inviter-email {
    color: #666;
    font-size: 0.85rem;
    font-weight: 400;
    text-shadow: none;
    margin: 0;
}

.inviter-faction-badge {
    background: linear-gradient(135deg, var(--inviter-faction-primary, #667eea), var(--inviter-faction-secondary, #764ba2));
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 5px;
    display: inline-block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Анимация появления карточки */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для карточки */
@media (max-width: 768px) {
    .inviter-card-content {
        padding: 15px;
        gap: 15px;
        max-width: 350px;
    }
    
    .inviter-avatar {
        width: 70px;
        height: 70px;
    }
    
    .inviter-avatar .avatar-placeholder {
        font-size: 2rem;
    }
    
    .inviter-avatar .inviter-faction-avatar-overlay {
        width: 25px;
        height: 25px;
        top: -4px;
        right: -4px;
    }
    
    .inviter-name {
        font-size: 1rem;
    }
    
    .inviter-username {
        font-size: 0.85rem;
    }
    
    .inviter-info {
        text-align: center;
    }
    
    .inviter-email {
        font-size: 0.8rem;
    }
}

/* ===== МНОГОУРОВНЕВОЕ МЕНЮ ===== */

/* Основная навигация */
.main-navigation {
    width: 100%;
    margin-top: 20px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px var(--faction-shadow);
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.nav-menu > li > a:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--faction-shadow);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Подменю */
.nav-menu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--faction-primary);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 10px 0;
}

.nav-menu li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .submenu li {
    display: block;
    margin: 0;
}

.nav-menu .submenu a {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
    transition: all 0.2s ease;
    text-align: left;
    min-width: auto;
}

.nav-menu .submenu a:hover {
    background: var(--faction-primary);
    color: white;
    transform: none;
    box-shadow: none;
    border: none;
}

/* Единый цвет для всех пунктов меню первого уровня (цвет фракции пользователя) */
.nav-menu > li > a {
    background: linear-gradient(135deg, var(--faction-primary-dark) 0%, var(--faction-secondary-dark) 100%) !important;
    border-color: var(--faction-border-dark) !important;
}

.nav-menu > li > a:hover {
    background: linear-gradient(135deg, var(--faction-secondary-dark) 0%, var(--faction-primary-dark) 100%) !important;
    border-color: var(--faction-border-hover) !important;
}

/* Стили для родительских пунктов меню (с подпунктами) */
.nav-menu > li > a.menu-parent {
    cursor: default;
    position: relative;
}

.nav-menu > li > a.menu-parent::after {
    content: " ▼";
    font-size: 0.8em;
    opacity: 0.7;
}

.nav-menu > li > a.menu-parent:hover {
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .nav-menu > li > a {
        min-width: 200px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .nav-menu .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.8);
        margin-top: 5px;
        border-radius: 5px;
    }
    
    .nav-menu li:hover .submenu {
        transform: none;
    }
}

/* Стили для навигационных ссылок */
.nav-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--faction-primary) 0%, var(--faction-secondary) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px var(--faction-shadow);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.nav-link:hover {
    background: linear-gradient(135deg, var(--faction-secondary) 0%, var(--faction-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--faction-shadow);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Стили для статусов финансовых заявок */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-cancelled {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Стили для ссылок на скриншоты */
.screenshot-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
}

.screenshot-link:hover {
    background: rgba(0, 123, 255, 0.2);
    color: #0056b3;
    text-decoration: none;
}

.status-unknown {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Стили для модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-actions {
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

.modal-actions .btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.request-details p {
    margin: 15px 0;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.request-details p:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.request-details p:last-child {
    border-bottom: none;
}

.request-details strong {
    color: #2c3e50;
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
    margin-right: 10px;
}

.request-details h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

/* Анимация появления модального окна */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .request-details {
        padding: 20px;
    }
    
    .request-details h3 {
        font-size: 20px;
    }
    
    .request-details strong {
        min-width: 120px;
        font-size: 14px;
    }
    
    .modal-actions {
        padding: 15px 20px;
    }
}

/* Стили для кнопок действий */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Фильтры */
.filter-controls {
    margin-left: 20px;
}

.filter-controls select {
    padding: 8px 12px;
    border: 2px solid var(--faction-primary);
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
} 