:root {
    --mohi-deep-blue: #1c3c54;
    --mohi-green: #8bc53f;
    --mohi-dark-bg: #0a1a26;
    --mohi-dark-surface: #122232;
    --text-light: #0f172a;
    --text-muted: #475569;
    --border-light: #dbe4ee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 100%);
    color: var(--text-light);
}

body.dark {
    background: radial-gradient(circle at top, #163247 0%, var(--mohi-dark-bg) 55%);
    color: #e2e8f0;
}

.page-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem 6rem;
}

.hero {
    max-width: 42rem;
    text-align: center;
}

.hero-logo {
    width: 6rem;
    height: 6rem;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
}

.hero-script,
.chat-brand p {
    margin: 0;
    color: var(--mohi-green);
    font-family: "Caveat", cursive;
    font-size: 2rem;
}

.hero-card {
    margin-top: 2rem;
    padding: 1.75rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 45px rgba(28, 60, 84, 0.12);
}

body.dark .hero-card {
    background: rgba(18, 34, 50, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-muted {
    color: var(--text-muted);
}

body.dark .hero-muted {
    color: #94a3b8;
}

.accent {
    color: var(--mohi-green);
    font-weight: 700;
}

.chat-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 4rem;
    height: 4rem;
    border: 0;
    border-radius: 999px;
    background: var(--mohi-green);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(139, 197, 63, 0.3);
    animation: fabPulse 2s infinite;
}

.chat-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: min(25rem, calc(100vw - 2rem));
    height: min(37.5rem, calc(100vh - 5rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    animation: chatSlideUp 0.25s ease-out;
}

body.dark .chat-widget {
    background: var(--mohi-dark-bg);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.hidden {
    display: none !important;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--mohi-deep-blue);
    color: #fff;
}

body.dark .chat-header {
    background: var(--mohi-dark-surface);
}

.chat-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-brand h2 {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.chat-logo {
    width: 2.5rem;
    height: 2.5rem;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-button {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
}

body.dark .chat-messages {
    background: var(--mohi-dark-bg);
}

.welcome-state {
    padding: 1.5rem 0;
    text-align: center;
}

.welcome-icon {
    width: 4rem;
    height: 4rem;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 999px;
    background: rgba(139, 197, 63, 0.16);
    font-size: 1.75rem;
}

.quick-actions,
.quick-actions-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-actions {
    justify-content: center;
    margin-top: 1.5rem;
}

.quick-actions-bar {
    padding: 0.75rem 1rem;
    overflow-x: auto;
    border-top: 1px solid var(--border-light);
    background: #fff;
}

body.dark .quick-actions-bar {
    background: var(--mohi-dark-surface);
    border-top-color: rgba(148, 163, 184, 0.18);
}

.quick-action-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--mohi-deep-blue);
    background: #eef2f7;
}

body.dark .quick-action-btn {
    background: var(--mohi-dark-surface);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.18);
}

.message-wrap {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.9rem;
    animation: slideUp 0.2s ease-out;
}

.message-wrap.user {
    align-items: flex-end;
}

.message-wrap.assistant {
    align-items: flex-start;
}

.message-bubble {
    max-width: 85%;
    padding: 0.85rem 1rem;
    border-radius: 1.1rem;
    line-height: 1.5;
}

.message-wrap.user .message-bubble {
    background: var(--mohi-green);
    color: #fff;
    border-bottom-right-radius: 0.35rem;
}

.message-wrap.assistant .message-bubble {
    background: var(--mohi-deep-blue);
    color: #fff;
    border-bottom-left-radius: 0.35rem;
}

body.dark .message-wrap.assistant .message-bubble {
    background: var(--mohi-dark-surface);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.message-bubble p {
    margin: 0 0 0.5rem;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.feedback-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.feedback-row button,
.feedback-chip {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
}

.feedback-row button {
    padding: 0.2rem 0.45rem;
    background: transparent;
    color: inherit;
}

.feedback-reasons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.feedback-chip {
    padding: 0.35rem 0.7rem;
    background: #eef2f7;
    color: #334155;
}

body.dark .feedback-chip {
    background: var(--mohi-dark-surface);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.typing-indicator {
    width: fit-content;
    display: flex;
    gap: 0.35rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.9rem;
    border-radius: 1rem;
    border-bottom-left-radius: 0.35rem;
    background: var(--mohi-deep-blue);
}

body.dark .typing-indicator {
    background: var(--mohi-dark-surface);
}

.typing-indicator span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--mohi-green);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

.chat-input-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
    background: #fff;
}

body.dark .chat-input-row {
    background: var(--mohi-dark-surface);
    border-top-color: rgba(148, 163, 184, 0.18);
}

.chat-input-row input {
    flex: 1;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1rem;
    font: inherit;
    background: #f1f5f9;
    color: inherit;
}

body.dark .chat-input-row input {
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-input-row button {
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    background: var(--mohi-green);
    color: #fff;
}

.chat-input-row button:disabled {
    cursor: not-allowed;
    background: #cbd5e1;
    color: #64748b;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 197, 63, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(139, 197, 63, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(139, 197, 63, 0);
    }
}

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

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .chat-widget {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
        height: calc(100vh - 2rem);
    }

    .chat-fab {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}
