/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2d3748;
}

/* Form container */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.healthcare-form {
    padding: 40px;
    position: relative;
}

/* Progress bar */
.progress-container {
    margin-bottom: 40px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #9424a5;
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 20%; /* Updated width for 5 steps */
}

.progress-text {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Form steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step content */
.step-content {
    text-align: center;
}

.step-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 16px;
    line-height: 1.3;
}

.step-subtitle {
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Option cards */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.option-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: #9424a5;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(148, 36, 165, 0.15);
    background: #faf8ff;
}

.option-card.selected {
    border-color: #9424a5;
    background: #9424a5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(148, 36, 165, 0.3);
}

.option-card.selected:hover {
    background: #7c1d8f;
    border-color: #7c1d8f;
}

.option-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.option-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.option-description {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.checkbox-card {
    position: relative;
    cursor: pointer;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-content {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.checkbox-card:hover .checkbox-content {
    border-color: #9424a5;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(148, 36, 165, 0.1);
}

.checkbox-card input:checked + .checkbox-content {
    border-color: #9424a5;
    background: #9424a5;
    color: white;
}

.checkbox-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.checkbox-content span {
    font-weight: 500;
    font-size: 14px;
}

/* Input groups */
.input-group {
    margin-bottom: 24px;
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #9424a5;
    box-shadow: 0 0 0 3px rgba(148, 36, 165, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Alternative section */
.alternative-section {
    margin-top: 40px;
}

.divider {
    position: relative;
    text-align: center;
    margin: 30px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: white;
    padding: 0 20px;
    color: #64748b;
    font-size: 14px;
    position: relative;
}

.secondary-btn {
    background: #f8fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.secondary-btn:hover {
    border-color: #9424a5;
    color: #9424a5;
    background: #faf5ff;
}

/* Form navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.nav-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prev-btn {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.prev-btn:hover:not(:disabled) {
    background: #e2e8f0;
    color: #4a5568;
}

.prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn,
.submit-btn {
    background: #9424a5;
    color: white;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.next-btn:hover,
.submit-btn:hover {
    background: #7c1d8f;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(148, 36, 165, 0.3);
}

/* Utility classes */
.mt-4 {
    margin-top: 24px;
}

/* Responsive design */
@media (max-width: 768px) {
    .healthcare-form {
        padding: 24px;
    }
    
    .step-title {
        font-size: 24px;
    }
    
    .step-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .checkbox-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .form-navigation {
        flex-direction: column-reverse;
        gap: 16px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .form-container {
        border-radius: 16px;
    }
    
    .healthcare-form {
        padding: 20px;
    }
    
    .step-title {
        font-size: 20px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .option-card {
        padding: 20px;
    }
}

/* Loading states and animations */
.nav-btn:active {
    transform: translateY(0);
}

.nav-btn.loading {
    position: relative;
    color: transparent;
}

.nav-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
.option-card:focus,
.checkbox-card:focus,
.nav-btn:focus {
    outline: 2px solid #9424a5;
    outline-offset: 2px;
}

/* Form validation styles */
.input-group input:invalid:not(:placeholder-shown),
.input-group select:invalid:not(:placeholder-shown),
.input-group textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.input-group input.invalid,
.input-group select.invalid,
.input-group textarea.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.input-group input.valid,
.input-group select.valid,
.input-group textarea.valid {
    border-color: #49a64a;
    background-color: #f0fdf4;
}

.input-group input:valid:not(:placeholder-shown),
.input-group select:valid:not(:placeholder-shown),
.input-group textarea:valid:not(:placeholder-shown) {
    border-color: #49a64a;
    background-color: #f0fdf4;
}

/* Success message styles */
.success-message {
    text-align: center;
    padding: 40px;
    color: #166534;
    background: #f0fdf4;
    border-radius: 16px;
    margin: 20px 0;
}

.success-message h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #15803d;
}

.success-message p {
    font-size: 16px;
    opacity: 0.8;
}