
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    color: #3b82f6;
    text-decoration: none;
    background-color: transparent;
    -webkit-text-decoration-skip: objects;
}

ol {
    list-style-position: inside;
    margin: 0;
    padding: 0;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
    background-color: rgb(255 255 255 / 2%);
}

::-webkit-scrollbar-track {
    background-color: #2e3a4a;
    border-radius: 10px;
}

::-webkit-scrollbar-track:hover {
    background-color: #465870;
}

::-webkit-scrollbar-thumb {
    background-color: rgb(59 130 246 / 50%);
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #3b82f6;
}

button,
input,
optgroup,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    outline: none;
    -webkit-box-shadow: none;
    box-shadow: none;
    border: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    background-color: inherit;
}

svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    contain: layout style;
    max-width: 100%;
    height: auto;
}

button,
a,
.clickable {
    transform: translateZ(0);
    backface-visibility: hidden;
}

* {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

:root {
    --accent: #3b82f6;
    --accent-weak: rgba(59, 130, 246, .12);
    --accent-strong: rgba(59, 130, 246, .22);
}

body.theme-dark {
    --accent: #3b82f6;
    --accent-weak: rgba(59, 130, 246, .18);
    --accent-strong: rgba(59, 130, 246, .28);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

body.theme-dark {
    background: #1a1a1a;
    color: #e6edf3;
}

.container {
    width: 100%;
    margin: 0;
    background: white;
    min-height: 100vh;
}

.logo-img--sun {
    display: none;
}

.logo-img--moon {
    display: block;
}

body.theme-dark .logo-img--sun {
    display: block;
}

body.theme-dark .logo-img--moon {
    display: none;
}

body.theme-dark .logo-img--sun {
    filter: brightness(0) invert(1);
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-left: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.auth-btn {
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer !important;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.auth-btn img {
    filter: brightness(0) saturate(100%);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.auth-btn:hover img {
    opacity: 1;
}

.auth-btn:hover {
    background: #d5dbdb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.auth-btn:active {
    transform: translateY(0);
    background: #bdc3c7;
}

.auth-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5rem;
    padding: 15px 0;
    flex: 1;
}

section {
    width: 100%;
}

.user-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 400px;
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    transition: all 0.1s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.user-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.user-details p {
    color: #6c757d;
    margin-bottom: 0.8rem;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.1s ease;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    contain: layout style paint;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.1s ease;
    margin: auto;
    border: none;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    color: #333;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #e9ecef;
}

body.theme-dark .modal-header {
    border-bottom-color: #3a3f46;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

body.theme-dark .modal-header h3 {
    color: #e6edf3;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
    transform: scale(1.1);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.tab {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.tab.active {
    color: white;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.1s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 2.5rem;
}

.auth-form h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.auth-form .description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-group label {
    display: flex;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-dark .form-group label {
    color: #e6edf3;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.1s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.submit-btn {
    width: 100%;
    background: #333;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.1s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #555;
}

.submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .site-title {
        margin-left: 0;
        text-align: center;
    }

    .auth-buttons {
        width: 100%;
        justify-content: center;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

.message.info {
    background: #17a2b8;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

body.theme-dark .checkbox-label {
    background: #22262c;
    border-color: #3a3f46;
}

.checkbox-label:hover {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid #667eea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.1s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background: #333;
    border-color: #333;
    transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.privacy-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.1s ease;
}

.privacy-link:hover {
    color: #5a6fd8;
    border-bottom-color: #5a6fd8;
    text-decoration: none;
}

.privacy-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 2px;
}

.privacy-text {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.privacy-text::-webkit-scrollbar {
    width: 6px;
}

.privacy-text::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.privacy-text::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.privacy-text::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

@keyframes successGlow {
    0% {
        background: #333;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    100% {
        background: #28a745;
        box-shadow: 0 0 20px 5px rgba(40, 167, 69, 0.8);
    }
}

@keyframes errorGlow {
    0% {
        background: #333;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    100% {
        background: #ef4444;
        box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.8);
    }
}

.code-input.error-animation {
    border-color: #ef4444;
    background: #ef4444;
    color: white;
    animation: errorGlow 0.3s ease-in-out;
}

.user-profile {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.profile-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    background: #333;
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.1s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.profile-info {
    padding: 40px 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.profile-avatar {
    margin-bottom: 20px;
}

.avatar-circle {
    width: 100px;
    height: 100px;
    background: #333;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-details h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.profile-email {
    color: #666;
    font-size: 1.1rem;
    margin: 0 0 15px 0;
}

.profile-status {
    color: #28a745;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.profile-actions {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
}

.action-btn:hover {
    border-color: #333;
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.action-btn span {
    font-size: 1.5rem;
}

.user-menu {
    position: relative;
}

.menu-close-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: #666;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: scale(1.1);
}

body.theme-dark .menu-close-btn {
    color: #8b949e;
}

body.theme-dark .menu-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
}

.menu-dots {
    font-size: 1.5rem;
    line-height: 1;
    transform: rotate(90deg);
}

.menu-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgb(255 255 255 / 20%);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
    width: 400px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.08s ease, opacity 0.08s ease, visibility 0s linear 0.08s;
    border-left: 2px solid #333;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    contain: layout style paint;
    overflow: hidden;
}

.menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.menu-items {
    flex: 1;
    overflow-y: auto;
    contain: layout style;

}

.menu-footer {
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.menu-item {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgb(0 0 0 / 10%);
    font-size: 1.1rem;
    min-height: 64px;
    font-weight: 500;
    color: #000;
    width: 100%;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-icon {
    font-size: 1.4rem;
    width: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 28px;
    height: 28px;
    filter: brightness(0) saturate(100%);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.menu-item:hover .menu-icon svg {
    opacity: 1;
}

.menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.menu-header {
    padding: 32px 24px;
    position: relative;
    background: transparent;
    border-bottom: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-header .user-info {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    max-width: none;
    text-align: left;
}

.user-avatar-small {
    width: 50px;
    height: 50px;
    background: #333;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.user-avatar-small:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.avatar-picker {
    display: none;
    padding: 10px 8px 14px;
    position: absolute;
    left: 60px;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.avatar-picker.show {
    display: block;
}

body.theme-dark .avatar-picker {
    background: rgba(31, 35, 41, 0.95);
    border-color: #3a3f46;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 48px);
    gap: 10px;
}

.avatar-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.avatar-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
    border-color: var(--accent);
}

body.theme-dark .avatar-option {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

.theme-toggle-btn {
    margin-left: 8px;
    background: #fff;
    border: 1px solid var(--accent);
    color: #333;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 0 0 0 var(--accent-weak);
    transition: background .2s ease, transform .1s ease, box-shadow .2s ease, border-color .2s ease;
}

.theme-toggle-btn:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12), 0 0 0 4px var(--accent-weak);
}

.theme-toggle-btn:active {
    transform: scale(.96);
}

.theme-toggle-btn .toggle-icon {
    display: none;
    vertical-align: middle;
}

.theme-toggle-btn .toggle-icon--moon {
    display: inline-block;
}

body.theme-dark .theme-toggle-btn .toggle-icon--moon {
    display: none;
}

body.theme-dark .theme-toggle-btn .toggle-icon--sun {
    display: inline-block;
}

body.theme-dark {
    background: #1f2329;
    color: #e6edf3;
}

body.theme-dark {
    background: url(../images/fnt3y68mlz711.png) fixed center/cover;
    color: #e6edf3;
    position: relative;
}

body.theme-dark::before {
    content: '';
    position: absolute;
    background: #1f232982;
    inset: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(3px);
    z-index: -1;
}

body.theme-dark .menu-dropdown {
    background: rgb(34 38 44 / 21%);
    border-color: rgb(58 63 70 / 20%);
    backdrop-filter: blur(10px);
}

body.theme-dark .menu-header {
    background: rgb(34 38 44 / 80%);
    border-color: #3a3f46;
}

body.theme-dark .greeting-text,
body.theme-dark .user-name {
    color: #ffffff;
}

body.theme-dark .menu-item {
    color: #e6edf3;
}

body.theme-dark .menu-item:hover {
    background: rgba(255, 255, 255, .08);
}

body.theme-dark .auth-btn {
    background: #2f353d;
    color: #e6edf3;
}

body.theme-dark .auth-btn.register {
    background: #3b82f6;
    color: #fff;
}

body.theme-dark .test-link {
    background: #2f353d;
    color: #e6edf3;
}

body.theme-dark .modal .modal-content {
    background: #22262c;
    border-color: #3a3f46;
}

body.theme-dark input,
body.theme-dark .form-group input,
body.theme-dark select,
body.theme-dark textarea {
    background: #1f2329;
    color: #e6edf3;
    border-color: #3a3f46;
}

body.theme-dark .code-input {
    background: #2f353d !important;
    color: #ffffff !important;
    border-color: #3a3f46 !important;
}

body.theme-dark .code-input:focus {
    background: #3a3f46 !important;
    color: #ffffff !important;
    border-color: #4a5159 !important;
}

body.theme-dark .theme-toggle-btn {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 0 var(--accent-weak);
}

body.theme-dark .logo-icon {
    background: transparent;
}

body.theme-dark .logo-icon svg {
    filter: brightness(0) invert(1) contrast(0.95);
}

body.theme-dark .menu-icon svg {
    filter: brightness(0) invert(1) contrast(0.95);
}

body.theme-dark .auth-btn svg {
    filter: brightness(0) invert(1) contrast(0.95);
}

body.theme-dark .greeting-text,
body.theme-dark .user-name,
body.theme-dark .menu-header .greeting-text,
body.theme-dark .menu-header .user-name {
    color: #e6edf3 !important;
}

.user-info {
    flex: 1;
}

.greeting-text {
    font-size: 1rem;
    color: #111;
    margin-bottom: 4px;
    font-weight: 500;
}

.user-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #111;
}

.menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 8px 0;
}

.logout-item {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.2rem;
}

.logout-item:hover {
    background: #f8d7da;
    color: #721c24;
    transform: translateX(-4px);
}

.menu-dropdown {
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, .20);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    height: 100vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.menu-header {
    background: rgb(255 255 255 / 50%);
}

.user-avatar-small {
    position: relative;
}

.menu-items {
    padding: 8px;
}

.menu-item {
    padding: 12px 14px;
    transition: background .15s ease, transform .08s ease, color .15s ease;
}

.menu-item:hover {
    background: var(--accent-weak);
    transform: translateX(2px);
}

body.theme-dark .menu-item:hover {
    background: var(--accent-weak);
}

.menu-panel {
    padding: 16px;
    border-top: none;
    flex: 1;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    contain: layout style paint;
}

.back-arrow-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-arrow-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: translateX(-2px);
}

body.theme-dark .back-arrow-btn {
    color: #ccc;
}

body.theme-dark .back-arrow-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.menu-item:focus-visible {
    outline: 2px solid rgba(59, 130, 246, .6);
    outline-offset: 2px;
}

.menu-item.active {
    background: var(--accent-strong);
    box-shadow: inset 0 0 0 1px var(--accent);
}

body.theme-dark .menu-item.active {
    background: var(--accent-strong);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.menu-icon svg {
    filter: none;
    opacity: .9;
}

body.theme-dark .menu-icon svg {
    filter: brightness(0) invert(1) contrast(.95);
    opacity: .85;
}

.menu-item:hover .menu-icon svg {
    opacity: 1;
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

.code-input-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 2rem 0;
    padding: 0 1rem;
}

.code-input {
    width: 50px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: #f5f5f5;
    color: #333;
    transition: all 0.1s ease;
    outline: none;
}

.code-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    color: #333;
}

.code-input.filled {
    border-color: #333;
    background: #333;
    color: white;
    transform: scale(1.05);
}

.code-input.error {
    border-color: #666;
    background: #666;
    color: white;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.code-input.success {
    border-color: #28a745;
    background: #28a745;
    color: white;
    animation: pulse 0.6s ease-in-out;
}

.code-input.success-animation {
    border-color: #28a745;
    background: #28a745;
    color: white;
    animation: successGlow 0.3s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.profile-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    max-width: 100%;
    height: 100%;
}

.profile-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
    width: 100%;
    position: relative;
}

.profile-editor .user-avatar-small {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    margin-left: 0;
}

.profile-info-lines {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin: 0;
    margin-left: 0;
}

.profile-name-line {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

.profile-email-line {
    font-size: 12px;
    color: #666;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-dark .profile-name-line {
    color: #e6edf3;
}

body.theme-dark .profile-email-line {
    color: #8b949e;
}

.profile-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 12px 0;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.profile-panel-title .back-arrow-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    color: #666;
    position: absolute;
    left: 15px;
}

.profile-panel-title .back-arrow-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.theme-dark .profile-panel-title .back-arrow-btn {
    color: #8b949e;
}

body.theme-dark .profile-panel-title .back-arrow-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
}

body.theme-dark .profile-panel-title {
    color: #e6edf3;
}

.profile-editor .auth-form {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
}

.profile-editor .avatar-picker {
    display: none;
    position: absolute;
    left: 120px;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.profile-editor .avatar-picker.show {
    display: block;
}

.profile-editor .avatar-grid {
    grid-template-columns: repeat(4, 36px);
    gap: 6px;
    justify-content: flex-start;
    max-width: 200px;
    margin: 0;
}

.profile-editor .avatar-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.profile-editor .avatar-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
    border-color: var(--accent);
}

body.theme-dark .profile-editor .avatar-picker {
    background: rgba(31, 35, 41, 0.95);
    border-color: #3a3f46;
}

.profile-editor .form-group {
    padding: 4px 5px;
}

.profile-editor input {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 12px;
}

body.theme-dark .profile-editor input {
    background: #1f2329;
    color: #e6edf3;
    border-color: #3a3f46;
}

.privacy-text p {
    margin-bottom: 0.75rem;
    color: #495057;
}

.privacy-text ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.privacy-text li {
    margin-bottom: 0.5rem;
    color: #495057;
}

.hidden {
    display: none !important;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.verification-screen {
    text-align: center;
    padding: 2rem;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.back-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

body.theme-dark .back-button {
    color: #e6edf3;
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .back-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.phone-icon-container {
    position: relative;
    margin: 2rem 0;
}

.phone-icon {
    color: #333;
    margin-bottom: 1rem;
}

.message-bubble {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.verification-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin: 1rem 0;
    line-height: 1.2;
}

.verification-description {
    color: #333;
    font-size: 1rem;
    margin: 1rem 0 2rem 0;
    line-height: 1.4;
    max-width: 300px;
    text-align: center;
}

body.theme-dark .verification-description {
    color: #e6edf3;
}

.verification-description #userEmail,
.verification-description #userPhone {
    font-weight: 600;
    color: #333;
}

body.theme-dark .verification-description #userEmail,
body.theme-dark .verification-description #userPhone {
    color: #e6edf3;
}

.verify-btn {
    background: var(--accent, #667eea);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
    min-width: 150px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.verify-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.resend-code-btn {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.resend-code-btn:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.resend-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.theme-dark .resend-code-btn {
    color: #60a5fa;
    border-color: #60a5fa;
}

body.theme-dark .resend-code-btn:hover:not(:disabled) {
    background: #60a5fa;
    color: #000;
}

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

.verify-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-group input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    animation: shake 0.5s ease-in-out;
}

.form-group input.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    position: relative;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group input.success:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-group input.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.avatar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.avatar-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.avatar-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
    animation: scaleIn 0.3s ease;
}

.avatar-modal-img {
    width: auto;
    height: auto;
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.avatar-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.avatar-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.settings-container {
    padding: 20px;
    max-width: 100%;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
    text-align: center;
}

body.theme-dark .settings-title {
    color: #e6edf3;
}

.settings-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

body.theme-dark .settings-section {
    border-bottom-color: #3a3f46;
}

.settings-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #555;
}

body.theme-dark .settings-subtitle {
    color: #c9d1d9;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #333;
}

body.theme-dark .settings-label {
    color: #e6edf3;
}

.settings-icon {
    font-size: 1.5rem;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: var(--accent);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

.text-size-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    width: 100%;
}

.text-size-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    user-select: none;
}

.text-size-label.large {
    font-size: 20px;
}

body.theme-dark .text-size-label {
    color: #8b949e;
}

.text-size-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    transition: background 0.2s ease;
}

.text-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.text-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.text-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.text-size-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

body.theme-dark .text-size-slider {
    background: #3a3f46;
}

body.theme-dark .text-size-slider::-webkit-slider-thumb {
    background: var(--accent);
}

body.theme-dark .text-size-slider::-moz-range-thumb {
    background: var(--accent);
}

.text-size-preview {
    padding: 16px;
    margin-top: 12px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    transition: font-size 0.2s ease;
    font-size: 100%;
}

body.theme-dark .text-size-preview {
    background: #2f353d;
    color: #e6edf3;
}

.two-factor-container {
    padding: 24px;
}

.two-factor-container h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

body.theme-dark .two-factor-container h3 {
    color: #e6edf3;
}

.two-factor-container p {
    color: #666;
}

body.theme-dark .two-factor-container p {
    color: #8b949e;
}

.two-factor-container p span {
    color: #333;
    font-weight: 600;
}

body.theme-dark .two-factor-container p span {
    color: #e6edf3;
}

.two-factor-container .back-arrow-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    color: #666;
    position: absolute;
    top: 16px;
    left: 16px;
}

.two-factor-container .back-arrow-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

body.theme-dark .two-factor-container .back-arrow-btn {
    color: #8b949e;
}

body.theme-dark .two-factor-container .back-arrow-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
}

.two-factor-container .form-group {
    margin-bottom: 16px;
}

.two-factor-container label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

body.theme-dark .two-factor-container label {
    color: #e6edf3;
}

.two-factor-container input[type="password"],
.two-factor-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    color: #333;
}

.two-factor-container input[type="password"]:focus,
.two-factor-container input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.theme-dark .two-factor-container input[type="password"],
body.theme-dark .two-factor-container input[type="text"] {
    background: #1f2329;
    color: #e6edf3;
    border-color: #3a3f46;
}

body.theme-dark .two-factor-container input[type="password"]:focus,
body.theme-dark .two-factor-container input[type="text"]:focus {
    border-color: var(--accent);
}

.password-input-container {
    position: relative;
    width: 100%;
}

.password-input-container input {
    width: 100%;
    padding-right: 50px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.password-toggle-btn:hover {
    color: var(--accent);
    background: rgba(52, 152, 219, 0.1);
}

body.theme-dark .password-toggle-btn {
    color: #8b949e;
}

body.theme-dark .password-toggle-btn:hover {
    color: var(--accent);
    background: rgba(52, 152, 219, 0.2);
}

.password-toggle-btn .eye-icon {
    pointer-events: none;
}

.settings-item.clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.settings-item.clickable:hover {
    background: var(--accent-weak);
}

.settings-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-select:hover {
    border-color: var(--accent);
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.theme-dark .settings-select {
    background: #2f353d;
    color: #e6edf3;
    border-color: #3a3f46;
}

.settings-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

body.theme-dark .settings-info {
    background: #2f353d;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.info-label {
    color: #666;
    font-weight: 500;
}

body.theme-dark .info-label {
    color: #8b949e;
}

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

body.theme-dark .info-value {
    color: #e6edf3;
}

.settings-btn {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.settings-btn.warning {
    background: #fff3cd;
    color: #856404;
}

.settings-btn.warning:hover {
    background: #ffeaa7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.settings-btn.danger {
    background: #f8d7da;
    color: #721c24;
}

.settings-btn.danger:hover {
    background: #f5c6cb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

body.theme-dark .settings-btn.warning {
    background: #664d03;
    color: #ffc107;
}

body.theme-dark .settings-btn.danger {
    background: #58151c;
    color: #f1aeb5;
}

.settings-footer {
    margin-top: 24px;
    text-align: center;
}

.liquid-glass {
    position: relative;
    isolation: isolate;
    border: none;
    box-shadow: 0px 6px 24px rgb(95 95 95 / 15%);
    border-radius: var(--lg-br, 16px);
    overflow: hidden;
}

.liquid-glass::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 15px -5px rgb(0 0 0 / 20%);
    background-color: rgba(255, 255, 255, 0.1);
}

.liquid-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    filter: url(#glass-distortion);
}

body.theme-dark .liquid-glass::before {
    box-shadow: inset 0 0 15px -5px rgb(255 255 255 / 20%);
    background-color: rgb(107 107 107 / 10%);
}

.header {
    background: none;
    color: #ffffff;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    z-index: 9999;
    flex-direction: column;
    width: 100%;
    
    --lg-br: 0 0 16px 16px;
}

.header-logos {
    display: flex;
    gap: 1rem;
    align-items: center;
    cursor: pointer;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo svg {
    color: #000000;
    height: 3.125rem;
    width: auto;
}

.mosobr svg {
    color: #e92e3d;
}

.mgkeit svg {
    color: #1357ff;
}

.header-logo.it-moscow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3.125rem;
    width: auto;
    align-self: center;
    margin-top: -0.2rem;
}

.it-moscow-logo {
    height: 3.125rem;
    width: auto;
    object-fit: contain;
    max-width: 100%;
    vertical-align: middle;
    display: inline-block;
}

/* По умолчанию (светлая тема) показываем light версию */
.header-logo.it-moscow .it-moscow-dark {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.header-logo.it-moscow .it-moscow-light {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* В темной теме показываем dark версию, скрываем light */
body.theme-dark .header-logo.it-moscow .it-moscow-light {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

body.theme-dark .header-logo.it-moscow .it-moscow-dark {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: 3.125rem !important;
}

body.theme-dark .header-logo svg {
    color: #fff;
}

.header-logo-x {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(0 0 0 / 50%);
}

body.theme-dark .header-logo-x {
    color: rgb(255 255 255 / 50%);
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.menu-btn {
    display: block;
    position: relative;
    width: 18px;
    height: 20px;
    cursor: pointer;
    margin-left: 0.5rem;
    margin-block: 1.45rem;
    z-index: 106;
}

.menu-btn:before,
.menu-btn:after {
    content: "";
    background-color: var(--accent);
    position: absolute;
    width: 100%;
    height: 3px;
    border-radius: 16px;
    right: 0;
    transition: all 0.3s ease 0s;
}

.menu-btn:before {
    top: 0;
}

.menu-btn:after {
    bottom: 1px;
}

.menu-btn span {
    position: absolute;
    background-color: var(--accent);
    right: 0;
    width: 61%;
    height: 3px;
    border-radius: 16px;
    top: 8px;
    transition: all 0.3s ease 0s;
}

.menu-btn:hover span {
    width: 100%;
}

.header-up-nav {
    display: flex;
    gap: .625rem;
}

.header-nav {
    display: flex;
    height: 50px;
    gap: .825rem;
}

.nav-link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 15px;
    border-radius: 16px;
    transition: all .2s ease;
    font-weight: 500;
    color: rgb(0 0 0 / 60%);
    gap: 5px;
}

body.theme-dark .nav-link {
    color: rgb(255 255 255 / 60%)
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 0;
    height: 2px;
    border-radius: 50px;
    background: var(--accent);
    transition: all .2s ease;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    color: rgb(0 0 0 / 90%);
}

body.theme-dark .nav-link:hover {
    color: rgb(255 255 255 / 90%)
}

.nav-link.active {
    border-radius: 16px;
    color: rgb(0 0 0 / 100%);
}

body.theme-dark .nav-link.active {
    color: rgb(255 255 255 / 100%);
}

.content-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
}

@media (min-width: 1400px) {
    .content-container {
        max-width: 1400px;
    }
}

@media (max-width: 1200px) {
    .content-container {
        max-width: 1000px;
    }
}

@media (max-width: 992px) {
    .content-container {
        max-width: 750px;
    }
}

@media (max-width: 768px) {
    .content-container {
        max-width: 95%;
    }
}

.header-up,
.header-dodik {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.header-up.liquid-glass::before {
    background: linear-gradient(135deg, #ffffff29 45%, #0070ff3b 55%);
}

body.theme-dark .header-up.liquid-glass::before {
    background: linear-gradient(135deg, #00000029 45%, #00469f3b 55%);
}

.hero-banner {
    height: 450px;
    width: 100%;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    background-blend-mode: multiply, normal;
    flex-wrap: wrap;
    position: relative;
    background: linear-gradient(0deg, rgba(114, 114, 114, 1) 0%, rgba(114, 114, 114, 1) 100%), url(../images/hero-banner.png) 50% center / cover no-repeat lightgray;
}

.hero-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: flex-end;
}

.hero-titles {
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-title {
    display: flex;
    font-size: 3.75rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.25;
}

.hero-subtitles {
    display: flex;
    flex-direction: column;
    gap: 5PX;
    padding: 0 1.25rem;
}

.hero-subtitle {
    display: flex;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    font-style: normal;
    color: rgb(233 233 233 / 95%);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.hero-platforms {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    --lg-br: 16px;
    background: rgb(255 255 255 / 20%);
    color: #fff;
    font-weight: 500;
    transition: all .2s ease;
    cursor: pointer;
}

.hero-btn:hover {
    background: rgb(255 255 255 / 30%);
}

.hero-plat-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.hero-plat-link:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-plat-link svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: all .2s ease;
    fill: white;
}

.hero-plat-link:hover svg {
    fill: white;
}

.meadia-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-titles {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    display: flex;
    font-size: 3.75rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.25;
}

.gallery-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .625rem;
}

.gallery-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    width: 3rem;
    height: 3rem;
    --lg-br: 12px;
    transition: all .2s ease;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-btn svg {
    width: 20px;
    height: 20px;
}

.gallery-btn#gallery-next {
    rotate: 180deg;
}

body.theme-dark .gallery-btn {
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-btn:hover {
    --lg-br: 50px;
    background: rgb(255 255 255 / 75%);
    border-color: rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body.theme-dark .gallery-btn:hover {
    background: rgb(57 57 57 / 75%);
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.gallery-cards {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-cards::-webkit-scrollbar {
    display: none;
}

.gallery-card {
    flex: 0 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    border: 6px solid;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.gallery-img {
    height: 16rem;
    object-fit: cover;
    display: block;
}

.about-desc {
    display: flex;
    padding: 0 20px;
    max-width: 50%;
    font-size: 1.25rem;
    font-style: italic;
    position: relative;
    z-index: 2;
    color: inherit;
    transition: color 0.3s ease;
}

.about-us:hover .about-desc {
    color: #ffffff;
}

.about-us {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(0, 219, 222, 0.05),
        rgba(252, 0, 255, 0.05),
        rgba(0, 219, 222, 0.05)
    );
    background-size: 200% 200%;
    padding: 20px;
    padding-bottom: 120px;
    border-radius: 50px;
    min-height: 520px;
    height: auto;
    backdrop-filter: blur(10px);
    overflow: hidden; /* Скрываем части статуэтки, выходящие за границы */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.4s ease, transform 0.1s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: background-position;
    animation: gradient-flow 15s linear infinite;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.about-us::before {
    border-radius: 50px;
}

.about-us::after {
    border-radius: 50px;
}

/* Анимация переливания градиента */
.about-us::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 219, 222, 0.3) 50%,
        rgba(252, 0, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(0deg);
    transition: transform 0.8s ease;
    z-index: -1;
    opacity: 0;
}

.about-us::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        -45deg,
        transparent 30%,
        rgba(252, 0, 255, 0.3) 50%,
        rgba(0, 219, 222, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(0deg);
    transition: transform 0.8s ease;
    z-index: -1;
    opacity: 0;
}

.about-us:hover::before {
    opacity: 0;
}

.about-us:hover::after {
    opacity: 0;
}

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

.about-us:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    background: linear-gradient(
        135deg,
        rgba(0, 219, 222, 0.15),
        rgba(252, 0, 255, 0.15),
        rgba(0, 219, 222, 0.15)
    );
    background-size: 200% 200%;
    animation: gradient-flow-fast 8s linear infinite;
}

@keyframes gradient-flow-fast {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

body.theme-dark .about-us {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.3)
    );
    background-size: 200% 200%;
    animation: gradient-flow-dark 15s linear infinite;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes gradient-flow-dark {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

body.theme-dark .about-us:hover {
    background: linear-gradient(
        135deg,
        rgba(0, 219, 222, 0.2),
        rgba(252, 0, 255, 0.2),
        rgba(0, 219, 222, 0.2)
    );
    background-size: 200% 200%;
    animation: gradient-flow-fast-dark 8s linear infinite;
}

@keyframes gradient-flow-fast-dark {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Анимация заголовка в секции about-us */
.about-us .section-title {
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, #00dbde, #fc00ff, #00dbde);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: background-position 0.5s ease;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.about-us:hover .section-title {
    animation: gradient-shift 1.5s ease infinite;
}

.about-img {
    position: absolute;
    right: 7rem;
    height: 32rem; /* Уменьшена высота чтобы статуэтка не вылезала */
    max-height: 100%; /* Ограничиваем максимальную высоту границами карточки */
    top: 0;
    transform: translateY(0);
    transform-origin: center center;
    z-index: 2;
    object-fit: contain;
    object-position: center top;
    will-change: transform;
    pointer-events: none; /* Чтобы курсор не мешал отслеживанию на карточке */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.colleges {
    display: flex;
    justify-content: center;
    align-items: center;
    
}

.colleges>.section-title {
    justify-content: center;
    min-width: min-content;
}

.sec-title_img {
    height: 12rem; /* Возвращено к исходному размеру */
    width: auto;
    object-fit: contain;
}

.logo-slider {
    overflow: hidden;
}

.logo-slider-track {
    display: flex;
    align-items: center;
    gap: 4rem; /* Возвращено к исходному отступу */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.logo-slide {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-slide_img {
    height: 10rem; /* Возвращено к исходному размеру */
    width: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
    z-index: 100;
    pointer-events: auto;
    min-width: 40px;
    min-height: 40px;
}
.password-toggle * {
    pointer-events: none;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle:focus {
    outline: none;
}

.password-toggle .eye-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
}

body.theme-dark .password-toggle {
    color: #8b949e;
}

body.theme-dark .password-toggle:hover {
    color: #e6edf3;
}

.footer {
    padding: 2rem;
    min-width: 50rem;
}

.footer-content {
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

body.theme-dark .footer-content p {
    color: #8b949e;
}

.footer-content p:first-child {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

body.theme-dark .footer-content p:first-child {
    color: #e6edf3;
}

loader {
    --loader-size: 48px;
    --loader-border: 5px;
    --loader-color: #3b82f6;

    width: var(--loader-size);
    height: var(--loader-size);

    border-radius: 50%;
    display: inline-block;
    border: var(--loader-border) solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--loader-color);

    animation: spin 0.9s linear infinite;
}

site-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    to {
        rotate: 360deg;
    }
}

#registerModal .modal-content,
#loginModal .modal-content,
#verifyCodeModal .modal-content {
    background: rgba(45, 55, 75, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

body.theme-dark #registerModal .modal-content,
body.theme-dark #loginModal .modal-content,
body.theme-dark #verifyCodeModal .modal-content {
    background: rgba(30, 35, 45, 0.7) !important;
}
.code-modal,
.code-modal-content {
    background: rgba(20, 20, 22, 0.82) !important;
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.32);
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
    border: 1.5px solid rgba(255,255,255,0.11);
}

.modal-content.confirm-code {
    background: rgba(20,20,22,0.82) !important;
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.32);
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
    border: 1.5px solid rgba(255,255,255,0.11);
}

.code-input, .code-label, .code-title {
    color: #333 !important;
    background: transparent !important;
}

body.theme-dark .code-input,
body.theme-dark .code-label,
body.theme-dark .code-title {
    color: #e6edf3 !important;
}

#verifyCodeModal .phone-icon svg {
    width: 120px !important;
    height: 96px !important;
    min-width: 120px !important;
    min-height: 96px !important;
    fill: #333 !important;
    color: #333 !important;
    display: block;
    margin: 18px auto 18px auto;
}

body.theme-dark #verifyCodeModal .phone-icon svg {
    fill: #e6edf3 !important;
    color: #e6edf3 !important;
}
#verifyCodeModal .phone-icon-container,
#verifyCodeModal .phone-icon {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#verifyCodeModal .modal-body {
    background: transparent !important;
    padding: 1.5rem !important;
    color: #333 !important;
}

body.theme-dark #verifyCodeModal .modal-body {
    color: #e6edf3 !important;
}

/* ============================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (320px - 768px)
   ============================================ */

/* Базовые исправления для всех мобильных устройств */
@media (max-width: 768px) {
    /* Убираем горизонтальную прокрутку */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Адаптивные изображения */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Увеличиваем базовый размер шрифта для читаемости */
    body {
        font-size: 16px;
    }
    
    /* Улучшаем отступы для касаний */
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Адаптация контейнера контента */
    .content-container {
        max-width: 100% !important;
        padding: 0 1rem;
    }
    
    /* Адаптация header */
    .header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .header-up {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1rem;
        position: relative;
    }
    
    .header-logos {
        flex-shrink: 0;
    }
    
    .header-logo svg {
        height: 2rem;
    }
    
    .header-dodik {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1rem;
        position: relative;
    }
    
    .header-up-left {
        width: auto;
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }
    
    .header-up-nav {
        display: none; /* Скрыто по умолчанию, показывается через JS */
    }
    
    .header-nav {
        display: none; /* Скрыто по умолчанию, показывается через JS */
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .header-right {
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .auth-buttons {
        display: none; /* Скрыто по умолчанию на мобильных */
    }
    
    .auth-btn {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
        justify-content: center;
    }
    
    .theme-toggle-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* Адаптация hero баннера */
    .hero-banner {
        height: auto;
        min-height: 300px;
        padding: 1.5rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-titles {
        width: 100%;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitles {
        padding: 0;
        margin-top: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.4;
    }
    
    /* Перестраиваем структуру hero-banner для мобильных */
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .hero-titles {
        width: 100%;
        order: 1;
    }
    
    .hero-platforms {
        order: 3;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        margin-top: 1rem;
    }
    
    .hero-platforms::before {
        content: 'Скачать игру:';
        display: block;
        color: #fff;
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .hero-btn {
        order: 2;
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        min-height: 44px;
        justify-content: center;
    }
    
    .hero-buttons {
        order: 2;
        width: 100%;
    }
    
    .hero-plat-link {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Адаптация секции "О нашей игре" */
    .about-us {
        padding: 1.5rem 1rem;
        padding-bottom: 2rem;
        border-radius: 24px;
        min-height: auto;
        height: auto;
    }
    
    .about-us .section-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .about-desc {
        max-width: 100%;
        font-size: 1rem !important;
        padding: 0;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .about-img {
        position: relative !important;
        right: auto !important;
        height: auto !important;
        max-height: 250px !important;
        width: 100%;
        margin-top: 1rem;
        object-fit: contain;
    }
    
    /* Адаптация галереи */
    .gallery-titles {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .gallery-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .gallery-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .gallery-cards {
        gap: 0;
        scroll-padding: 1rem;
    }
    
    .gallery-card {
        min-width: calc(100vw - 2rem);
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        flex: 0 0 calc(100vw - 2rem);
        scroll-snap-align: center;
        scroll-snap-stop: always;
        margin: 0 1rem;
    }
    
    .gallery-card:first-child {
        margin-left: 1rem;
    }
    
    .gallery-card:last-child {
        margin-right: 1rem;
    }
    
    .gallery-img {
        height: 12rem;
        width: 100%;
        object-fit: cover;
    }
    
    /* Адаптация секции колледжей */
    .colleges {
        padding: 1.5rem 1rem;
        overflow: visible;
    }
    
    .colleges .section-title {
        font-size: 2rem !important;
        padding: 0 1rem;
        margin-bottom: 1rem;
    }
    
    .sec-title_img {
        height: auto !important;
        max-height: 8rem;
        max-width: 100%;
        width: auto;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
    
    .logo-slider {
        margin-top: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 1rem;
        scrollbar-width: thin;
    }
    
    .logo-slider-track {
        gap: 2rem;
        padding: 0.5rem 0;
        min-width: max-content;
    }
    
    .logo-slide {
        flex-shrink: 0;
    }
    
    .logo-slide_img {
        height: 5rem !important;
        max-width: 150px;
        width: auto;
        object-fit: contain;
    }
    
    /* Адаптация секций */
    .section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .meadia-gallery {
        gap: 1rem;
    }
    
    /* Адаптация пользовательского меню */
    .user-menu {
        position: relative;
    }
    
    .menu-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .menu-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        z-index: 10001;
    }
    
    /* Адаптация модальных окон */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto;
        padding: 1.5rem 1rem;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    /* Адаптация форм */
    .form-group {
        margin-bottom: 1rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px; /* Предотвращает зум на iOS */
        min-height: 44px;
    }
    
    /* Адаптация кнопок форм */
    button[type="submit"],
    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Адаптация уведомлений */
    .message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        font-size: 14px;
        padding: 0.75rem 1rem;
    }
    
    /* Улучшение контрастности для читаемости */
    body:not(.theme-dark) {
        background-color: #ffffff;
    }
    
    body.theme-dark {
        background-color: #1a1d24;
    }
    
    /* Адаптация скроллбара для мобильных */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    /* Улучшение отступов между секциями */
    .content-container > * {
        margin-bottom: 2rem;
    }
    
    .content-container > *:last-child {
        margin-bottom: 1rem;
    }
    
    /* Убеждаемся, что header всегда поверх (кроме случая когда меню открыто) */
    .header {
        position: sticky;
        top: 0;
        z-index: 10000;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    body.theme-dark .header {
        background: rgba(26, 29, 36, 0.95);
    }
    
    /* Когда меню открыто - header полностью скрыт */
    body.mobile-menu-open .header {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
        display: none !important;
    }
    
    body.mobile-menu-open .header-up,
    body.mobile-menu-open .header-dodik {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
        display: none !important;
    }
    
    /* Исправляем overflow для всех секций */
    .section {
        overflow: visible;
    }
    
    .content-container {
        overflow-x: hidden;
    }
    
    /* Улучшаем отступы по бокам */
    .content-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Дополнительные стили для очень маленьких экранов (320px - 480px) */
@media (max-width: 480px) {
    .content-container {
        padding: 0 0.75rem;
    }
    
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-up,
    .header-dodik {
        padding: 0.5rem 0.75rem;
    }
    
    .hero-banner {
        padding: 1rem 0.75rem;
        min-height: 250px;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
    
    .about-us {
        padding: 1rem 0.75rem;
        padding-bottom: 1.5rem;
        border-radius: 16px;
    }
    
    .about-us .section-title {
        font-size: 1.75rem !important;
    }
    
    .section-title {
        font-size: 1.75rem !important;
    }
    
    .about-desc {
        font-size: 0.9rem !important;
    }
    
    .about-img {
        max-height: 200px !important;
    }
    
    .gallery-card {
        min-width: calc(100vw - 1.5rem);
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        flex: 0 0 calc(100vw - 1.5rem);
        margin: 0 0.75rem;
    }
    
    .gallery-img {
        height: 10rem;
        width: 100%;
        object-fit: cover;
    }
    
    .logo-slide_img {
        height: 5rem !important;
        max-width: 100px;
    }
    
    .sec-title_img {
        height: 5rem !important;
    }
    
    .section {
        padding: 1rem 0.75rem;
    }
    
    .content-container > * {
        margin-bottom: 1.5rem;
    }
    
    .modal-content {
        width: 98% !important;
        max-width: 98% !important;
        padding: 1rem 0.75rem;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .header-nav.mobile-active,
    .header-up-nav.mobile-active,
    .auth-buttons.mobile-active {
        padding: 0.75rem;
    }
}

/* Адаптация для средних планшетов (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .gallery-card {
        min-width: calc(100vw - 2rem);
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        flex: 0 0 calc(100vw - 2rem);
        margin: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .section-title {
        font-size: 2.25rem !important;
    }
}

/* ============================================
   ГАМБУРГЕР-МЕНЮ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================ */

/* Кнопка гамбургер-меню (скрыта на десктопе) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10000;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--accent, #3b82f6);
    border-radius: 3px;
    transition: all 0.3s ease;
}

body.theme-dark .mobile-menu-toggle span {
    background-color: #fff;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Мобильное меню */
@media (max-width: 768px) {
    /* Показываем кнопку гамбургер */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Скрываем обычное меню по умолчанию */
    .header-nav,
    .header-up-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        padding: 5rem 1rem 1rem;
        z-index: 10005;
        flex-direction: column;
        gap: 0.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    body.theme-dark .header-nav,
    body.theme-dark .header-up-nav {
        background: rgba(30, 35, 45, 0.98);
    }
    
    /* Показываем меню когда активно */
    .header-nav.mobile-active,
    .header-up-nav.mobile-active {
        display: flex;
    }
    
    /* Адаптация навигации в мобильном меню */
    .header-dodik {
        position: relative;
        z-index: 10003;
    }
    
    .header-up-left {
        position: relative;
        z-index: 10003;
    }
    
    .header-up {
        position: relative;
        z-index: 10003;
    }
    
    /* Кнопка закрытия меню - всегда поверх */
    .mobile-menu-toggle {
        z-index: 10006;
        position: relative;
    }
    
    /* Кнопка закрытия внутри меню */
    .header-nav.mobile-active::before,
    .header-up-nav.mobile-active::before,
    .auth-buttons.mobile-active::before {
        content: '✕';
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        z-index: 10007;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #333;
        font-weight: bold;
        line-height: 1;
    }
    
    body.theme-dark .header-nav.mobile-active::before,
    body.theme-dark .header-up-nav.mobile-active::before,
    body.theme-dark .auth-buttons.mobile-active::before {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    
    /* Кнопка закрытия в мобильном меню */
    .header-nav.mobile-active::before,
    .header-up-nav.mobile-active::before,
    .auth-buttons.mobile-active::before {
        content: '';
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        z-index: 10005;
        cursor: pointer;
    }
    
    /* Улучшаем видимость ссылок в мобильном меню */
    .header-nav.mobile-active .nav-link,
    .header-up-nav.mobile-active .nav-link {
        width: 100%;
        padding: 14px 16px;
        border-radius: 12px;
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
        font-weight: 500;
        position: relative;
        z-index: 10006;
    }
    
    body.theme-dark .header-nav.mobile-active .nav-link,
    body.theme-dark .header-up-nav.mobile-active .nav-link {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .header-nav.mobile-active .nav-link:hover,
    .header-up-nav.mobile-active .nav-link:hover {
        background: rgba(59, 130, 246, 0.2);
        transform: translateX(4px);
    }
    
    body.theme-dark .header-nav.mobile-active .nav-link:hover,
    body.theme-dark .header-up-nav.mobile-active .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Адаптация кнопок авторизации */
    .header-right {
        position: relative;
    }
    
    .auth-buttons {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        padding: 5rem 1rem 1rem;
        z-index: 10005;
        flex-direction: column;
        gap: 0.75rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: none;
    }
    
    body.theme-dark .auth-buttons {
        background: rgba(30, 35, 45, 0.98);
    }
    
    .auth-buttons.mobile-active {
        display: flex;
    }
    
    /* Кнопка для открытия меню авторизации */
    .auth-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        background: rgba(59, 130, 246, 0.1);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .auth-menu-toggle:hover {
        background: rgba(59, 130, 246, 0.2);
    }
    
    body.theme-dark .auth-menu-toggle {
        background: rgba(255, 255, 255, 0.1);
    }
    
    body.theme-dark .auth-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .auth-menu-toggle svg {
        width: 24px;
        height: 24px;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .header-nav.mobile-active,
    .header-up-nav.mobile-active,
    .auth-buttons.mobile-active {
        padding: 0.75rem;
    }
}
