* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.form-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    animation: slideIn 0.5s ease-out;
}

.chat-container {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.header h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.header p {
    color: #666;
    font-size: 1rem;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #667eea;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #f0f0f0;
    transform: translateX(-2px);
}

/* Form Styles */
.input-group, .question-group {
    margin-bottom: 20px;
}

.input-group label, .question-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-group input, .input-group textarea, .question-group input, .question-group textarea, .question-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus, .input-group textarea:focus, .question-group input:focus, .question-group textarea:focus, .question-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.radio-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

.radio-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.question-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Chat Styles */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.info h3 {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.status {
    font-size: 0.9rem;
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ai-message .message-content {
    background: #e3f2fd;
    color: #1565c0;
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

.user-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
    margin-left: 16px;
}

.user-message .message-time {
    margin-left: 0;
    margin-right: 16px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.end-chat-btn {
    width: 100%;
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.end-chat-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header h2 {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}