html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 1rem;
    background-color: #f0f0f0;
    font-size: 1rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

.header-logo {
    max-width: 100%;
    height: auto;
    width: 250px; /* Adjust as needed */
}

h1 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

form {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

fieldset {
    border: none;
    margin-bottom: 1.25rem;
    padding: 0;
}

legend {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.subtext {
    font-size: 0.875rem;
    color: #666;
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.2;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.options-grid-3col {
    grid-template-columns: repeat(3, 1fr);
}

.options-grid-2col {
    grid-template-columns: repeat(2, 1fr);
}

label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    background-color: #f9f9f9;
    padding: 0.75rem;
    border-radius: 5px;
    height: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

label:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

input[type="radio"], input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
    accent-color: #4CAF50;
}

input[type="radio"]:checked + span, input[type="checkbox"]:checked + span {
    font-weight: bold;
    color: #4CAF50;
}

input[type="radio"]:checked + span::before, input[type="checkbox"]:checked + span::before {
    content: '✓ ';
    color: #4CAF50;
}

label:has(input[type="radio"]:checked), label:has(input[type="checkbox"]:checked) {
    background-color: #e6f7e6;
    border: 2px solid #4CAF50;
    box-shadow: 0 4px 8px rgba(76,175,80,0.3);
}

input[type="file"] {
    margin-top: 0.5rem;
    width: 100%;
}

input[type="submit"],
.btn {
    background-color: #4CAF50;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

input[type="submit"]:hover,
.btn:hover {
    background-color: #45a049;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    width: calc(100% - 1.5rem);
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-input-wrapper:hover {
    background-color: #45a049;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-input-wrapper input[type="file"] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 3rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

input[type="text"] {
    min-height: auto;
}

textarea:focus, input[type="text"]:focus {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    outline: none;
}

.question-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 1.5rem 0;
    border: none;
}

.hidden {
    display: none;
}

#imagePreview {
    max-width: 100%;
    height: auto;
    margin-top: 0.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.footer {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .header-logo {
        width: 250px;
    }
    .options-grid, 
    .options-grid-2col, 
    .options-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
    .options-grid-3col {
        grid-template-columns: repeat(3, 1fr);
    }
    label {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
    .header-logo {
        width: 200px;
    }
    .options-grid, 
    .options-grid-2col, 
    .options-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

fieldset.invalid {
    border: 2px solid #e74c3c;
    padding: 10px;
    border-radius: 5px;
}

fieldset.invalid legend {
    color: #e74c3c;
}
#currentWeightDisplay {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    transition: background-color 0.3s ease;
}

/* When weight is locked, change the container's background to green */
#currentWeightDisplay.locked {
    background-color: #4CAF50;
    color: white; /* Optionally change text color for contrast */
}
