/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* === SCREENS === */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* === LOGO === */
.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.logo-small {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

/* === SCREEN 1: WELCOME === */
.welcome-container {
    max-width: 600px;
    padding: 40px 24px;
    text-align: center;
}

.welcome-container h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.2;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

.benefits {
    text-align: left;
    margin-bottom: 32px;
}

.benefit {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.benefit-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.benefit strong {
    display: block;
    margin-bottom: 2px;
    font-size: 15px;
}

.benefit p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

.time-info {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* === SCREEN 2: FORM === */
.form-container {
    max-width: 480px;
    width: 100%;
    padding: 40px 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin: 20px;
}

.form-container h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.form-container > p {
    color: var(--text-light);
    margin-bottom: 28px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-container .btn {
    width: 100%;
    margin-top: 8px;
}

/* === SCREEN 3: CHAT === */
.screen#screen-chat.active {
    align-items: stretch;
    padding: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.consultant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.consultant-name {
    font-weight: 600;
    font-size: 15px;
}

.consultant-status {
    font-size: 12px;
    color: #22c55e;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.5;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-ai {
    background: var(--white);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-user {
    background: var(--primary);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-system {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-light);
    align-self: center;
    text-align: center;
    font-size: 13px;
    padding: 8px 16px;
    max-width: 100%;
}

.message-ai p {
    margin-bottom: 8px;
}

.message-ai p:last-child {
    margin-bottom: 0;
}

.message-ai strong {
    font-weight: 600;
}

.message-ai ul, .message-ai ol {
    margin: 4px 0 8px 20px;
}

.message-ai li {
    margin-bottom: 2px;
}

/* Chat input */
.chat-input-area {
    padding: 12px 20px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
    position: relative;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-light);
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

.chat-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-form textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-form textarea::placeholder {
    color: #94a3b8;
}

.btn-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-send:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-send:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* === SCREEN 4: THANKS === */
.thanks-container {
    max-width: 600px;
    padding: 40px 24px;
    text-align: center;
}

.thanks-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.thanks-container h2 {
    font-size: 28px;
    margin-bottom: 24px;
}

.thanks-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    text-align: left;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.thanks-summary:empty {
    display: none;
}

.thanks-info {
    text-align: left;
    margin-bottom: 32px;
}

.thanks-info h3 {
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
}

.next-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step p {
    font-size: 14px;
    color: var(--text);
    padding-top: 3px;
}

.thanks-contact {
    color: var(--text-light);
    font-size: 14px;
}

.thanks-contact p {
    margin-bottom: 4px;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .welcome-container h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 16px;
    }

    .message {
        max-width: 90%;
    }

    .chat-container {
        box-shadow: none;
    }
}
