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

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(0, 255, 144, 0.25), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(0, 255, 255, 0.2), transparent 40%),
                #050505;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding-top: 130px;
    color: #00ff80;
}

.page-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.chat-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(95%, 900px);
    max-width: 900px;
    padding: 30px 40px 24px;
    border-radius: 0 0 30px 30px;
    z-index: 10;
    background: rgba(2, 2, 2, 0.95);
    border-bottom: 1px solid rgba(0, 255, 128, 0.35);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.chat-header h1 {
    font-size: 32px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #00ff80;
    text-shadow: 0 0 20px rgba(0, 255, 128, 0.65);
}

.chat-header p {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(0, 255, 128, 0.65);
}

.header-glow {
    position: absolute;
    inset: -40% -20%;
    background: radial-gradient(circle, rgba(0, 255, 128, 0.35), transparent 70%);
    filter: blur(12px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.chat-header.scrolled {
    border-bottom-color: rgba(0, 255, 128, 0.7);
    box-shadow: 0 30px 35px rgba(0, 255, 128, 0.15);
    backdrop-filter: blur(10px);
}

.chat-container {
    width: min(95%, 900px);
    background: linear-gradient(160deg, rgba(0, 0, 0, 0.95), rgba(5, 5, 5, 0.92));
    border-radius: 30px;
    border: 1px solid rgba(0, 255, 128, 0.35);
    box-shadow: 0 40px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 170px;
    min-height: 70vh;
    position: relative;
}

.chat-messages {
    flex: 1;
    padding: 20px 30px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 10, 10, 0.8);
    border-radius: 0 0 30px 30px;
}

.message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    word-wrap: break-word;
    border: 1px solid rgba(0, 255, 128, 0.25);
    box-shadow: 0 12px 18px rgba(0, 0, 0, 0.5);
    animation: appear 0.35s ease forwards;
}

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

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #00ff80, #00bfa5);
    color: #030303;
    text-align: right;
}

.assistant-message {
    align-self: flex-start;
    background: rgba(20, 20, 20, 0.95);
    color: #00ff80;
}

.typing-indicator {
    font-style: italic;
    color: rgba(0, 255, 128, 0.9);
    background: rgba(25, 25, 25, 0.9);
    align-self: flex-start;
    border-radius: 20px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 255, 128, 0.4);
}

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 18px 24px 24px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(0, 255, 128, 0.35);
}

#user-input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid rgba(0, 255, 128, 0.55);
    background: rgba(10, 10, 10, 0.9);
    color: #00ff80;
    font-size: 16px;
    outline: none;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

#user-input::placeholder {
    color: rgba(0, 255, 128, 0.55);
}

#user-input:focus {
    border-color: #00ffd1;
    box-shadow: 0 0 13px rgba(0, 255, 128, 0.3);
}

#send-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00ff80, #00bfa5);
    color: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0, 255, 128, 0.35);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#send-button svg {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.35));
}

#send-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 35px rgba(0, 255, 128, 0.45);
}

#send-button:active {
    transform: translateY(1px);
    box-shadow: 0 10px 16px rgba(0, 0, 0, 0.5);
}

#send-button:disabled {
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(0.3);
}

#send-button.sending {
    animation: pulse 1.2s infinite;
}

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

@media (max-width: 768px) {
    body {
        padding-top: 110px;
    }

    .chat-header {
        padding: 22px;
    }

    .chat-container {
        width: 100%;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
        padding-top: 150px;
    }

    .chat-messages {
        padding: 12px 18px;
    }

    .chat-input-container {
        padding: 14px 20px 18px;
    }

    #user-input {
        padding: 12px 18px;
    }

    #send-button {
        width: 46px;
        height: 46px;
    }
}

/* Скроллбар */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.7);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 128, 0.65);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 128, 0.9);
}

.message-link {
    color: #4be0ff;
    text-decoration: underline;
}

.message-link:hover {
    color: #82f3ff;
}

.consent-link {
    color: #4be0ff;
    text-decoration: underline;
}

.consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 2, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.consent-overlay.active {
    display: flex;
}

.consent-modal {
    width: min(520px, 90%);
    background: #090909;
    border: 1px solid rgba(0, 255, 128, 0.4);
    border-radius: 18px;
    padding: 30px;
    text-align: center;
    color: #00ff80;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.9);
}

.consent-modal h2 {
    margin-bottom: 16px;
    font-size: 24px;
    text-transform: uppercase;
}

.consent-modal p {
    margin-bottom: 26px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(0, 255, 128, 0.9);
}

.consent-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.consent-actions button {
    padding: 12px 26px;
    border-radius: 999px;
    border: none;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accept {
    background: linear-gradient(135deg, #00ff80, #00bfa5);
    color: #050505;
}

.btn-decline {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff7f7f;
}

.consent-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
