:root {
    color-scheme: light;
    --bg: #07111f;
    --panel: rgba(255, 255, 255, 0.92);
    --ink: #102033;
    --muted: #6c7a8c;
    --brand: #2454ff;
    --brand-dark: #1135b7;
    --success: #16c784;
    --bubble: #f2f6ff;
    --line: rgba(16, 32, 51, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(36, 84, 255, 0.42), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(22, 199, 132, 0.26), transparent 28rem),
        linear-gradient(135deg, #07111f 0%, #0b1730 48%, #10264f 100%);
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(360px, 1fr);
    gap: 28px;
    width: min(1180px, calc(100% - 32px));
    height: calc(100vh - 32px);
    margin: 16px auto;
}

.hero-panel,
.chat-panel {
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 0;
    padding: 44px;
    color: #fff;
    border-radius: 34px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
}

.hero-panel::after {
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    content: "";
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.brand-pill,
.hero-card {
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
}

.brand-pill {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.eyebrow {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-panel h1 {
    max-width: 520px;
    margin-bottom: 18px;
    font-size: clamp(2.5rem, 5vw, 4.8rem);
    font-weight: 850;
    line-height: 0.98;
}

.hero-copy {
    max-width: 460px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.08rem;
}

.hero-card {
    z-index: 1;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 22px;
}

.hero-card small {
    display: block;
    color: rgba(255, 255, 255, 0.7);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 8px rgba(22, 199, 132, 0.18);
}

.chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    border-radius: 34px;
    background: var(--panel);
}

.chat-header {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}

.assistant-avatar {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: #fff;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), #16c784);
    font-weight: 800;
    object-fit: cover;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.16rem;
    font-weight: 800;
}

.chat-header p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-card {
    width: min(100%, 460px);
    margin: auto;
    padding: 28px;
}

.chat-area {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}

.messages {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding: 22px;
    scroll-behavior: smooth;
}

.message {
    max-width: 86%;
    padding: 14px 16px;
    border-radius: 20px;
    white-space: pre-wrap;
    box-shadow: 0 8px 26px rgba(16, 32, 51, 0.08);
}

.message.bot {
    align-self: flex-start;
    border-top-left-radius: 6px;
    background: #fff;
}

.message.user {
    align-self: flex-end;
    color: #fff;
    border-top-right-radius: 6px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.message a {
    color: var(--brand-dark);
    font-weight: 700;
    word-break: break-word;
}

.message.user a {
    color: #fff;
}

.quick-actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    padding: 14px 22px 20px;
    border-top: 1px solid var(--line);
    background: rgba(242, 246, 255, 0.72);
    scrollbar-color: rgba(36, 84, 255, 0.35) transparent;
    scrollbar-width: thin;
}

.quick-actions::-webkit-scrollbar {
    height: 6px;
}

.quick-actions::-webkit-scrollbar-track {
    background: transparent;
}

.quick-actions::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(36, 84, 255, 0.35);
}

.quick-actions .btn {
    flex: 0 0 auto;
    border-radius: 999px;
}

.composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px 22px 22px;
    background: rgba(255, 255, 255, 0.8);
}

.composer .form-control,
.login-card .form-control,
.login-card .form-select {
    border-color: transparent;
    border-radius: 16px;
    background: var(--bubble);
}

.btn-primary {
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 12px 26px rgba(36, 84, 255, 0.28);
}

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing span {
    width: 7px;
    height: 7px;
    animation: pulse 0.9s infinite ease-in-out;
    border-radius: 50%;
    background: var(--muted);
}

.typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%,
    80%,
    100% {
        transform: scale(0.72);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        width: 100%;
        height: 100vh;
        margin: 0;
    }

    .chat-panel {
        height: 100vh;
        border-radius: 0;
    }
}
