:root {
    --primary-color: #14b8a6; /* Stonowany turkus/zieleń */
    --primary-hover: #0d9488;
    --secondary-color: #64748b;
    --light-gray: #f1f5f9;
    --border-color: #e2e8f0;
    --background-color: #f8fafc;
    --text-color: #1e293b; /* Ciemny, czytelny grafit */
    --error-text-color: #dc2626;
    --font-heading: 'Lora', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    /* Tło ze zdjęciem Polańczyka i delikatnym gradientem dla czytelności */
    background-image: 
        linear-gradient(to top, rgba(248, 250, 252, 0.8), rgba(248, 250, 252, 0.8)),
        url('https://images.unsplash.com/photo-1621217313533-5a438b4b7a2e?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.survey-container {
    width: 100%;
    max-width: 680px;
    /* Efekt oszronionego szkła dla nowoczesnego wyglądu */
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
}

.progress-bar-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 10px;
    height: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-text {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

#surveyForm {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.question-wrapper {
    position: relative;
    flex-grow: 1;
    padding: 2.5rem;
}

.question-card {
    border: none;
    padding: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.question-card.active {
    opacity: 1;
    visibility: visible;
    display: block;
    transform: translateY(0);
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.question-card.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

legend {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #14532d; /* Ciemna zieleń dla tytułów */
}

.instruction {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.input-group .option-label, .na-label {
    display: block;
    background-color: #fff;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
    font-weight: 500;
}

.input-group .option-label:hover, .na-label:hover {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}

.input-group input[type="radio"],
.input-group input[type="checkbox"],
.na-label input[type="radio"] {
    display: none;
}
.option-label.inline-flex {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%; /* Zmieniamy na 100%, aby zawsze zajmowało pełną szerokość */
    padding: 0.75rem 1.5rem;
}

.option-label.inline-flex input[type="text"] {
    flex-grow: 1;
    border: none;
    padding: 0;
    margin: 0;
}

.input-group .option-label.checked, .na-label.checked {
    background-color: #ccfbf1;
    border-color: var(--primary-color);
    color: var(--primary-hover);
    font-weight: 700;
}

.inline-input {
    display: flex;
    align-items: center;
    gap: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: box-shadow 0.2s;
}
.inline-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}
.inline-input.full-width .option-label {
    flex-shrink: 0;
    border: none;
    background-color: var(--light-gray);
    border-right: 1px solid var(--border-color);
}
.inline-input.full-width input[type="text"] {
   border: none;
}
.inline-input .option-label {
    margin-bottom: 0;
    border: none;
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    flex: 1;
    font-family: inherit;
    line-height: 1.5;
    background-color: #fff;
    transition: all 0.2s ease;
}
input[type="text"]:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.7;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.sub-legend {
    display: block;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.rating-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}
.rating-group:last-of-type {
    border-bottom: none;
}
.rating-group > .rating-label, .other-rating-label {
    flex: 1 1 300px;
    font-weight: 500;
}
.other-rating-label .option-label {
    margin-bottom: 0.5rem;
    background-color: transparent;
    padding: 0.5rem;
    border: none;
}
.other-rating-label input[type="text"] {
    font-weight: normal;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.rating-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rating-scale.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.rating-scale input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}
.rating-scale input[type="radio"]:hover {
    border-color: var(--primary-color);
    background-color: #f0fdfa;
}
.rating-scale input[type="radio"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.rating-scale span {
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.na-label {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    text-align: center;
    flex-shrink: 0;
    border-style: dashed;
}

.validation-message {
    padding: 0 2rem;
    color: var(--error-text-color);
    font-weight: bold;
    text-align: center;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}
.validation-message.visible {
    height: auto;
    opacity: 1;
    padding-bottom: 1rem;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid var(--border-color);
}

button {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
button:active {
    transform: scale(0.97);
}
button.button-primary {
    background-color: var(--primary-color);
    color: #fff;
}
button.button-primary:hover {
    background-color: var(--primary-hover);
}
button.button-secondary {
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
button.button-secondary:hover {
    background-color: var(--light-gray);
}