/* Form Styles */
:root {
    --primary-color: #d8232a;
    --primary-hover: #b71c22;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --card-background: #fff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 24px 0 rgba(37, 99, 235, 0.08);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.form-container {
    min-height: 100vh;
    padding: 3rem 0;
    background: var(--background-color);
}

.form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 3rem 2rem 3rem;
    border: 1px solid var(--border-color);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header img {
    height: 60px;
    margin-bottom: 1rem;
}

.form-header h1 {
    color: var(--primary-color);
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: none;
    padding: 0;
}

.form-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    background: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    border: none;
}

/* Form Sections */
.form-section {
    padding: 1.5rem 0 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: #000;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.2rem 0;
    letter-spacing: 0.01em;
    background: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2 i {
    font-size: 1.2rem;
}

/* Form Rows and Groups */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    flex: 1 1 0;
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group label.required::after {
    content: " *";
    color: var(--error-color);
}

/* Input Styles */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: #f9fafb;
    color: var(--text-color);
    transition: var(--transition);
    box-sizing: border-box;
}

/* Spezifische Regel für textarea mit rows="3" */
.form-group textarea[rows="3"] {
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.10);
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: var(--error-color);
}

/* Range Input */
.form-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

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

.form-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.range-labels span:first-child {
    text-align: left;
}

.range-labels span:last-child {
    text-align: right;
}

.range-labels span:nth-child(2) {
    font-weight: 600;
    color: var(--primary-color);
}

/* Radio and Checkbox Styles */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    transition: var(--transition);
}

.radio-label:hover,
.checkbox-label:hover {
    color: var(--primary-color);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    display: none;
}

.radio-custom,
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-custom {
    border-radius: 4px;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Consent Labels */
.consent-label {
    font-size: 0.9rem;
    line-height: 1.5;
    align-items: flex-start;
}

.consent-label .checkbox-custom {
    margin-top: 0.125rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: none;
    border: none;
    padding: 1.5rem 0 0 0;
}

.btn {
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px 0 rgba(37, 99, 235, 0.08);
    margin-top: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive Design */
@media (max-width: 900px) {
    .form-container {
        padding: 0;
    }

    .form-wrapper {
        border-radius: 0;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .form-wrapper {
        padding: 1.2rem 0.5rem;
        max-width: 100%;
    }
    .form-header h1 {
        font-size: 1.3rem;
    }
    .form-section {
        padding: 1rem 0 0.5rem 0;
    }
    .form-row {
        flex-direction: column;
        gap: 0.7rem;
    }
}

@media (max-width: 480px) {
    .form-wrapper h1 {
        font-size: 1.25rem;
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    .form-description {
        padding: 1rem 1.5rem;
    }
}

/* Animation for form sections */
.form-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-loading .btn-primary {
    position: relative;
}

.form-loading .btn-primary::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and Error Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

/* Progress indicator */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    z-index: 1000;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    width: 0%;
    transition: width 0.3s ease;
}

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

/* Focus styles for keyboard navigation */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .form-actions,
    .btn {
        display: none;
    }

    .form-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Beruf/Tätigkeit radios in a row */
.radio-group.radio-group-row {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.radio-group.radio-group-row label {
    margin-right: 0.5rem;
    white-space: nowrap;
}

/* Pain Slider Styles */
.slider-container {
    margin-top: 0.5rem;
}

.pain-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 0.5rem;
    /* CSS custom property for dynamic thumb color */
    --slider-thumb-color: #22c55e; /* Default green */
}

.pain-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--slider-thumb-color);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.pain-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--slider-thumb-color);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.slider-label {
    flex: 1;
    text-align: center;
}

.slider-text-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.text-label {
    flex: 1;
}

.text-label:first-child {
    text-align: left;
}

.text-label:last-child {
    text-align: right;
}

.slider-value {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #22c55e; /* Default green */
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(34, 197, 94, 0.15); /* Default green with 15% opacity */
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.3); /* Default green with 30% opacity */
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
} 