:root {
    /* Premium Blue Palette */
    --primary-color: #4F46E5;
    /* Indigo-600 */
    --secondary-color: #4338ca;
    /* Indigo-700 */
    --accent-color: #818cf8;
    /* Indigo-400 */

    --bg-color: #F5F7FF;
    /* Very light blue tint */
    --bg-card: #FFFFFF;

    --text-main: #1E1B4B;
    /* Dark Indigo (almost black) */
    --text-muted: #6B7280;
    /* Cool Gray */
    --text-light: #9CA3AF;

    --border-color: #E0E7FF;
    /* Light Indigo border */
    --input-bg: #EEF2FF;
    /* Light Indigo background */

    /* Typography */
    --font-family: 'Inter', sans-serif;

    /* Spacing */
    --spacing-sm: 12px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 64px;

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(79, 70, 229, 0.05);
    --shadow-hover: 0 10px 30px rgba(79, 70, 229, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-md);
    width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* Sections - Seamless Look */
.section {
    display: none;
    /* No background or shadow by default for a seamless feel */
    padding: var(--spacing-lg) 0;
    animation: fadeIn 0.6s ease-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menvy Branding */
.menvy-brand {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-lg);
}

.menvy-logo {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 10px;
    position: relative;
}

.menvy-tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
}

.instruction-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Forms & Inputs */
form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input[type="email"],
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 18px 24px;
    border: none;
    background: var(--input-bg);
    border-radius: 50px;
    /* Pill shape */
    font-size: 1.1rem;
    font-family: var(--font-family);
    color: var(--text-main);
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px var(--text-main);
}

button {
    width: 100%;
    padding: 18px 32px;
    background: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* Questionnaire Options */
.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: var(--spacing-lg);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.option-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-main);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-soft);
}

.option-btn:hover {
    border-color: var(--text-main);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.option-btn.selected {
    background: var(--text-main);
    color: #FFFFFF;
    border-color: var(--text-main);
    transform: translateY(-2px);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.progress-bar {
    height: 100%;
    background: var(--text-main);
    width: 0%;
    transition: width 0.5s ease;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    border-color: var(--text-main);
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 16px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-item input[type="checkbox"]:checked+.checkmark {
    background: var(--text-main);
    border-color: var(--text-main);
}

.checkbox-item input[type="checkbox"]:checked+.checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
}

#question-counter {
    display: none;
}

/* Results Section */
#score-display {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

#score-number {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

#score-category {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

#score-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

#recommendations {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    max-width: 800px;
    margin: 0 auto;
}

#recommendations h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

#recommendation-list {
    list-style: none;
    padding: 0;
}

#recommendation-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 30px;
    color: var(--text-main);
}

#recommendation-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

#recommendation-list li:last-child {
    border-bottom: none;
}

/* Menvy Chat Section */
.menvy-chat-section {
    background: linear-gradient(135deg, var(--input-bg) 0%, var(--bg-card) 100%);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-soft);
}

.menvy-chat-section h3 {
    font-size: 1.6rem;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.menvy-chat-section p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.7;
}

.menvy-chat-section .trusted-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.menvy-chat-section .trusted-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

.chat-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.chat-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.chat-info {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    font-size: 1.5rem;
}

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

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: none;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-color);
}

.chat-message {
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
}

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

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

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

.chat-message .message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-message.assistant .message-content {
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-soft);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: var(--font-family);
    background: var(--input-bg);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .menvy-logo {
        font-size: 3rem;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 20px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .chat-window {
        width: calc(100% - 20px);
        height: calc(100% - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        border-radius: 16px;
    }

    .menvy-chat-section {
        padding: 24px;
    }

    .menvy-chat-section h3 {
        font-size: 1.3rem;
    }
}