:root {
    --primary-color: #2563eb;
    --primary-light: #dbeafe;
    --error-color: #ef4444;
    --border-color: #e5e7eb;
    --text-color: #1f2937;
    --background-color: #f9fafb;
    --card-background: #ffffff;
    --subsection-bg-1: #f8fafc;
    --subsection-bg-2: #f9fafb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.form-header h1 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.logo-container {
    flex-shrink: 0;
    width: 80px;  /* Adjust size as needed */
    height: 80px;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-content {
    flex-grow: 1;
}

.form-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
    font-size: 0.875rem;
}

.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--primary-light);
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.subsection {
    margin-bottom: 3rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: var(--subsection-bg-1);
}

.subsection:nth-child(even) {
    background-color: var(--subsection-bg-2);
}

/* Add more space between the last form-group and the next subsection */
.subsection .form-group:last-child {
    margin-bottom: 1rem;
}

.subsection-header {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

label.required::after {
    /*content: "*"; */
    color: var(--error-color);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control:read-only {
    background-color: var(--background-color);
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conditional-fields {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    border-left: 2px solid var(--primary-light);
}

.conditional-fields.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.diagnosis-entry {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-add {
    width: 100%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.75rem;
    margin-top: 1rem;
}

.btn-remove-diagnosis {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 0.5rem 1rem;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.btn-previous {
    background-color: var(--background-color);
    color: var(--text-color);
}

.btn-next {
    background-color: var(--primary-color);
    color: white;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Add or update these styles in your CSS */
.form-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.form-section.active {
    display: block;
    opacity: 1;
}

/* Update progress fill for section 2 */
.progress-fill {
    /* ... existing styles ... */
    width: 18.18%; /* For section 2 - represents 2/11 sections */
}

/* Add more space after select groups */
.form-group + .form-group {
    margin-top: 2rem;  /* Increased from 1.25rem */
}

select.form-control {
    margin-bottom: 1.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.radio-group {
    margin-bottom: 1rem;
}

#imaginaryPlayDetails {
    margin-top: 1rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-option .inline-input {
    width: calc(100% - 2rem);
    margin: 0.5rem 0 0 2rem;
}

.checkbox-option input[type="checkbox"],
.checkbox-option label {
    margin: 0;
    line-height: 1;
    padding: 0.15rem 0;
}

.sibling-entry {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.sibling-entry .btn-remove-sibling {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background-color: #fee2e2;
    color: #dc2626;
}

#siblingsList {
    margin-bottom: 1.5rem;
}

.therapy-entry,
.specialist-entry {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.duration-input {
    display: flex;
    gap: 1rem;
}

.duration-input .form-control {
    flex: 1;
}

.duration-input select.form-control {
    width: auto;
    min-width: 100px;
}

.btn-remove-therapy,
.btn-remove-specialist {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background-color: #fee2e2;
    color: #dc2626;
}

.group-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Add these spacing rules after the consolidated .group-title definition */
.form-group:first-child .group-title {
    margin-top: 0;  /* Removes top margin when group-title is the first element in a form-group */
}

.conditional-fields .form-group:last-child {
    margin-bottom: 0;  /* Removes bottom margin of the last form-group within conditional fields */
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-with-suffix,
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-suffix input,
.input-with-unit input {
    flex: 1;
}

.input-with-unit .unit-select {
    width: auto;
    min-width: 80px;
}

.suffix {
    color: var(--text-color);
    white-space: nowrap;
    padding: 0.75rem 0;
}

/* Behavior grid styles */
.behavior-grid {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.behavior-grid-header {
    background-color: var(--primary-light);
    padding: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.behavior-grid-header .behavior-options {
    display: flex;
    gap: 2rem;
}

.behavior-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.behavior-item:last-child {
    border-bottom: none;
}

.behavior-item:nth-child(even) {
    background-color: var(--background-color);
}

.behavior-description {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.behavior-options {
    display: flex;
    gap: 2rem;
}

.behavior-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subsection-description {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.behavior-item.error {
    background-color: rgba(239, 68, 68, 0.1);  /* Light red background */
    border-left: 3px solid var(--error-color);
}

/* Smooth transition for error state */
.behavior-item {
    transition: background-color 0.3s ease, border-left 0.3s ease;
}

.radio-option input[type="radio"],
.behavior-option input[type="radio"] {
    margin: 0;  /* Reset any default margins */
}

.radio-option label,
.behavior-option label {
    margin: 0;  /* Reset any default margins */
    line-height: 1;  /* Ensure text doesn't have extra line height */
    padding: 0.15rem 0;  /* Small padding to match radio button height */
}

.thank-you-content {
    text-align: center;
    padding: 3rem 1rem;
}

.thank-you-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    opacity: 0.9;
}

.milestones-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--subsection-bg-1);
    border-radius: 0.5rem;
}

.milestone-header {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.milestone-instruction {
    color: var(--text-color);
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.milestone-item {
    margin-bottom: 1rem;
}

.milestone-item label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.milestone-item input {
    width: 100%;
}

.info-list {
    list-style: none;
    margin: 1rem 0;
}

    .info-list li {
        margin-bottom: 0.75rem;
        padding-left: 1.5rem;
        position: relative;
    }

        .info-list li:before {
            content: "*";
            color: var(--primary-color);
            font-weight: bold;
            position: absolute;
            left: 0;
        }

@media (max-width: 640px) {

    .sibling-entry {
        padding-top: 4rem; /* Increased top padding to accommodate the button */
    }
    
    .sibling-entry .btn-remove-sibling {
        right: auto;  /* Reset right positioning */
        left: 1rem;   /* Align to left with padding */
        top: 1rem;
        width: calc(100% - 2rem); /* Full width minus padding */
        text-align: center;
    }

    .container {
        padding: 1rem;
    }

    .form-card {
        padding: 1rem;
    }

    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .checkbox-option .inline-input {
        width: auto;
        margin: 0 0 0 1rem;
        flex: 1;
        min-width: 200px; /* Ensure minimum width on desktop */
    }

    .therapy-entry,
    .specialist-entry {
        padding-top: 4rem;
    }
    
    .btn-remove-therapy,
    .btn-remove-specialist {
        right: auto;
        left: 1rem;
        top: 1rem;
        width: calc(100% - 2rem);
        text-align: center;
    }
    
    .duration-input {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .duration-input select.form-control {
        width: 100%;
    }

    .input-with-unit {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .input-with-unit .unit-select {
        width: 100%;
    }

    .behavior-grid-header,
    .behavior-item {
        grid-template-columns: 1fr auto;
    }

    .behavior-description {
        font-size: 0.9rem;
        padding-right: 0.5rem;
    }

    .behavior-options {
        gap: 0.25rem;
    }

    .behavior-grid-header .behavior-options span {
        font-size: 0.8rem;
    }

    .behavior-options {
        display: flex;
        flex-direction: column;
        gap: 1rem;  /* Increased from 0.5rem for more breathing space */
        margin-left: 1rem;
        padding-top: 0.5rem;  /* Added to give space between description and options */
    }

    .milestone-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .milestones-section {
        padding: 1rem;
    }

    .milestone-item {
        margin-bottom: 0.75rem;
    }

    textarea::placeholder {
        font-size: 0.875rem; /* 14px */
        line-height: 1.25;
    }
}

