:root {
    --primary-color: #2e86de;
    --primary-light: #b0c4de;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --container-bg: #ffffff;
    --border-color: #d3d3d3;
    --hover-bg: #eaf4ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-image: url(../../images/street.jpg);
    background-size: cover;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    width: 100%;
    background: var(--container-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#progress-bar-container {
    margin-bottom: 30px;
}

#progress-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

#progress {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 5px;
    /* This line makes the progress bar animation smooth */
    transition: width 0.4s ease-in-out;
}

.welcome-logo {
    display: block;
    margin: 20px auto;
    max-width: 250px;
}

.questionnaire-footer {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}
.footer-logo {
    max-height: 50px;
    width: auto;
}

.question {
    margin-bottom: 20px;
}

.question h2 {
    margin-top: 0;
}

.question p {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hidden {
    display: none;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box; /* Ensures padding doesn't affect the total width */
    font-family: inherit; /* Ensures textarea uses the same font as the body */
    resize: vertical; /* Allow vertical resizing, but not horizontal */
}

input[type="text"].hidden {
    display: none;
}

label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

label:has(input[type="radio"]:checked),
label:has(input[type="checkbox"]:checked) {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
}

label:hover {
    background-color: #f8f9fa;
}

/* Rule to fix inputs inside labels */
label > input[type="text"],
label > input[type="email"],
label > input[type="tel"] {
    flex-grow: 1; /* Allows the input to fill available space */
    width: auto; /* Overrides the default fixed width */
    margin-top: 0; /* Removes the top margin that can cause misalignment */
    margin-left: 8px; /* Adds a bit of space between the label text and the input */
}

input[type="radio"], input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 15px;
}

button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover:not(:disabled) {
    background-color: #1e6ab6;
    transform: translateY(-1px);
}

button:disabled {
    background-color: var(--primary-light);
    cursor: not-allowed;
    opacity: 0.8;
}

.slider-container {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
}

.slider-value {
    display: block;
    font-weight: bold;
    margin-top: 10px;
    color: var(--primary-color);
    font-size: 1.1em;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 10px;
        background-color: var(--container-bg);
    }
    .container {
        box-shadow: none;
        padding: 20px;
        border-radius: 8px;
    }
    .button-group {
        flex-direction: column-reverse;
    }
    button {
        width: 100%;
    }
    .button-group button:first-of-type {
       margin-top: 10px;
    }
}