* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --form-bg: linear-gradient(135deg, #722e48 0%, #8f3d5c 100%);
    --form-text: #202124;
    --form-text-muted: #5f6368;
    --form-text-soft: rgba(32, 33, 36, 0.5);
    --form-surface: #ffffff;
    --form-surface-muted: rgba(255, 255, 255, 0.85);
}

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--form-bg);
    color: var(--form-text);
}

/* Sidebar */
.main-sidebar {
    width: 72px;
    background: #722e48;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    border-right: 1px solid #5a2439;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.main-sidebar-item {
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 16px;
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.main-sidebar-item:hover {
    background: #8f3d5c;
    color: white;
    transform: scale(1.05);
}

.main-sidebar-item.active {
    background: white;
    color: #722e48;
}

.main-sidebar-item .material-icons {
    font-size: 24px;
}

.main-sidebar-item span:not(.material-icons):not(.sidebar-badge) {
    font-size: 10px;
    margin-top: 4px;
}

/* Form Container */
.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--form-bg);
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: #e0e0e0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #722e48, #c2185b);
    width: 0%;
    transition: width 0.4s ease;
}

/* Question Slides */
.question-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    padding: 60px 40px;
    overflow: hidden;
}

.question-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.question-slide.prev {
    transform: translateX(-100%);
}

.question-content {
    max-width: 600px;
    width: 100%;
    animation: fadeIn 0.6s ease;
    background: var(--form-surface);
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.6);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.question-content.media-overlay {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.7);
}

.question-media-bg {
    position: absolute;
    inset: 0;
}

.question-media-split {
    display: flex;
    gap: 36px;
    align-items: stretch;
    width: 100%;
    max-width: 1200px;
}

.question-media-split .question-content {
    max-width: none;
}

.question-media-split.left .question-media {
    order: 0;
}

.question-media-split.right .question-media {
    order: 1;
}

.question-media {
    flex: 0 0 40%;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.18);
}

.question-media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-number {
    font-size: 14px;
    color: var(--form-text-muted);
    font-weight: 500;
    margin-bottom: 16px;
    opacity: 0.8;
}

.welcome-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--form-text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 20px;
    color: var(--form-text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

.welcome-message {
    margin: 20px 0;
    padding: 16px 18px;
    background: var(--form-surface-muted);
    border-radius: 12px;
    line-height: 1.6;
    color: var(--form-text);
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
}

.question-title {
    font-size: 32px;
    font-weight: 500;
    color: var(--form-text);
    margin-bottom: 24px;
    line-height: 1.3;
}

.question-description {
    font-size: 14px;
    color: var(--form-text-muted);
    margin: 10px 0 20px 0;
    white-space: pre-wrap;
}

/* Input Fields */
.text-input,
.textarea-input {
    width: 100%;
    font-size: 20px;
    padding: 16px 0;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    outline: none;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.3s ease;
    background: transparent;
    color: var(--form-text);
}

.text-input:focus,
.textarea-input:focus {
    border-bottom-color: #722e48;
}

.textarea-input {
    resize: none;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.textarea-input:focus {
    border-color: #722e48;
}

/* Buttons */
.btn-primary {
    background: #722e48;
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.btn-primary:hover {
    background: #8f3d5c;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(114, 46, 72, 0.3);
}

.btn-next {
    background: #722e48;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    transition: all 0.3s ease;
}

.btn-next:hover {
    background: #8f3d5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 46, 72, 0.3);
}

.hint {
    margin-top: 16px;
    font-size: 14px;
    color: var(--form-text-muted);
}

/* Choice Buttons */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-btn {
    background: var(--form-surface);
    border: 2px solid #e0e0e0;
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--form-text);
}

.choice-btn:hover {
    border-color: #722e48;
    background: #fce4ec;
    transform: translateX(8px);
}

.choice-btn .material-icons {
    color: #722e48;
    font-size: 28px;
}

/* Multiple Choice */
.multiple-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.multiple-option {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--form-surface);
    border: 2px solid #e0e0e0;
    padding: 18px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    color: var(--form-text);
    transition: all 0.3s ease;
}

.multiple-option:hover {
    border-color: #722e48;
    background: #fce4ec;
}

.multiple-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #722e48;
}

/* Navigation */
.navigation {
    position: absolute;
    bottom: 40px;
    left: 40px;
}

.nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    border-color: #722e48;
    background: #fce4ec;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn .material-icons {
    color: #722e48;
}

/* Success Icon */
.success-icon {
    text-align: center;
    margin-bottom: 24px;
}

.success-icon .material-icons {
    font-size: 80px;
    color: #4caf50;
    animation: scaleIn 0.6s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Summary */
.summary-slide {
    max-width: 600px;
    margin: 0 auto;
}

.summary-slide .question-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
    overflow: hidden;
}

.summary-list {
    margin: 30px 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 6px;
}

.summary-item {
    background: #f5f5f5;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color, #722e48);
}

.summary-question {
    font-weight: 500;
    color: var(--form-text);
    margin-bottom: 8px;
}

.summary-answer {
    color: var(--form-text-muted);
    font-size: 14px;
}

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: var(--form-surface);
    padding: 12px 0 6px;
    box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.06);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Reuse btn-primary for summary action */
/* Responsive */
@media (max-width: 768px) {
    .main-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        border-right: none;
        border-top: 1px solid #5a2439;
        z-index: 1000;
    }

    .main-sidebar-item span:last-child {
        display: none;
    }

    .form-container {
        padding-bottom: 60px;
    }

    .question-slide {
        padding: 20px 16px 80px 16px;
    }

    .question-content {
        padding: 24px 20px;
        max-height: calc(100vh - 100px);
        border-radius: 16px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .question-title {
        font-size: 24px;
    }

    .navigation {
        bottom: 20px;
        left: 20px;
    }

    .question-media-split {
        flex-direction: column;
        gap: 20px;
    }

    .question-media {
        width: 100%;
        flex: 0 0 auto;
        min-height: 200px;
    }
}

/* Scrollbar personalizzata per webkit (Chrome, Safari, Edge) */
.question-content::-webkit-scrollbar {
    width: 8px;
}

.question-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.question-content::-webkit-scrollbar-thumb {
    background: rgba(114, 46, 72, 0.3);
    border-radius: 10px;
}

.question-content::-webkit-scrollbar-thumb:hover {
    background: rgba(114, 46, 72, 0.5);
}

/* Scrollbar per Firefox */
.question-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(114, 46, 72, 0.3) rgba(0, 0, 0, 0.05);
}
