/* Дополнительные стили для авторизации, кабинета и админ-панели */

.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    margin-left: 0;
}

.site-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 0;
    margin-top: 0;
}

.header-profile {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(12, 18, 38, 0.6);
    border: 1px solid var(--border-soft);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.header-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

.header-name {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.site-header .auth-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 11px 23px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.4px;
    transition: all 220ms ease;
    cursor: pointer;
}

.site-header .auth-btn:hover {
    background: transparent;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(47, 200, 255, 0.32);
}

.site-header.scrolled .auth-btn {
    border-color: rgba(47, 200, 255, 0.46);
    background: rgba(8, 16, 40, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.site-header.scrolled .auth-btn:hover {
    background: rgba(10, 20, 48, 0.28);
    border-color: rgba(47, 200, 255, 0.62);
}

/* Личный кабинет */
.account {
    padding: 120px 0 100px;
}

.account-header,
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.profile-banner {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 28px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(12, 18, 38, 0.6);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    background: rgba(12, 18, 38, 0.8);
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.profile-email {
    color: var(--text-muted);
    font-size: 13px;
}

.profile-form {
    display: grid;
    gap: 12px;
}

.account-header p,
.admin-header p {
    color: var(--text-muted);
    margin-top: 10px;
}

.account-actions {
    display: flex;
    gap: 12px;
}

.ghost-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    transition: all 200ms ease;
}

.ghost-btn:hover {
    border-color: rgba(47, 200, 255, 0.7);
    background: rgba(47, 200, 255, 0.12);
}

.account-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.account-card,
.admin-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 220ms ease, border-color 220ms ease;
}

.account-card:hover,
.admin-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.super-admin-only {
    display: none;
}

.super-admin-only.is-visible {
    display: block;
}

.account-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 16px 0;
    color: var(--text-muted);
}

.account-chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.account-chip {
    background: rgba(47, 200, 255, 0.16);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.account-empty {
    color: var(--text-muted);
    font-size: 14px;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(12, 18, 38, 0.6);
    border: 1px solid var(--border-soft);
}

.purchase-item strong {
    display: block;
    margin-bottom: 6px;
}

.code-pill {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    background: rgba(47, 200, 255, 0.25);
    color: #fff;
    font-size: 12px;
}

.purchase-date {
    color: var(--text-muted);
    font-size: 12px;
}

.account-steps {
    display: grid;
    gap: 10px;
    padding-left: 20px;
    color: var(--text-muted);
}

/* Админ панель */
.admin {
    padding: 44px 0 90px;
}

.admin-badge {
    background: rgba(255, 203, 87, 0.15);
    border: 1px solid rgba(255, 203, 87, 0.4);
    color: #ffd27d;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 12px;
}

.admin-form {
    display: grid;
    gap: 14px;
}

.admin-form input {
    background: rgba(10, 14, 28, 0.8);
    border: 1px solid var(--border-soft);
    color: var(--text);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.admin-form input:focus-visible {
    outline: none;
    border-color: rgba(47, 200, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(47, 200, 255, 0.14);
}

.admin-result {
    margin-top: 16px;
    color: var(--text-muted);
}

.btn.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    box-shadow: none;
}

.btn.btn-outline:hover {
    background: rgba(47, 200, 255, 0.18);
}

/* Авторизация */
.auth-modal .modal.auth {
    max-width: 520px;
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-bottom: 20px;
    position: relative;
    padding: 0 0 8px;
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    box-shadow: none;
}

.auth-tabs::before {
    display: none;
}

.auth-tabs::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 2px;
    border-radius: 999px;
    background: rgba(47, 200, 255, 0.9);
    transform: translateX(0);
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tabs[data-active="login"]::after {
    transform: translateX(100%);
}

.auth-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: color 200ms ease, transform 200ms ease;
}

.auth-tab.active {
    color: var(--text);
    text-decoration: none;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-field {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 14, 28, 0.85);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-muted);
    box-shadow: inset 0 0 0 1px rgba(47, 200, 255, 0.05);
    transition: all 200ms ease;
}

.auth-field i {
    color: rgba(166, 178, 255, 0.7);
}

.auth-field input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    font-size: 14px;
    outline: none;
}

.auth-field input[type="file"] {
    font-size: 12px;
    cursor: pointer;
}

.auth-field:focus-within {
    border-color: rgba(47, 200, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(47, 200, 255, 0.15);
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0px 1000px rgba(10, 14, 28, 0.9) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-check input[type="checkbox"] {
    accent-color: #00a8ff;
}

.auth-form.hidden {
    display: none;
}

.auth-form.anim-in {
    animation: auth-form-in 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes auth-form-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.auth-check {
    display: grid;
    grid-template-columns: 16px 1fr;
    align-items: center;
    gap: 10px;
}

.auth-captcha {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.turnstile-widget {
    min-height: 65px;
}

.auth-tab:hover {
    color: var(--text);
    transform: translateY(-1px);
}

.auth-helper {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.admin-logs {
    padding-top: 20px;
}

.admin-logs-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-logs-searchbar {
    margin-bottom: 14px;
}

.admin-search-tabs {
    display: inline-flex;
    gap: 10px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(7, 11, 26, 0.8);
}

.admin-search-tab {
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
}

.admin-search-tab.active {
    color: #fff;
    border-color: rgba(47, 200, 255, 0.5);
    background: rgba(47, 200, 255, 0.18);
}

.admin-search-tab:hover {
    color: var(--text);
}

.admin-log-search-form {
    margin-bottom: 14px;
}

.admin-log-list {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

.admin-log-item {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(12, 18, 38, 0.55);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.admin-log-item:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(14, 22, 44, 0.7);
}

.admin-log-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-log-item-title {
    font-weight: 600;
}

.admin-log-item-email {
    color: var(--text-muted);
    font-size: 13px;
}

.admin-log-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-pill {
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid var(--border-soft);
}

.status-pill.online {
    color: #8df2b1;
    border-color: rgba(82, 230, 132, 0.45);
    background: rgba(82, 230, 132, 0.12);
}

.status-pill.offline {
    color: #ffc0c0;
    border-color: rgba(255, 130, 130, 0.45);
    background: rgba(255, 130, 130, 0.12);
}

.status-pill.blocked {
    color: #ffd2b4;
    border-color: rgba(255, 154, 82, 0.55);
    background: rgba(255, 154, 82, 0.16);
}

.role-pill {
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid var(--border-soft);
}

.role-pill.role-regular {
    color: #cfd8ff;
    border-color: rgba(160, 180, 255, 0.4);
    background: rgba(95, 120, 190, 0.18);
}

.role-pill.role-buyer {
    color: #8de7ff;
    border-color: rgba(75, 210, 255, 0.45);
    background: rgba(75, 210, 255, 0.16);
}

.role-pill.role-admin {
    color: #ffd98c;
    border-color: rgba(255, 190, 85, 0.52);
    background: rgba(255, 190, 85, 0.16);
}

.role-pill.role-super-admin {
    color: #ffe9a8;
    border-color: rgba(255, 226, 118, 0.65);
    background: rgba(255, 226, 118, 0.2);
}

.admin-stats-card {
    position: sticky;
    top: 88px;
}

.admin-stats-list {
    display: grid;
    gap: 10px;
}

.admin-stat-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-muted);
    background: rgba(10, 14, 28, 0.55);
}

.admin-stat-item strong {
    color: var(--text);
}

.admin-stats-updated {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-user-modal .admin-user-modal-content {
    max-width: 900px;
}

.admin-user-modal-body {
    display: grid;
    gap: 16px;
}

.admin-user-head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 12px;
    background: rgba(10, 14, 28, 0.5);
}

.admin-user-head img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
}

.admin-user-head-meta {
    display: grid;
    gap: 6px;
}

.admin-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.admin-user-cell {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(10, 14, 28, 0.45);
}

.admin-user-cell span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.admin-user-timeline {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.admin-user-event {
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(8, 12, 24, 0.75);
}

.admin-user-event-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.admin-user-event-type {
    font-weight: 600;
    color: var(--text);
}

.admin-user-event-date {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-user-event-details {
    color: var(--text-muted);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.identity-required-modal {
    z-index: 1400;
}

.identity-required-modal .modal.identity-required {
    max-width: 520px;
}

.identity-required-modal .auth-helper {
    min-height: 18px;
}

@media (max-width: 768px) {
    .account {
        padding: 34px 0 86px;
    }

    .site-header .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .site-header .header-actions {
        order: 3;
        width: auto;
        justify-content: flex-end;
        margin-left: 0;
    }

    .admin-logs-layout {
        grid-template-columns: 1fr;
    }

    .admin-stats-card {
        position: static;
    }

    .admin-user-head {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .account {
        padding: 26px 0 76px;
    }

    .site-header .header-actions {
        display: none;
    }
}
