/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-gradient-start: #f9fafb;
    --bg-gradient-end: #f3f4f6;
    --white: #ffffff;
    --error: #ef4444;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Content Box */
.content-box {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    transition: all 0.3s ease;
}

.content-box.success {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
    }
}

/* Form Elements */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-field {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    background: #f9fafb;
}

.input-field:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.input-field::placeholder {
    color: var(--text-secondary);
}

/* Button */
.submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-height: 20px;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Questionnaire Styles */
.questionnaire-box {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 700px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Question Container */
.question-container {
    transition: opacity 0.3s ease;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.4;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out backwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.option:hover {
    border-color: var(--primary-color);
    background: var(--white);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.option input[type="radio"]:checked {
    border-color: var(--primary-color);
    border-width: 6px;
}

.option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.option label {
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
}

/* Ending Container */
.ending-container {
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.ending-container.show {
    opacity: 1;
    transform: scale(1);
}

.ending-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ending-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.ending-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-box {
        padding: 2.5rem 1.75rem;
        max-width: 100%;
    }
    
    .questionnaire-box {
        padding: 2rem 1.5rem;
    }
    
    .question-text {
        font-size: 1.25rem;
    }
    
    .option {
        padding: 1rem 1.25rem;
    }
    
    .option:hover {
        transform: translateX(4px);
    }
    
    .ending-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
    
    .ending-title {
        font-size: 1.5rem;
    }
    
    .ending-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .content-box {
        padding: 2rem 1.5rem;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .question-text {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
    
    .option {
        padding: 0.875rem 1rem;
    }
    
    .option label {
        font-size: 0.9375rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: var(--white);
    }
    
    .submit-btn {
        display: none;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --bg-gradient-start: #1f2937;
        --bg-gradient-end: #111827;
        --white: #1f2937;
    }
    
    .content-box,
    .questionnaire-box {
        background: #374151;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }
    
    .input-field {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .input-field:focus {
        background: #111827;
    }
    
    .option {
        background: #1f2937;
        border-color: #4b5563;
    }
    
    .option:hover {
        background: #111827;
    }
    
    .option:has(input[type="radio"]:checked) {
        background: rgba(99, 102, 241, 0.15);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
