/* ============================================
   StalCraft Division Manager - Финальная версия
   ============================================ */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-color: #333333;
    --border-hover: #444444;
    --accent-primary: #3a8fb8;
    --accent-hover: #4cc9f0;
    --success: #2e7d32;
    --error: #c62828;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative; /* Для позиционирования сообщений */
}

/* ==================== КОНТЕЙНЕР ==================== */
.container {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
    position: relative;
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

/* ==================== ЗАГОЛОВКИ ==================== */
h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 32px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.25px;
}

#form-title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    height: 30px;
}

/* ==================== ОБЛАСТЬ ФОРМ ==================== */
#forms-container {
    flex: 1;
    position: relative;
    min-height: 350px;
}

/* ==================== ВСЕ ФОРМЫ ==================== */
#login-form,
#register-form,
#profile-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#login-form {
    opacity: 1;
    visibility: visible;
}

#register-form,
#profile-section {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ==================== ГРУППЫ ПОЛЕЙ ВВОДА ==================== */
.input-group {
    margin-bottom: 16px;
}

/* ==================== ПОЛЯ ВВОДА ==================== */
input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(58, 143, 184, 0.1);
}

/* ==================== КАСТОМНЫЙ SELECT (ФРАКЦИИ) ==================== */
.custom-select {
    position: relative;
    width: 100%;
}

.select-header {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
}

.select-header:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.05);
}

.select-arrow {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.custom-select.active .select-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.custom-select.active .select-options {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

.select-option {
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.select-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-hover);
}

/* ==================== КНОПКИ ==================== */
button:not(.flag-btn) {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
}

button:not(.flag-btn):hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

button.secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    color: var(--accent-hover);
}

/* ==================== ФЛАГИ ==================== */
.language-flags {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.flag-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.flag-btn:hover {
    border-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.1);
}

.flag-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.flag-btn.active {
    border-color: var(--accent-primary);
    background-color: rgba(58, 143, 184, 0.1);
}

/* ==================== ПРОФИЛЬ ==================== */
#profile-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    border-left: 3px solid var(--accent-primary);
}

/* ==================== СООБЩЕНИЯ (ВВЕРХУ ЭКРАНА) ==================== */
#message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 90%;
    max-width: 400px;
    padding: 14px 18px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    
    /* Анимация */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#message.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.message.success {
    background-color: rgba(46, 125, 50, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
    backdrop-filter: blur(10px);
}

.message.error {
    background-color: rgba(198, 40, 40, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
    backdrop-filter: blur(10px);
}