.hidden {
    display: none !important;
}

.page-main {
    padding: 120px 0 60px;
    min-height: calc(100vh - 120px);
}

.page-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.page-meta {
    font-size: 14px;
    color: var(--gray-400);
    margin-bottom: 40px;
}

.page-back {
    margin-top: 40px;
    text-align: center;
}

.legal-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 36px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.legal-content p {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul {
    margin: 8px 0 16px 0;
    padding-left: 0;
}

.legal-content ul li {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.8;
    padding: 4px 0 4px 24px;
    position: relative;
    list-style: none;
}

.legal-content ul li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--blue-500);
    font-weight: 700;
}

.legal-note {
    margin-top: 40px;
    padding: 20px 24px;
    background: var(--blue-50);
    border-left: 3px solid var(--blue-500);
    border-radius: var(--radius-md);
}

.legal-note p {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0;
}

.auth-wrapper {
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    color: var(--blue-500);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-500);
}

.auth-tab:hover {
    color: var(--blue-400);
}

.auth-form {
    padding: 32px;
}

.auth-form.hidden {
    display: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 14px;
    color: var(--gray-500);
}

.auth-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.auth-error.hidden {
    display: none;
}

.auth-form .field-group {
    margin-bottom: 16px;
}

.auth-form .field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: block;
}

.auth-form .field-group input[type="text"],
.auth-form .field-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.3s ease;
    outline: none;
}

.auth-form .field-group input:focus {
    border-color: var(--blue-500);
}

.auth-form .field-group input::placeholder {
    color: var(--gray-400);
}

.auth-agree {
    margin-bottom: 20px;
}

.auth-agree label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
}

.auth-agree input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--blue-500);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.auth-agree a {
    color: var(--blue-500);
    text-decoration: underline;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.auth-agree a:hover {
    color: var(--blue-400);
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 20px;
}

.auth-switch a {
    color: var(--blue-500);
    font-weight: 600;
}

.support-container {
    max-width: 720px;
    margin: 0 auto;
}

.support-guest {
    text-align: center;
    padding: 20px 0 0;
}

.support-guest-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 48px 32px;
}

.support-guest-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.support-guest-card h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.support-guest-card p {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.support-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.support-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-avatar {
    width: 38px;
    height: 38px;
    background: var(--blue-500);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.support-user-info strong {
    display: block;
    font-size: 14px;
    color: var(--gray-900);
    line-height: 1.3;
}

.support-user-info span {
    font-size: 12px;
    color: var(--gray-500);
}

.support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.support-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
}

.new-ticket-form {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.new-ticket-form.hidden {
    display: none;
}

.new-ticket-form h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.new-ticket-form .field-group {
    margin-bottom: 12px;
}

.new-ticket-form .field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: block;
}

.new-ticket-form .field-group input,
.new-ticket-form .field-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

.new-ticket-form .field-group input:focus,
.new-ticket-form .field-group textarea:focus {
    border-color: var(--blue-500);
}

.new-ticket-form .field-group input::placeholder,
.new-ticket-form .field-group textarea::placeholder {
    color: var(--gray-400);
}

.ticket-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ticket-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--gray-500);
}

.ticket-empty.hidden {
    display: none;
}

.ticket-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ticket-empty p {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.ticket-empty span {
    font-size: 13px;
    color: var(--gray-400);
}

.ticket-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ticket-item:hover {
    border-color: var(--blue-400);
    background: var(--blue-50);
}

.ticket-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ticket-item-subject {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticket-status--open {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.ticket-status--closed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.ticket-item-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-400);
}

.ticket-item-preview {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-back {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 12px;
    padding: 6px 0;
    transition: color 0.2s;
}

.ticket-back:hover {
    color: var(--blue-500);
}

.ticket-chat-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ticket-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    gap: 10px;
}

.ticket-chat-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-messages {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    max-width: 80%;
}

.chat-msg--user {
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    align-self: flex-end;
}

.chat-msg--admin {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    align-self: flex-start;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-msg-header strong {
    font-size: 12px;
    color: var(--gray-700);
}

.chat-msg-header span {
    font-size: 11px;
    color: var(--gray-400);
}

.chat-msg-body {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ticket-reply {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    align-items: flex-end;
}

.ticket-reply.hidden {
    display: none;
}

.ticket-reply textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    outline: none;
    resize: none;
    transition: border-color 0.2s;
}

.ticket-reply textarea:focus {
    border-color: var(--blue-500);
}

.ticket-reply textarea::placeholder {
    color: var(--gray-400);
}

.support-contacts {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.support-contacts h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    text-align: center;
}

.support-contacts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.support-contact-card {
    text-align: center;
    padding: 20px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.support-contact-card .contact-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.support-contact-card strong {
    display: block;
    font-size: 13px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.support-contact-card p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
}

.footer-bottom--simple {
    border-top: none;
    padding-top: 0;
}

.footer-bottom a {
    color: var(--gray-500);
    transition: color 0.3s;
}

.footer-bottom a:hover {
    color: var(--blue-400);
}

@media (max-width: 868px) {
    .nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        border-bottom: 1px solid var(--gray-200);
        overflow-y: auto;
        z-index: 999;
    }

    .nav.open {
        display: flex;
    }

    .nav-link {
        padding: 14px 0;
        border-bottom: 1px solid var(--gray-100);
        font-size: 16px;
    }

    .burger {
        display: flex;
    }
}

@media (max-width: 600px) {
    .page-main {
        padding: 90px 0 32px;
    }

    .page-card {
        padding: 24px 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .auth-wrapper {
        max-width: 100%;
    }

    .auth-form {
        padding: 24px 16px;
    }

    .auth-header h1 {
        font-size: 20px;
    }

    .support-guest-card {
        padding: 32px 20px;
    }

    .support-guest-card h1 {
        font-size: 22px;
    }

    .support-topbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .support-user {
        flex-direction: column;
        align-items: center;
    }

    .support-header {
        flex-direction: column;
        align-items: stretch;
    }

    .support-header h1 {
        font-size: 20px;
    }

    .support-contacts-grid {
        grid-template-columns: 1fr;
    }

    .new-ticket-form {
        padding: 20px 16px;
    }

    .ticket-chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 16px;
    }

    .ticket-messages {
        padding: 16px;
    }

    .ticket-reply {
        flex-direction: column;
        padding: 12px 16px;
    }

    .ticket-reply .btn {
        width: 100%;
    }

    .chat-msg {
        max-width: 92%;
    }

    .ticket-item {
        padding: 14px 16px;
    }
}
