/* Form fields */
.form-field {
    margin-bottom: 0.75rem;
}

/* Input field styling */
.input-field {
    flex: 1;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    color: hsl(222.2 84% 4.9%);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    .input-field {
        border: 1px solid hsl(217.2 32.6% 17.5%);
        background-color: hsl(217.2 32.6% 17.5%);
        color: hsl(210 40% 98%);
    }
}

.input-field:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

@media (prefers-color-scheme: dark) {
    .input-field:focus {
        box-shadow: 0 0 0 2px hsl(212.7 26.8% 83.9%);
    }
}

.input-field:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

@media (prefers-color-scheme: dark) {
    .input-field:focus-visible {
        box-shadow: 0 0 0 2px hsl(212.7 26.8% 83.9%);
    }
}

.input-field::placeholder {
    color: hsl(215.4 16.3% 46.9%);
}

@media (prefers-color-scheme: dark) {
    .input-field::placeholder {
        color: hsl(215 20.2% 65.1%);
    }
}

.input-field:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.checkbox-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
}

.checkbox-box {
    height: 1rem;
    width: 1rem;
    border-radius: 0.125rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition-property: all;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    .checkbox-box {
        border: 1px solid hsl(217.2 32.6% 45%);
        background-color: hsl(217.2 32.6% 17.5%);
    }
}

.checkbox-box::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background-color: hsl(210 40% 98%);
    border-radius: 0.125rem;
    opacity: 0;
    transition-property: opacity;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-input:checked + .checkbox-label .checkbox-box {
    background-color: hsl(222.2 47.4% 11.2%);
    border-color: hsl(222.2 47.4% 11.2%);
}

.checkbox-input:checked + .checkbox-label .checkbox-box::after {
    opacity: 1;
}

.checkbox-input:focus + .checkbox-label .checkbox-box {
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

@media (prefers-color-scheme: dark) {
    .checkbox-input:focus + .checkbox-label .checkbox-box {
        box-shadow: 0 0 0 2px hsl(212.7 26.8% 83.9%);
    }
}

/* Info button styling */
.info-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Info panel styling */
.info-panel {
    display: none;
    margin-top: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(210 40% 96%);
    padding: 0.75rem;
}

@media (prefers-color-scheme: dark) {
    .info-panel {
        border: 1px solid hsl(217.2 32.6% 17.5%);
        background-color: hsl(217.2 32.6% 17.5%);
    }
}

.info-panel.show {
    display: block;
}

/* Submit button styling */
.submit-button {
    inline-size: 100%;
    border-radius: 0.375rem;
    background-color: hsl(222.2 47.4% 11.2%);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(210 40% 98%);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition-property: all;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    .submit-button {
        background-color: hsl(210 40% 98%);
        color: hsl(222.2 47.4% 11.2%);
        box-shadow: 0 1px 2px 0 rgb(255 255 255 / 0.1);
    }
}

.submit-button:hover {
    background-color: hsl(222.2 47.4% 9%);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

@media (prefers-color-scheme: dark) {
    .submit-button:hover {
        background-color: hsl(210 40% 95%);
        box-shadow: 0 4px 6px -1px rgb(255 255 255 / 0.1), 0 2px 4px -2px rgb(255 255 255 / 0.1);
    }
}

.submit-button:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

@media (prefers-color-scheme: dark) {
    .submit-button:focus {
        box-shadow: 0 0 0 2px hsl(212.7 26.8% 83.9%);
    }
}

.submit-button:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Loading state for submit button */
.submit-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-button.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card styling enhancements */
.card {
    background-color: hsl(0 0% 100%);
    border: 1px solid hsl(214.3 31.8% 91.4%);
    color: hsl(222.2 84% 4.9%);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: box-shadow 0.2s ease-in-out;
}

@media (prefers-color-scheme: dark) {
    .card {
        background-color: hsl(222.2 84% 4.9%);
        border: 1px solid hsl(217.2 32.6% 17.5%);
        color: hsl(210 40% 98%);
    }
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Override any existing form styles */
form {
    display: block !important;
    flex-wrap: unset !important;
    justify-content: unset !important;
    max-width: unset !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.form-group {
    width: auto !important;
    margin-bottom: 0 !important;
}

button:not(.info-button):not(.submit-button) {
    display: none !important;
}


/* Two column form layout for better space utilization */
.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .form-columns {
        grid-template-columns: 1fr;
    }
}

/* Age field should span full width */
.age-field {
    grid-column: 1 / -1;
}

/* Submit button should span full width */
.submit-field {
    grid-column: 1 / -1;
}

/* Graph container styling */
#result {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);
}

@media (prefers-color-scheme: dark) {
    #result {
        border: 1px solid hsl(217.2 32.6% 17.5%);
    }
}

/* Center placeholder content when no graph is shown */
#result .text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 360px;
}

/* Plotly graph styling */
#result .plotly-graph-div {
    width: 100% !important;
    height: 100% !important;
    max-height: 400px !important;
}
