/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: #ececec;
    color: #222;
    line-height: 1.5;
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #f3f3f3;
    border-bottom: 1px solid #ddd;
    width: 100%;
    padding-left: 0;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 0 0;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 0;
    padding-left: 0;
}

.logo a {
    font-size: 26px;
    font-weight: bold;
    color: #1a3a6e;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.logo span {
    color: #0b9cb5;
}

.header-search {
    flex: 1;
    max-width: 400px;
}
.header-search form {
    display: flex;
}
.header-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search input:focus {
    border-color: #0b9cb5;
    box-shadow: 0 0 0 3px rgba(11,156,181,0.1);
}
.header-search button {
    background: white;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.header-search button:hover {
    background: #f0f0f0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.user-name {
    font-size: 14px;
    color: #1a3a6e;
    text-decoration: none;
}

/* ============================================
   BUTTONS (общие)
   ============================================ */
.btn-ask-header, .logout-btn, .btn-login-header, .btn-register-header {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    width: auto;
    white-space: nowrap;
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
}
.btn-ask-header {
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    color: white;
}
.logout-btn {
    border: 1px solid #1a3a6e;
    color: #1a3a6e;
}
.logout-btn:hover {
    background: #1a3a6e;
    color: white;
}
.btn-login-header, .btn-register-header {
    color: #1a3a6e;
}
.btn-ask-header:hover, .logout-btn:hover, .btn-login-header:hover, .btn-register-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-primary, .btn-secondary, .btn-small, .btn-best, .btn-danger,
.auth-btn-primary, .auth-btn-secondary {
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
}
.btn-secondary {
    background: #e2e8f0;
    color: #1a3a6e;
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    text-decoration: none;
}
.btn-small {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 20px;
    background: #e9ecef;
    color: #1a3a6e;
    text-decoration: none;
    display: inline-block;
}
.btn-best {
    background: #10b981;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
}
.btn-best:hover {
    background: #059669;
}
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-mission-home {
    display: inline-block;
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    color: white;
    padding: 12px 30px;
    border-radius: 40px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-mission-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   BURGER MENU
   ============================================ */
.burger-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px 8px 8px 16px;
    transition: opacity 0.2s, transform 0.1s;
}
.burger-menu:hover {
    opacity: 0.7;
}
.burger-menu:active {
    transform: scale(0.95);
}
.burger-menu span {
    width: 26px;
    height: 3px;
    background: #1f7fa3;
    border-radius: 3px;
    transition: 0.2s;
}
.burger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-menu.open span:nth-child(2) {
    opacity: 0;
}
.burger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.burger-menu-dropdown {
    position: fixed;
    top: 66px;
    left: -300px;
    width: 280px;
    height: calc(100vh - 66px);
    background: white;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
}
.burger-menu-dropdown.open {
    left: 0;
}
.burger-menu-content {
    padding: 20px;
}
.burger-menu-section {
    margin-bottom: 25px;
}
.burger-menu-section h4 {
    color: #1a3a6e;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #0b9cb5;
}
.burger-menu-section a {
    display: block;
    color: #334155;
    text-decoration: none;
    padding: 10px 0;
    font-size: 15px;
    transition: color 0.2s, padding-left 0.2s, background 0.2s;
    border-radius: 8px;
}
.burger-menu-section a:hover {
    color: #0b9cb5;
    padding-left: 8px;
    background: #f8fafc;
}

.burger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    display: none;
}
.burger-overlay.show {
    display: block;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(90deg, #283f80 0%, #0b9cb5 100%);
    padding: 40px 20px;
    color: white;
}
.hero__container {
    max-width: 1200px;
    margin: 0 auto;
}
.hero__text {
    margin-bottom: 30px;
}
.hero-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}
.hero-description {
    font-size: 16px;
    line-height: 1.5;
}

.company-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    padding-left: 0;
}
.company-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s, filter 0.2s;
    filter: brightness(0) invert(1);
}
.company-logo:hover {
    transform: scale(1.05);
}
.hero__buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 10px;
}

.btn-hero-primary.small, .btn-hero-secondary.small {
    width: auto;
    min-width: 200px;
    height: 52px;
    padding: 0 28px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    letter-spacing: 0.3px;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    border: none;
    outline: none;
}
.btn-hero-primary.small {
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-hero-primary.small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #1fa0ba, #0f6e8a);
}
.btn-hero-secondary.small {
    background: white;
    color: #237aa0;
    border: 1px solid #237aa0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-hero-secondary.small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    background: #f0f9ff;
    border-color: #0b9cb5;
}

/* ============================================
   AVATARS (единый стиль для всех аватарок)
   ============================================ */
.user-avatar, .user-avatar-img,
.question-avatar-placeholder, .question-avatar-img,
.active-user__avatar,
.answer-avatar-placeholder, .answer-avatar-img,
.ask-invitation__avatar {
    border-radius: 50%;
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar, .user-avatar-img,
.active-user__avatar,
.answer-avatar-placeholder, .answer-avatar-img {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 18px;
}

.question-avatar-placeholder, .question-avatar-img {
    width: 56px;
    height: 56px;
    font-size: 24px;
}

.ask-invitation__avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.profile-avatar img, .avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.user-avatar-img img, .question-avatar-img img,
.active-user__avatar img, .answer-avatar-img img,
.ask-invitation__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-link:hover .user-avatar-img,
.user-avatar-link:hover .user-avatar,
.question-avatar-link:hover .question-avatar-img,
.question-avatar-link:hover .question-avatar-placeholder,
.active-user:hover .active-user__avatar,
.ask-invitation:hover .ask-invitation__avatar {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ============================================
   FEED & CARDS
   ============================================ */
.feed-header {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.feed-tabs {
    display: flex;
    gap: 20px;
}
.feed-tab {
    font-size: 16px;
    padding: 6px 0;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}
.feed-tab.active {
    color: #0b9cb5;
    border-bottom: 2px solid #0b9cb5;
}
.feed-tab:hover {
    color: #0b9cb5;
}

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

.question-card {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}
.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

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

.question-card-left {
    flex-shrink: 0;
}
.question-avatar-link {
    text-decoration: none;
}
.question-card-right {
    flex: 1;
}
.question-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}
.question-title a {
    font-size: 20px;
    font-weight: bold;
    color: #1a3a6e;
    text-decoration: none;
    transition: color 0.2s;
}
.question-title a:hover {
    color: #0b9cb5;
    text-decoration: underline;
}
.question-meta {
    font-size: 13px;
    color: #888;
    margin: 8px 0;
}
.question-snippet {
    font-size: 14px;
    color: #444;
    margin-top: 8px;
}

/* ============================================
   TAGS
   ============================================ */
.question-tags {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    background: #dde8f1;
    color: #1e4b87;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}
.tag:hover {
    background: #cbdde9;
    transform: scale(1.02);
}

/* ============================================
   SIDEBAR
   ============================================ */
.feed-layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}
.feed-left {
    flex: 1;
}
.feed-right {
    width: 240px;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.sidebar-card h3 {
    font-size: 18px;
    font-weight: bold;
    color: #1a3a6e;
    margin-bottom: 15px;
}

.active-users {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.active-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: background 0.2s;
    padding: 8px;
    border-radius: 12px;
}
.active-user:hover {
    background: #f8fafc;
}
.active-user__info {
    flex: 1;
}
.active-user__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a6e;
}
.active-user__activity {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.mission-teaser p {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 12px;
}
.mission-link {
    font-size: 14px;
    font-weight: 600;
    color: #0b9cb5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}
.mission-link:hover span {
    transform: translateX(4px);
}

.popular-hashtags ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}
.popular-hashtags li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.popular-hashtags li a {
    text-decoration: none;
    color: #1e4b87;
    font-size: 14px;
}
.popular-hashtags li a:hover {
    color: #0b9cb5;
}
.tag-count {
    font-size: 13px;
    color: #64748b;
}
.all-tags-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #0b9cb5;
    text-decoration: none;
}
.all-tags-link:hover span {
    transform: translateX(4px);
}

/* ============================================
   ASK INVITATION
   ============================================ */
.ask-invitation {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 25px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
}
.ask-invitation__text {
    flex: 1;
    font-size: 16px;
    color: #334155;
}
.ask-invitation__arrow {
    font-size: 24px;
    color: #0b9cb5;
    transition: transform 0.2s;
}
.ask-invitation:hover .ask-invitation__arrow {
    transform: translateX(4px);
}

/* ============================================
   FORMS
   ============================================ */
.ask-question-container, .edit-question-container,
.edit-answer-container, .edit-profile-container {
    max-width: 900px;
    margin: 100px auto 40px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1a3a6e;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #0b9cb5;
    box-shadow: 0 0 0 3px rgba(11,156,181,0.1);
}
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.tags-input-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    background: white;
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.tags-input-container:focus-within {
    border-color: #0b9cb5;
    box-shadow: 0 0 0 3px rgba(11,156,181,0.1);
}
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dynamic-tag {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dynamic-tag.error-tag {
    background: #fee2e2;
    color: #b91c1c;
}
.tag-remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #666;
}
.tag-remove:hover {
    color: #b91c1c;
}
.tags-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 6px 4px;
    font-size: 14px;
    background: transparent;
}
.tag-input-disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ============================================
   QUESTION DETAIL
   ============================================ */
.question-detail {
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    border-radius: 16px;
    padding: 30px;
}
.question-header h1 {
    font-size: 28px;
    color: #1a3a6e;
}
.question-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #666;
    font-size: 14px;
    margin: 15px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.question-content {
    display: flex;
    gap: 25px;
    margin: 25px 0;
}
.answers-section {
    margin-top: 40px;
}
.add-answer {
    margin-top: 40px;
}

/* ============================================
   VOTING
   ============================================ */
.voting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.vote-up, .vote-down {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s, transform 0.1s;
}
.vote-up:hover { color: #28b8d5; transform: scale(1.1); }
.vote-down:hover { color: #ef4444; transform: scale(1.1); }
.vote-up.active { color: #28b8d5; }
.vote-down.active { color: #ef4444; }
.vote-count {
    font-size: 18px;
    font-weight: bold;
    color: #1a3a6e;
}

/* ============================================
   ANSWERS
   ============================================ */
.answer-card {
    display: flex;
    gap: 25px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}
.answer-card.best-answer {
    background: #f0fdf4;
    margin: 0 -30px;
    padding: 20px 30px;
    border-radius: 12px;
}
.best-badge {
    background: #15803d;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 10px;
}
.answer-children {
    margin-left: 60px;
    margin-top: 15px;
    padding-left: 15px;
    border-left: 2px solid #e2e8f0;
}
.comment-answer-btn {
    background: none;
    border: none;
    color: #0b9cb5;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    padding: 4px 8px;
}
.comment-form {
    margin-top: 10px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 12px;
    display: none;
}
.comment-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.reply-file-upload {
    margin-top: 8px;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-container {
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.profile-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
}
.profile-info {
    flex: 1;
}
.profile-info h1 {
    color: #1a3a6e;
    font-size: 28px;
    margin-bottom: 10px;
}
.profile-email {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}
.profile-email i {
    color: #0b9cb5;
    width: 20px;
}
.profile-bio {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    color: #334155;
    line-height: 1.5;
    font-size: 15px;
}
.bio-placeholder {
    color: #94a3b8;
    font-style: italic;
}
.profile-joined {
    color: #64748b;
    font-size: 13px;
    margin: 10px 0;
}
.profile-joined i {
    color: #0b9cb5;
    width: 20px;
}
.edit-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.profile-tabs {
    display: flex;
    gap: 30px;
    margin: 25px 0 20px;
    border-bottom: 2px solid #e2e8f0;
}
.tab {
    padding: 10px 0;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: color 0.2s;
}
.tab.active {
    color: #0b9cb5;
    border-bottom: 3px solid #0b9cb5;
}
.tab:hover {
    color: #1a3a6e;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.question-item, .answer-item {
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}
.question-item:last-child, .answer-item:last-child {
    border-bottom: none;
}
.question-stats, .answer-stats {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}
.question-title a {
    font-size: 18px;
    font-weight: 500;
    color: #1a3a6e;
    text-decoration: none;
}
.question-title a:hover {
    color: #0b9cb5;
}
.answer-preview {
    font-size: 14px;
    color: #475569;
    margin: 8px 0;
}
.question-date, .answer-date {
    font-size: 12px;
    color: #94a3b8;
}
.empty-message {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
}

/* ============================================
   AUTH
   ============================================ */
.auth-page {
    background: #ececec;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}
.auth-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 36px 28px;
    width: 360px;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 28px;
    color: #1e293b;
}
.auth-field {
    margin-bottom: 20px;
}
.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
}
.auth-field input:focus {
    outline: none;
    border-color: #0b9cb5;
    box-shadow: 0 0 0 3px rgba(11,156,181,0.1);
}
.auth-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}
.auth-btn-primary {
    background: linear-gradient(135deg, #28b8d5, #1689a7);
    color: white;
}
.auth-btn-secondary {
    background: linear-gradient(135deg, #1e4b87, #0f3b6a);
    color: white;
}

/* ============================================
   MISSION, HELP, RULES, CONTACTS (единый стиль)
   ============================================ */
.mission-page, .help-page, .rules-page, .contacts-page {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.mission-hero, .help-hero, .rules-hero, .contacts-hero {
    background: linear-gradient(90deg, #283f80 0%, #0b9cb5 100%);
    color: white;
    padding: 50px 30px;
    text-align: center;
}
.mission-hero h1, .help-hero h1, .rules-hero h1, .contacts-hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}
.mission-hero p, .help-hero p, .rules-hero p, .contacts-hero p {
    font-size: 20px;
    opacity: 0.9;
}
.mission-content, .help-content, .rules-content, .contacts-content {
    padding: 40px 30px;
}
.mission-block, .help-block, .rules-block, .contacts-block {
    margin-bottom: 40px;
}
.mission-block h2, .help-block h2, .rules-block h2, .contacts-block h2 {
    color: #1a3a6e;
    font-size: 28px;
    margin-bottom: 15px;
    border-left: 5px solid #0b9cb5;
    padding-left: 20px;
}
.mission-block p, .help-block p, .rules-block p, .contacts-block p {
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    margin: 12px 0;
}
.help-block ul, .rules-block ul {
    margin: 12px 0 12px 25px;
    color: #334155;
    line-height: 1.6;
}
.help-block li, .rules-block li {
    margin: 8px 0;
}
.help-block code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: #0b9cb5;
}
.rules-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}
.contacts-footer {
    text-align: center;
    padding: 25px 30px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    background: white;
}
.contacts-footer a, .help-block a, .rules-block a {
    color: #0b9cb5;
    text-decoration: none;
}
.contacts-footer a:hover, .help-block a:hover, .rules-block a:hover {
    text-decoration: underline;
}

/* ============================================
   ATTACHMENTS & FILES
   ============================================ */
.attachments-list {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.attachment-item {
    position: relative;
    display: inline-block;
}
.attachment-img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
}
.attachment-video-player, .attachment-audio-player {
    max-width: 300px;
    border-radius: 8px;
}
.attachment-link {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: #1e4b87;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.delete-attachment-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.file-drop-zone, .answer-file-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}
.file-drop-zone.drag-over, .answer-file-drop-zone.drag-over {
    border-color: #0b9cb5;
    background: #e0f2fe;
}
.file-drop-message i {
    font-size: 32px;
    color: #0b9cb5;
    margin-bottom: 8px;
    display: block;
}
.file-list, .existing-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.file-item, .existing-attachment-item {
    background: #f1f5f9;
    border-radius: 20px;
    padding: 4px 12px 4px 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.file-item .remove-file, .existing-attachment-item .remove-existing-file {
    cursor: pointer;
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
    background: none;
    border: none;
}

/* ============================================
   MARKDOWN
   ============================================ */
.markdown-content {
    line-height: 1.6;
}
.markdown-content h1, .markdown-content h2, .markdown-content h3,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: #1a3a6e;
}
.markdown-content p {
    margin-bottom: 1em;
}
.markdown-content code {
    background: #f4f4f4;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
}
.markdown-content pre {
    background: #f4f4f4;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
}
.markdown-content blockquote {
    border-left: 4px solid #0b9cb5;
    padding-left: 1em;
    margin: 1em 0;
    color: #555;
}
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
}
.markdown-content th, .markdown-content td {
    border: 1px solid #ddd;
    padding: 8px;
}
.markdown-content img {
    max-width: 100%;
    height: auto;
}
.math-block, .math-inline {
    overflow-x: auto;
}
.katex-display {
    margin: 1em 0;
}

/* ============================================
   EASYMDE
   ============================================ */
.EasyMDEContainer .editor-toolbar button:first-child,
.EasyMDEContainer .editor-toolbar button:nth-child(2) {
    display: none !important;
}
.EasyMDEContainer .editor-toolbar {
    position: sticky;
    top: 70px;
    z-index: 999;
    background: white;
}
body:has(.editor-toolbar.fullscreen) .sticky-header,
body:has(.CodeMirror-fullscreen) .sticky-header {
    display: none !important;
}

/* ============================================
   TOASTS
   ============================================ */
#toast-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1001;
}
.toast {
    padding: 10px 20px;
    border-radius: 40px;
    margin-bottom: 8px;
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast-success { background: #10b981; color: white; }
.toast-error { background: #ef4444; color: white; }
.toast-info { background: #3b82f6; color: white; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #ececec;
    border-top: 1px solid #b7c3d1;
    padding: 40px 20px;
    margin-top: 40px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}
.footer-col {
    flex: 1;
    min-width: 150px;
}
.footer-col h4 {
    color: #0f728c;
    font-size: 18px;
    margin-bottom: 15px;
}
.footer-col a {
    display: block;
    color: #166e89;
    font-size: 14px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}
.footer-col a:hover {
    color: #0b9cb5;
    padding-left: 4px;
}
.footer-univ {
    text-align: right;
    min-width: 200px;
}
.univ-logo-img {
    max-width: 200px;
    height: auto;
}
.copyright {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 0 10px 0 0;
    }
    .header-search {
        order: 3;
        width: 100%;
        max-width: none;
    }
    .feed-layout {
        flex-direction: column;
    }
    .feed-right {
        width: 100%;
    }
    .question-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .question-stats {
        justify-content: center;
    }
    .question-tags {
        justify-content: center;
    }
    .burger-menu-dropdown {
        width: 260px;
    }
    .header-right .btn-ask-header,
    .header-right .logout-btn,
    .header-right .btn-login-header,
    .header-right .btn-register-header {
        display: none;
    }
    .user-name {
        display: none;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .footer-univ {
        text-align: center;
    }
    .answer-children {
        margin-left: 20px;
    }
    .question-content {
        flex-direction: column;
        align-items: center;
    }
    .voting {
        flex-direction: row;
        gap: 15px;
    }
    .ask-question-container, .edit-question-container,
    .edit-answer-container, .edit-profile-container {
        margin-top: 120px;
    }
}

textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 400px;
}