/* --- Global Styles & Variables --- */
:root {
    --primary-color: #6a1b9a; /* Deep Purple */
    --secondary-color: #ab47bc; /* Lighter Purple */
    --accent-color: #4db6ac; /* Teal */
    --background-light: #f3e5f5; /* Very Light Purple */
    --background-main: #ffffff;
    --text-dark: #333333;
    --text-light: #555555;
    --border-color: #e0e0e0;
    --warning-bg: #fff3cd;
    --warning-border: #ffeeba;
    --warning-text: #856404;
    --danger-text: #a94442;
}

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.7;
    margin: 0;
    background-color: var(--background-light);
    color: var(--text-dark);
    font-size: 16px; /* Base font size */
}

.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: var(--background-main);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h1, h2, legend {
    color: var(--primary-color);
    font-weight: 700; /* Bold */
}

h1 {
    font-size: 2.2em; /* Larger */
    text-align: center;
    margin-bottom: 0.2em;
}

h2 {
    font-size: 1.6em; /* Larger */
    margin-bottom: 1em;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.3em;
}

p {
    margin-bottom: 1em;
    color: var(--text-light);
}

/* --- Header --- */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 30px; /* Add space below header */
}
.main-header h1 {
    color: white;
    margin-bottom: 0.1em;
}
.main-header .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    margin-top: 0;
}


/* --- Disclaimer --- */
.disclaimer {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left: 6px solid var(--accent-color); /* Accent border */
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}
.disclaimer h2 {
    text-align: left;
    margin-top: 0;
    color: var(--primary-color); /* Match theme */
    font-size: 1.3em;
    display: flex;
    align-items: center;
    border-bottom: none; /* Remove border for disclaimer heading */
    padding-bottom: 0;
}
.warning-icon {
    font-size: 1.6em;
    margin-right: 12px;
    color: var(--accent-color); /* Accent color icon */
}
.disclaimer p {
    color: var(--warning-text);
    margin-bottom: 0; /* Adjust spacing */
}

/* --- Symptom Form & Groups --- */
#symptom-form h2 {
    text-align: center;
    border-bottom: none; /* Remove border below "Step 1" */
    margin-bottom: 1.5em;
}

.symptom-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px 20px 20px; /* More padding */
    margin-bottom: 25px;
    background-color: #fafafa; /* Slight background tint */
}

legend {
    font-size: 1.2em;
    font-weight: 600; /* Semi-bold */
    padding: 0 10px;
    margin-left: 5px; /* Align with padding */
    color: var(--secondary-color);
}

.symptom-group .checkbox-wrapper {
    display: flex; /* Use flex for alignment */
    align-items: center;
    margin-bottom: 12px; /* Space between items */
    position: relative; /* Needed for custom checkbox */
    padding-left: 35px; /* Space for custom checkbox */
    min-height: 24px; /* Ensure alignment */
}

/* --- Custom Checkbox Styling --- */
.symptom-group input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 1px; /* Minimal size */
    height: 1px; /* Minimal size */
    /* Optional: clip path can also ensure it doesn't render unexpectedly */
    /* clip: rect(0 0 0 0); */
    /* clip-path: inset(50%); */
    overflow: hidden; /* Prevent any potential overflow */
}

.symptom-group label {
    cursor: pointer;
    font-size: 1em; /* Standard size */
    color: var(--text-dark);
    display: inline-block;
    transition: color 0.2s ease;
}

/* Custom checkbox appearance */
.symptom-group label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--secondary-color);
    background-color: white;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Checkmark style */
.symptom-group label::after {
    /* content: '\u2713'; */ /* Remove or comment out this line */
    content: '✓';       /* Replace with this line using the actual checkmark */
    position: absolute;
    left: 4px; /* Position inside the box */
    top: 50%;
    transform: translateY(-50%) scale(0); /* Initially hidden */
    font-size: 16px;
    font-weight: bold;
    color: white;
    transition: transform 0.2s ease;
}

/* Checked state styling */
.symptom-group input[type="checkbox"]:checked + label::before {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.symptom-group input[type="checkbox"]:checked + label::after {
    transform: translateY(-50%) scale(1); /* Show checkmark */
}

/* Focus state for accessibility */
.symptom-group input[type="checkbox"]:focus + label::before {
    box-shadow: 0 0 0 2px rgba(77, 182, 172, 0.5); /* Teal focus ring */
}

/* Hover state */
.symptom-group .checkbox-wrapper:hover label::before {
     border-color: var(--primary-color);
}
.symptom-group .checkbox-wrapper:hover label {
     color: var(--primary-color);
}


/* --- Button --- */
button {
    display: block;
    width: fit-content; /* Adjust width to content */
    min-width: 200px;
    margin: 30px auto; /* Center button */
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 30px; /* Pill shape */
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 6px 15px rgba(106, 27, 154, 0.4); /* Purple shadow */
}

button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* --- Results Area --- */
.results {
    background-color: #f8f9fa; /* Light gray background */
    padding: 25px;
    margin-top: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.results h2 {
    text-align: left;
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: none; /* Remove border */
    font-size: 1.5em;
}

#supplement-list {
    list-style-type: none; /* Remove default bullets */
    padding-left: 0;
}

#supplement-list li {
    margin-bottom: 10px;
    padding: 12px 15px;
    background-color: var(--background-main);
    border-radius: 6px;
    border-left: 4px solid var(--accent-color); /* Accent border */
    font-size: 1.05em;
    transition: background-color 0.2s ease;
}

#supplement-list li:hover {
    background-color: #e9ecef; /* Slightly darker on hover */
}

/* Style for important notes within list items */
#supplement-list li .important {
    color: var(--danger-text); /* Use danger color */
    font-weight: 600; /* Make it semi-bold */
    font-size: 0.9em; /* Slightly smaller */
    display: block; /* Put on new line */
    margin-top: 4px;
}

.final-reminder {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    color: var(--text-dark);
    font-size: 0.95em;
}
.final-reminder strong {
     color: var(--primary-color);
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 15px;
    }
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.4em; }
    .symptom-group { padding: 15px; }
    legend { font-size: 1.1em; }
    button { width: 90%; padding: 12px 20px; }
}

@media (max-width: 480px) {
     h1 { font-size: 1.6em; }
     h2 { font-size: 1.3em; }
    .main-header { padding: 20px 15px; }
    .disclaimer { padding: 10px 15px; }
    .disclaimer h2 { font-size: 1.1em; }
    .warning-icon { font-size: 1.4em; }
    .symptom-group { margin-bottom: 20px; }
    legend { margin-left: 0; } /* Adjust legend position */
}