
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0b1020;
    --panel: #101729;
    --panel-light: #172137;
    --border: #26324a;
    --text: #eef2ff;
    --muted: #94a3b8;
    --accent: #8b7cff;
    --accent-light: #a99eff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    display: flex;
    height: 100dvh;
    min-height: 450px;
    overflow: hidden;
}

.sidebar {
    width: 270px;
    flex-shrink: 0;
    padding: 25px 18px;
    background: var(--panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.brand-icon, .welcome-icon {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #8b7cff, #5d54d8);
    color: white;
    border-radius: 14px;
    font-weight: 800;
}

.brand-icon {
    width: 46px;
    height: 46px;
    font-size: 25px;
}

.brand h2 {
    margin: 0;
    font-size: 18px;
}

.brand p, .sidebar-bottom p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.new-chat {
    width: 100%;
    padding: 13px;
    border: 1px solid #5549a7;
    border-radius: 12px;
    background: #242044;
    color: white;
    text-align: right;
}

.new-chat span {
    margin-left: 8px;
    font-size: 20px;
}

.sidebar-info {
    margin-top: 25px;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    margin-left: 7px;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #29344e;
}

.main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 76px;
    padding: 15px 28px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid var(--border);
    background: rgba(16, 23, 41, .8);
}

.topbar strong {
    font-size: 15px;
}

.topbar p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.topbar-badge {
    margin-right: auto;
    padding: 7px 12px;
    border-radius: 9px;
    color: var(--accent-light);
    background: #252044;
    font-weight: 800;
}

.mobile-menu {
    display: none;
    background: transparent;
    color: white;
    border: 0;
    font-size: 22px;
}

.chat {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
}

.welcome {
    width: 100%;
    max-width: 760px;
    margin: 5vh auto 30px;
    text-align: center;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    border-radius: 22px;
    font-size: 32px;
    box-shadow: 0 0 45px #7866ff26;
}

.welcome h1 {
    font-size: clamp(23px, 4vw, 34px);
    margin-bottom: 12px;
}

.welcome > p {
    color: var(--muted);
    font-size: 15px;
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 35px;
    text-align: right;
}

.suggestion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 17px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    transition: .2s;
}

.suggestion:hover {
    border-color: var(--accent);
    background: var(--panel-light);
    transform: translateY(-2px);
}

.suggestion > span {
    font-size: 22px;
}

.suggestion strong {
    font-size: 13px;
}

.suggestion small {
    color: var(--muted);
    font-size: 12px;
}

.composer-wrap {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    padding: 15px 20px 12px;
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px;
    border: 1px solid #35415b;
    background: var(--panel);
    border-radius: 18px;
    box-shadow: 0 10px 40px #00000020;
}

.composer:focus-within {
    border-color: var(--accent);
}

.composer textarea {
    flex: 1;
    min-width: 0;
    max-height: 150px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    padding: 10px;
    line-height: 1.8;
}

.composer textarea::placeholder {
    color: #77849c;
}

.composer button {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    color: white;
    background: var(--accent);
    font-size: 22px;
}

.composer button:disabled {
    opacity: .5;
    cursor: wait;
}

.disclaimer {
    color: #77849c;
    text-align: center;
    font-size: 11px;
    margin: 10px 0 0;
}

.message {
    display: flex;
    gap: 11px;
    max-width: 760px;
    margin: 0 auto 24px;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #242044;
    color: var(--accent-light);
}

.message.user .message-avatar {
    background: #25334c;
    color: white;
}

.message-content {
    max-width: calc(100% - 50px);
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.9;
    font-size: 14px;
}

.message.user .message-content {
    background: #242044;
    border-color: #39315f;
}

.message-content.error {
    border-color: #8b3f4a;
    color: #ffb4be;
}

@media (max-width: 700px) {
    .sidebar {
        position: fixed;
        z-index: 10;
        top: 0;
        bottom: 0;
        right: 0;
        width: 270px;
        transform: translateX(100%);
        transition: transform .2s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu {
        display: block;
    }

    .topbar {
        min-height: 68px;
        padding: 12px 15px;
    }

    .chat {
        padding: 20px 13px;
    }

    .welcome {
        margin-top: 3vh;
    }

    .suggestions {
        gap: 9px;
        margin-top: 25px;
    }

    .suggestion {
        padding: 13px;
    }

    .composer-wrap {
        padding: 10px 12px;
    }

    .disclaimer {
        font-size: 10px;
    }
}

@media (max-width: 380px) {
    .suggestions {
        grid-template-columns: 1fr;
    }
}

.auth-container {
    width: min(420px, calc(100% - 32px));
    margin: 70px auto;
    padding: 28px;
    background: #171923;
    color: #fff;
    border: 1px solid #303443;
    border-radius: 18px;
    font-family: Tahoma, sans-serif;
}

.auth-container h1 {
    margin-top: 0;
    font-size: 25px;
}

.auth-container p {
    color: #b8bdca;
    line-height: 1.9;
}

.auth-container label {
    display: block;
    margin: 18px 0 8px;
}

.auth-container input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px;
    border: 1px solid #3b4152;
    border-radius: 9px;
    background: #10121a;
    color: #fff;
    font-size: 15px;
}

.auth-container button {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    border: 0;
    border-radius: 9px;
    background: #6655e8;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.auth-container a {
    color: #9b8eff;
}

.auth-error {
    padding: 10px;
    border-radius: 8px;
    background: #48252d;
    color: #ffb6c0 !important;
}
