* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0d0b1a;
    color: #f0edff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.12), transparent 60%);
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- Контейнер для форм ---------- */
.auth-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 28px;
    padding: 48px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Шапка формы ---------- */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.08));
    border: 2px solid rgba(168, 85, 247, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: 0.3s;
}

.auth-header .logo-icon img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, #a855f7 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: #8b83a8;
    font-size: 14px;
    margin-top: 4px;
    font-weight: 400;
}

/* ---------- Поля ввода ---------- */
.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5b5378;
    font-size: 14px;
    transition: 0.3s;
    z-index: 2;
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: 14px;
    border: 1px solid rgba(168, 85, 247, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #f0edff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: 0.3s;
    outline: none;
    height: 52px;
}

.form-group input::placeholder {
    color: #4a4363;
}

.form-group input:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.05);
}

.form-group input:focus ~ .input-icon,
.form-group input:focus + .input-icon {
    color: #a855f7;
}

/* ---------- Кнопки ---------- */
.btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
    height: 52px;
    margin-top: 4px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ---------- Разделитель ---------- */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0 20px;
    gap: 16px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(168, 85, 247, 0.08);
}

.divider span {
    color: #4a4363;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ---------- Ссылки ---------- */
.back-link {
    display: inline-block;
    margin-top: 22px;
    color: #4a4363;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s;
    text-decoration: none;
    text-align: center;
    width: 100%;
}

.back-link:hover {
    color: #c084fc;
}

.back-link i {
    margin-right: 6px;
}

.links-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.links-row a {
    color: #6a6288;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s;
    text-decoration: none;
}

.links-row a:hover {
    color: #c084fc;
}

.links-row a i {
    margin-right: 6px;
    font-size: 12px;
}

/* ---------- VK контейнер ---------- */
.vk-container {
    text-align: center;
}

.vk-container #vk-one-tap {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

/* ========================================
   МОДАЛЬНЫЕ ОКНА
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: linear-gradient(145deg, rgba(30, 27, 56, 0.98), rgba(13, 11, 26, 0.98));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalPop 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalPop {
    from {
        transform: scale(0.92) translateY(16px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-box .modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    color: #4a4363;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
}

.modal-box .modal-close:hover {
    color: #c084fc;
    transform: rotate(90deg);
}

.modal-box .modal-icon {
    font-size: 44px;
    margin-bottom: 14px;
    display: block;
}

.modal-box .modal-icon.error {
    color: #ef4444;
}

.modal-box .modal-icon.success {
    color: #34d399;
}

.modal-box .modal-icon.info {
    color: #f59e0b;
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: #f0edff;
    margin-bottom: 8px;
}

.modal-box p {
    color: #8b83a8;
    font-size: 15px;
    line-height: 1.6;
}

.modal-box .modal-btn {
    margin-top: 20px;
    padding: 12px 32px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.3s;
}

.modal-box .modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.modal-box .modal-btn-success {
    background: linear-gradient(135deg, #059669, #34d399);
}

.modal-box .modal-btn-success:hover {
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.3);
}

.modal-box .register-info {
    margin-top: 8px;
    color: #6a6288;
    font-size: 14px;
    line-height: 1.8;
}

.modal-box .register-info code {
    background: rgba(168, 85, 247, 0.1);
    padding: 2px 10px;
    border-radius: 6px;
    color: #c084fc;
    font-family: 'Inter', monospace;
    font-size: 13px;
    font-weight: 600;
}

.modal-box .register-info a {
    color: #a855f7;
    font-weight: 600;
    transition: 0.3s;
}

.modal-box .register-info a:hover {
    color: #c084fc;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */
@media (max-width: 480px) {
    .auth-container {
        padding: 32px 20px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .auth-header .logo-icon {
        width: 56px;
        height: 56px;
    }

    .auth-header .logo-icon img {
        width: 30px;
        height: 30px;
    }

    .form-group input {
        font-size: 14px;
        padding: 12px 14px 12px 42px;
        height: 48px;
    }

    .btn-submit {
        font-size: 15px;
        height: 48px;
    }

    .modal-box {
        padding: 28px 20px;
    }

    .modal-box h3 {
        font-size: 18px;
    }
}

/* ========================================
   KRIZONPANEL - Дополнительные стили для moders.php
   ======================================== */

/* ---------- Таблица модераторов ---------- */
.table-wrap {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.08);
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 700px;
}

thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(168, 85, 247, 0.08);
}

th {
    padding: 16px 16px;
    text-align: left;
    font-weight: 600;
    color: #8b83a8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
    white-space: nowrap;
}

th:hover {
    color: #f0edff;
}

th i {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.5;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #d4cfe8;
    font-size: 13px;
}

tr:hover td {
    background: rgba(168, 85, 247, 0.04);
}

.clickable-name {
    color: #c084fc;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.clickable-name:hover {
    color: #a855f7;
    text-decoration: underline;
}

/* ---------- Бейджи ---------- */
.rank-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.rank-badge.admin { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.rank-badge.moderator { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.rank-badge.curator { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.rank-badge.trainee { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.rank-badge.user { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

.penalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.penalty-badge .fa-solid,
.penalty-badge .fa-regular {
    font-size: 11px;
}

.penalty-badge.notice {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.penalty-badge.notice.high {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.penalty-badge.notice.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.penalty-badge.warn {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.penalty-badge.warn.high {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.penalty-badge.warn.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ---------- Правая панель (логи) ---------- */
.right-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(168, 85, 247, 0.08);
    height: fit-content;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.right-panel h3 {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.right-panel h3 i {
    color: #a855f7;
}

.log-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    line-height: 1.5;
}

.log-item:last-child {
    border-bottom: none;
}

.log-item .log-time {
    font-size: 11px;
    color: #5b5378;
    font-weight: 600;
    display: inline-block;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 10px;
    border-radius: 10px;
    margin-right: 8px;
}

.log-action {
    color: #b8b0d4;
    margin-top: 2px;
}

.log-action strong {
    color: #f0edff;
    font-weight: 600;
}

.log-action .highlight {
    color: #c084fc;
}

.no-data {
    color: #5b5378;
    text-align: center;
    padding: 40px 20px;
}

/* ---------- Кнопка регистрации ---------- */
.btn-register {
    margin: 20px auto 0;
    display: block;
    padding: 12px 32px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #059669, #34d399);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.2);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(52, 211, 153, 0.35);
}

/* ---------- Модалка регистрации ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: linear-gradient(145deg, rgba(30, 27, 56, 0.98), rgba(13, 11, 26, 0.98));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 460px;
    width: 90%;
    position: relative;
    animation: modalPop 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalPop {
    from {
        transform: scale(0.92) translateY(16px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-box .modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    color: #4a4363;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
}

.modal-box .modal-close:hover {
    color: #c084fc;
    transform: rotate(90deg);
}

.modal-box h2 {
    font-size: 22px;
    font-weight: 700;
    color: #f0edff;
    margin-bottom: 20px;
    text-align: center;
}

.modal-box .form-group {
    margin-bottom: 14px;
    position: relative;
}

.modal-box .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #8b83a8;
    margin-bottom: 4px;
}

.modal-box .form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #f0edff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: 0.3s;
    outline: none;
}

.modal-box .form-group input:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.05);
}

.modal-box .btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 6px;
}

.modal-box .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1200px) {
    .main-layout { 
        grid-template-columns: 200px 1fr 260px; 
        gap: 16px; 
    }
    table { min-width: 600px; }
}

@media (max-width: 992px) {
    .main-layout { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .sidebar { display: none; }
    .right-panel { 
        position: static; 
        max-height: none; 
    }
    .content-header h2 { font-size: 20px; }
    .content-header { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .search-form { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .search-form select,
    .search-form input[type="text"] { 
        min-width: auto; 
    }
    table { min-width: 500px; }
}

@media (max-width: 600px) {
    .nav { 
        flex-wrap: wrap; 
        height: auto; 
        padding: 12px 0; 
        gap: 10px; 
    }
    .user-info span { font-size: 11px; }
    .login { padding: 8px 16px; font-size: 12px; }
    th, td { 
        padding: 8px 10px; 
        font-size: 12px; 
    }
    .right-panel { padding: 16px; }
    table { 
        font-size: 12px; 
        min-width: 400px; 
    }
    .rank-badge { 
        font-size: 10px; 
        padding: 2px 8px; 
    }
}