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

:root {
    --primary: #4CAF50;
    --primary-hover: #43A047;
    --secondary: #FFF59D;
    --accent: #8BC34A;
    --bg: #FAFAFA;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --ai-bubble: #E8F5E9;
    --user-bubble: #4CAF50;
    --success: #4CAF50;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
}

header {
    text-align: center;
    padding: 2rem 0;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
}

header .subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

main {
    flex: 1;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.message.ai {
    background: var(--ai-bubble);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    border-left: 3px solid var(--primary);
}

.message.user {
    background: var(--user-bubble);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.message.loading {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
}

.message.loading span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

#input-area {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

#start-screen {
    padding: 3rem 1.5rem;
    text-align: center;
}

#start-screen p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form inputs */
.input-group {
    display: flex;
    gap: 0.5rem;
}

.text-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Options (radio/checkbox) */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--primary);
    background: var(--ai-bubble);
}

.option-item input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

.option-item input:checked + label {
    color: var(--primary);
    font-weight: 500;
}

.option-item label {
    flex: 1;
    cursor: pointer;
}

/* Yes/No toggle */
.yes-no-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.yes-no-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.yes-no-btn:hover {
    border-color: var(--primary);
    background: var(--ai-bubble);
}

.yes-no-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Date input */
.date-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.date-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Number input */
.number-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.number-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Progress bar */
footer {
    padding: 1rem 0;
}

#progress {
    height: 6px;
    background: #ffffff;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border);
}

#progress-bar {
    height: 100%;
    background: #81C784;
    width: 0%;
    transition: width 0.3s ease;
}

/* Completion screen */
.completion-message {
    text-align: center;
    padding: 2rem;
}

.completion-message .checkmark {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    header {
        padding: 1.5rem 0;
    }

    main {
        border-radius: 0;
    }
}
