/* Chat Page */
.chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

/* Nav */
.chat-nav {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-darker);
}

.chat-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
}

.chat-nav-logo img {
    border-radius: 4px;
}

/* Email Gate */
.chat-gate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.gate-content {
    max-width: 520px;
    text-align: center;
}

.gate-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.gate-subtitle {
    font-size: 1.05rem;
    color: var(--text-cream);
    line-height: 1.7;
    margin-bottom: 8px;
}

.gate-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.gate-form {
    max-width: 480px;
    margin: 0 auto;
}

.gate-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.gate-input-row input[type="email"] {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.25s ease;
}

.gate-input-row input[type="email"]::placeholder {
    color: var(--text-muted);
}

.gate-input-row input[type="email"]:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(111, 191, 148, 0.15);
}

.gate-form .consent-label {
    display: none;
}

/* Chat Interface */
.chat-interface[hidden] {
    display: none !important;
}

.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

.chat-header {
    text-align: center;
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.chat-header-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 4px;
}

.chat-header-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.message {
    display: flex;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.7;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--accent);
    color: var(--bg-dark);
    border-bottom-right-radius: 4px;
    font-weight: 400;
}

.message.assistant .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-cream);
    border-bottom-left-radius: 4px;
}

.message.assistant .message-bubble strong {
    color: var(--text-light);
}

/* Typing cursor */
.typing-cursor::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Input */
.chat-input-form {
    display: flex;
    gap: 10px;
    padding: 16px 0 24px;
    border-top: 1px solid var(--border-subtle);
}

.chat-input-form input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.25s ease;
}

.chat-input-form input[type="text"]::placeholder {
    color: var(--text-muted);
}

.chat-input-form input[type="text"]:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(111, 191, 148, 0.15);
}

.chat-send {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 640px) {
    .gate-title {
        font-size: 1.6rem;
    }

    .gate-input-row {
        flex-direction: column;
    }

    .gate-input-row .btn-cta {
        width: 100%;
    }

    .chat-interface {
        padding: 0 8px;
    }

    .message {
        max-width: 92%;
    }

    .chat-header-title {
        font-size: 1.1rem;
    }
}
