
@import url('global/loader.css');
@import url('avatar-defaults.css');
/* ---------- ПЕРЕМЕННЫЕ ТЕМ ---------- */
:root {
    --bg-body: #0a0e1a;
    --bg-header: rgba(10, 14, 26, 0.95);
    --bg-hero: #0e1322;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-card: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: #b8d4e3;
    --text-muted: #b8d4e3;
    --text-input: #ffffff;
    --bg-input: rgba(255, 255, 255, 0.05);
    --border-input: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.4);
    --footer-border: rgba(255, 255, 255, 0.04);
    --footer-text: #4a5568;
    --login-bg: rgba(10, 14, 26, 0.6);
    --btn-theme-bg: rgba(255, 255, 255, 0.06);
    --btn-theme-border: rgba(255, 255, 255, 0.1);
    --btn-theme-hover: rgba(124, 92, 252, 0.25);
    --accent-primary: #7c5cfc;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(124, 92, 252, 0.3);
}

[data-theme="light"] {
    --bg-body: #f4f5f7;
    --bg-header: rgba(255, 255, 255, 0.92);
    --bg-hero: #eef0f3;
    --bg-card: #ffffff;
    --border-card: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-input: #111827;
    --bg-input: #f3f4f6;
    --border-input: rgba(0, 0, 0, 0.08);
    --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 10px 28px rgba(17, 24, 39, 0.06);
    --footer-border: rgba(0, 0, 0, 0.08);
    --footer-text: #9ca3af;
    --login-bg: rgba(255, 255, 255, 0.72);
    --btn-theme-bg: #ffffff;
    --btn-theme-border: rgba(0, 0, 0, 0.08);
    --btn-theme-hover: rgba(124, 92, 252, 0.12);
    --accent-primary: #7c5cfc;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(124, 92, 252, 0.18);
}

/* ===== КОМПОНЕНТЫ ===== */
@import url('components/upload.css');
@import url('components/polls.css');
@import url('components/documents.css');

/* ---------- ОБНУЛЕНИЕ ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html.fw-spa-hold .main-content {
    opacity: 0 !important;
    pointer-events: none;
}
html:has(#fw-music-dock:not([hidden])) .app-container {
    padding-bottom: 88px;
}
@media (max-width: 768px) {
    html:has(#fw-music-dock:not([hidden])) .app-container {
        padding-bottom: calc(88px + 72px + env(safe-area-inset-bottom, 0px));
    }
}
html { background: var(--bg-body, #0a0e1a); }
#fw-nav-veil {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #0a0e1a;
    pointer-events: none;
}
#fw-music-dock {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    z-index: 400;
    pointer-events: auto;
    display: grid;
    grid-template-columns: 48px auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 720px;
    min-height: 64px;
    padding: 10px 12px 8px;
    border-radius: 18px;
    background: rgba(18, 22, 36, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}
#fw-music-dock[hidden] { display: none !important; }
#fw-music-dock:not([hidden]) { display: grid !important; }
#fw-music-dock svg { display: block; }
#fw-music-dock .fw-md-cover {
    grid-row: 1;
    grid-column: 1;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, #7c5cfc, #a78bfa);
}
#fw-music-dock .fw-md-info {
    grid-row: 1;
    grid-column: 3;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 0 4px;
    background: transparent;
    text-align: left;
    min-height: 44px;
    border: 0;
    color: inherit;
    cursor: pointer;
}
#fw-music-dock .fw-md-ctrls {
    grid-row: 1;
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}
#fw-music-dock button,
#fw-music-sheet button {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
}
#fw-music-dock .fw-md-play,
#fw-music-sheet .fw-ms-play {
    background: #7c5cfc;
    box-shadow: 0 6px 16px rgba(124, 92, 252, 0.35);
}
#fw-music-dock .fw-md-prev,
#fw-music-dock .fw-md-next {
    background: rgba(255, 255, 255, 0.06);
}
#fw-music-dock .fw-md-title,
#fw-music-dock .fw-md-sub {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#fw-music-dock .fw-md-title { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
#fw-music-dock .fw-md-sub { font-size: 12px; color: #b8d4e3; }
#fw-music-dock .fw-md-seek {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
    height: 4px;
    margin: 2px 0 0;
    accent-color: #7c5cfc;
}
[data-theme="light"] #fw-music-dock {
    background: rgba(255, 255, 255, 0.94);
    color: #111827;
    border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] #fw-music-dock .fw-md-sub { color: #6b7280; }
[data-theme="light"] #fw-music-dock .fw-md-prev,
[data-theme="light"] #fw-music-dock .fw-md-next {
    background: #eef2ff;
    color: #111827;
}
@media (max-width: 768px) {
    #fw-music-dock {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 16px);
        max-width: none;
        border-radius: 16px;
        grid-template-columns: 44px auto 1fr;
    }
    #fw-music-dock .fw-md-seek { display: none; }
}
#fw-music-sheet {
    position: fixed;
    inset: 0;
    z-index: 420;
    background: rgba(6, 8, 16, 0.62);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
#fw-music-sheet[hidden] { display: none !important; }
#fw-music-sheet .fw-ms-card {
    width: 100%;
    max-width: 440px;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: #161b27;
    color: #fff;
    position: relative;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.4);
}
#fw-music-sheet .fw-ms-cover {
    display: block;
    width: 160px;
    height: 160px;
    margin: 8px auto 16px;
    border-radius: 16px;
    object-fit: cover;
    background: linear-gradient(135deg, #7c5cfc, #a78bfa);
    box-shadow: 0 16px 40px rgba(124, 92, 252, 0.28);
}
#fw-music-sheet .fw-ms-close {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.06);
}
#fw-music-sheet .fw-ms-title {
    margin: 0 48px 4px 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
#fw-music-sheet .fw-ms-artist,
#fw-music-sheet .fw-ms-album {
    color: #a78bfa;
    text-decoration: none;
    min-height: 44px;
    display: flex;
    align-items: center;
}
#fw-music-sheet .fw-ms-seek { width: 100%; margin: 12px 0 6px; accent-color: #7c5cfc; }
#fw-music-sheet .fw-ms-time {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #b8d4e3;
    margin-bottom: 12px;
}
#fw-music-sheet .fw-ms-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
#fw-msg-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 320;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 14px;
    background: #14182a;
    border: 1px solid rgba(124, 92, 252, 0.4);
    color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    text-decoration: none;
}
#fw-msg-toast[hidden] { display: none !important; }
#fw-msg-toast strong { display: block; font-size: 13px; margin-bottom: 4px; }
#fw-msg-toast span { display: block; font-size: 13px; color: #b8d4e3; }
@media (max-width: 768px) {
    #fw-msg-toast { display: none !important; }
}
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    * {
        scrollbar-width: none !important;
    }
    *::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
        display: none !important;
        background: transparent !important;
    }
}
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ---------- ШАПКА ---------- */
.header {
    padding: 16px 50px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-card);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #0a0e1a;
    letter-spacing: -1px;
    box-shadow: none;
    animation: none;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 2px;
    transition: color 0.4s ease;
}

/* ---------- ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ---------- */
.theme-toggle {
    background: var(--btn-theme-bg);
    border: 1px solid var(--btn-theme-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: scale(1.08);
    border-color: var(--accent-primary);
    background: var(--btn-theme-hover);
    box-shadow: 0 0 30px var(--accent-glow);
}

.theme-icon {
    line-height: 1;
    transition: transform 0.4s ease;
}

/* ---------- ОСНОВНАЯ ЧАСТЬ ---------- */
.main {
    flex: 1;
    display: flex;
    margin-top: 80px;
    min-height: calc(100vh - 80px - 60px);
}

/* ---------- ЦЕНТР: КАРТИНКА ---------- */
.hero-section {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-hero);
    transition: background 0.4s ease;
}

.hero-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-hero);
    transition: background 0.4s ease;
}

.hero-image,
.hero-image-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    display: block;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.hero-image {
    z-index: 1;
    pointer-events: auto;
    opacity: 0;
}

.hero-image-overlay {
    z-index: 2;
    pointer-events: none;
    opacity: 0;
}

.hero-image-wrapper.loaded .hero-image {
    opacity: 1;
}

.hero-image:-moz-broken,
.hero-image:broken,
.hero-image[src=""],
.hero-image[src="#"] {
    opacity: 0 !important;
}

.hero-tagline {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 12px 20px;
    font-size: 20px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-align: center;
    animation: glowPulse 2.5s ease-in-out infinite;
    line-height: 1.6;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.3) 40%, rgba(10, 14, 26, 0.6) 100%);
    border-radius: 0 0 12px 12px;
}

.hero-tagline strong {
    font-weight: 700;
    font-size: 1.4em;
    display: block;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(124, 92, 252, 0.5);
}

.hero-tagline span {
    font-weight: 300;
    font-size: 0.85em;
    opacity: 0.9;
    letter-spacing: 2px;
    display: block;
    margin-top: 2px;
}

[data-theme="light"] .hero-tagline {
    animation: glowPulseLight 2.5s ease-in-out infinite;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.2) 40%, rgba(255, 255, 255, 0.5) 100%);
}

@keyframes glowPulse {
    0% {
        text-shadow: 0 0 10px rgba(124, 92, 252, 0.3),
                     0 0 20px rgba(124, 92, 252, 0.15),
                     0 0 40px rgba(124, 92, 252, 0.08);
        color: #b8d4e3;
    }
    50% {
        text-shadow: 0 0 20px rgba(124, 92, 252, 0.8),
                     0 0 40px rgba(124, 92, 252, 0.5),
                     0 0 80px rgba(124, 92, 252, 0.3),
                     0 0 120px rgba(124, 92, 252, 0.15);
        color: #d4c4ff;
    }
    100% {
        text-shadow: 0 0 10px rgba(124, 92, 252, 0.3),
                     0 0 20px rgba(124, 92, 252, 0.15),
                     0 0 40px rgba(124, 92, 252, 0.08);
        color: #b8d4e3;
    }
}

@keyframes glowPulseLight {
    0% {
        text-shadow: 0 0 10px rgba(124, 92, 252, 0.2),
                     0 0 20px rgba(124, 92, 252, 0.1);
        color: #4a5568;
    }
    50% {
        text-shadow: 0 0 20px rgba(124, 92, 252, 0.6),
                     0 0 40px rgba(124, 92, 252, 0.35),
                     0 0 80px rgba(124, 92, 252, 0.15);
        color: #5b21b6;
    }
    100% {
        text-shadow: 0 0 10px rgba(124, 92, 252, 0.2),
                     0 0 20px rgba(124, 92, 252, 0.1);
        color: #4a5568;
    }
}

/* ---------- ПРАВАЯ ЧАСТЬ: ВХОД ---------- */
.login-section {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--login-bg);
    backdrop-filter: blur(10px);
    transition: background 0.4s ease;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 44px 36px;
    box-shadow: var(--shadow-card);
    transition: all 0.4s ease;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.4s ease;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
    transition: color 0.4s ease;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.login-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]) {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 12px;
    color: var(--text-input);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.login-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]):focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
}

.login-form input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"])::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 24px 0;
    font-size: 14px;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    transition: color 0.4s ease;
}

.remember-me input[type="checkbox"] {
    -webkit-appearance: checkbox;
    appearance: auto;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.forgot-password {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--accent-primary);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--accent-glow);
}

.register-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.4s ease;
}

.register-link a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: var(--accent-secondary);
}

/* ---------- ПОДВАЛ ---------- */
.footer {
    padding: 20px 50px;
    text-align: center;
    border-top: 1px solid var(--footer-border);
    background: var(--bg-header);
    transition: all 0.4s ease;
}

.footer p {
    color: var(--footer-text);
    font-size: 13px;
    letter-spacing: 3px;
    transition: color 0.4s ease;
}

.footer .copyright {
    font-size: 11px;
    vertical-align: super;
    margin: 0 2px;
}

/* ---------- АДАПТИВНОСТЬ (ОБЩАЯ) ---------- */
@media (max-width: 992px) {
    .main {
        flex-direction: column;
        margin-top: 72px;
    }

    .hero-section {
        padding: 30px 20px;
        min-height: 300px;
    }

    .hero-image-wrapper {
        max-width: 400px;
        margin: 0 auto;
    }

    .login-section {
        padding: 30px 20px;
    }

    .login-box {
        padding: 32px 24px;
        max-width: 100%;
    }

    .header {
        padding: 12px 24px;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .footer {
        padding: 16px 24px;
    }

    .hero-tagline {
        font-size: 16px;
        bottom: 12px;
        padding: 8px 16px;
    }

    .hero-tagline strong {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .hero-image-wrapper {
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-tagline {
        font-size: 13px;
        bottom: 8px;
        padding: 6px 12px;
        letter-spacing: 1px;
    }

    .hero-tagline strong {
        font-size: 1.1em;
        letter-spacing: 2px;
    }

    .hero-tagline span {
        font-size: 0.8em;
    }

    .login-title {
        font-size: 24px;
    }

    .login-box {
        padding: 24px 18px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header {
        padding: 10px 16px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .logo-text {
        font-size: 15px;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .hero-section {
        min-height: 220px;
        padding: 20px;
    }
}