* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
}

html,
body {
    font-family: 'Vazirmatn', sans-serif;
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

/* Wizard */
.wizard-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wizard-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    width: 100%;
}

.wizard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 30px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    color: white;
}

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

.logo-icon {
    width: 64px;
    height: 64px;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.logo-text p {
    font-size: 14px;
    opacity: 0.9;
}

.subtitle {
    margin-top: 16px;
    opacity: 0.85;
    font-size: 14px;
}

.progress-section {
    padding: 24px 30px 0;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 33.33%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

.question-slide {
    display: none;
    padding: 24px 30px 30px;
}

.question-slide.active {
    display: block;
}

.question-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 15px;
    text-align: right;
}

.option-btn:hover {
    border-color: var(--success);
    transform: translateX(-2px);
}

.option-btn.selected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.emoji {
    font-size: 24px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    padding: 0 30px 30px;
}

.nav-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-btn.primary {
    background: var(--success);
    color: white;
}

.nav-btn.primary:hover {
    opacity: 0.9;
}

.nav-btn.secondary {
    background: var(--bg);
    color: var(--text);
}

/* Chat */
#custom-chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

#chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

#chat-header img {
    width: 40px;
    height: 40px;
}

#chat-header h2 {
    font-size: 18px;
    margin: 0;
}

#chat-header p {
    font-size: 12px;
    opacity: 0.85;
    margin: 0;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 70%;
    margin-bottom: 8px;
    display: flex;
}

.message.user-message {
    align-self: flex-start;
    /* Right side in RTL */
}

.message.system-message {
    align-self: flex-end;
    /* Left side in RTL */
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message.system-message .message-bubble {
    background: white;
    color: var(--text);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
}

#user-input:focus {
    outline: none;
    border-color: var(--primary);
}

#send-btn {
    padding: 12px 24px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

#send-btn:hover {
    opacity: 0.9;
}

.message-content {
    line-height: 1.6;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 1em 0 0.5em;
    font-weight: 600;
}

.message-content p {
    margin: 0.5em 0;
}

.message-content ul,
.message-content ol {
    margin: 0.5em 0;
    padding-right: 1.5em;
}

.message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
    margin: 0.8em 0;
}

.message-content pre code {
    background: none;
    color: #d4d4d4;
    padding: 0;
}

@media (max-width: 640px) {
    .wizard-header {
        padding: 30px 20px;
    }

    .question-slide {
        padding: 20px;
    }

    .nav-buttons {
        padding: 0 20px 20px;
    }

    #messages {
        padding: 16px;
    }
}