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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: #f7fafc;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Card Effect - Clean Light Theme */
.glass-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.glass-card:hover {
    border-color: #4299e1;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header .glass-card {
    padding: 3rem 2rem;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Styles */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    padding: 2rem;
    position: relative;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2rem;
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: #4299e1;
    border: 2px solid #3182ce;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

label {
    display: block;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.required::after {
    content: " *";
    color: #e53e3e;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #1a202c;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

/* Verbessertes Select-Styling */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select:hover {
    border-color: #cbd5e0;
}

select option {
    background: #ffffff;
    color: #1a202c;
    padding: 0.5rem;
}

select option:checked {
    background: #4299e1;
    color: #ffffff;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: #a0aec0;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
    background: #ffffff;
}

select option {
    background: #ffffff;
    color: #1a202c;
}

/* Radio & Checkbox Groups */
fieldset {
    border: none;
    padding: 0;
}

legend {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 1rem;
}

.required::after {
    content: " *";
    color: #ff6b6b;
    font-weight: bold;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    cursor: pointer;
}

.radio-item:hover,
.checkbox-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #4299e1;
}

.radio-item label,
.checkbox-item label {
    margin: 0;
    cursor: pointer;
    color: #2d3748;
}

/* Help Text */
.help-text {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Error Messages */
.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

/* Buttons */
.form-actions {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.submit-btn,
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #4299e1;
    border: 2px solid #3182ce;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    min-width: 200px;
}

.submit-btn:hover,
.action-btn:hover {
    background: #3182ce;
    border-color: #2c5aa0;
}

.submit-btn:focus,
.action-btn:focus {
    outline: 3px solid rgba(66, 153, 225, 0.5);
    outline-offset: 2px;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Disclaimer */
.disclaimer {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #edf2f7;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.disclaimer p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Output Section */
.output-section {
    margin-top: 2rem;
    padding: 2rem;
}

.output-section h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.output-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.output-actions .action-btn {
    min-width: auto;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.output-content {
    background: #ffffff;
    color: #1a202c;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Georgia', serif;
    line-height: 1.8;
}

.output-content h1,
.output-content h2,
.output-content h3 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.output-content h1 {
    font-size: 1.8rem;
    margin-top: 0;
}

.output-content h2 {
    font-size: 1.4rem;
}

.output-content h3 {
    font-size: 1.2rem;
}

.output-content p {
    margin-bottom: 1rem;
}

.output-content ul,
.output-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.output-content li {
    margin-bottom: 0.5rem;
}

/* Help and Tooltip Styles */
.help-toggle {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #2d3748;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.help-toggle:hover,
.help-toggle[aria-expanded="true"] {
    background: #edf2f7;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.help-content {
    margin-top: 2rem;
    padding: 2rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.help-content h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    text-align: left;
}

.help-sections {
    display: grid;
    gap: 1.5rem;
}

.help-section {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.help-section h4 {
    color: #2b6cb0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.help-section p,
.help-section ol {
    color: #4a5568;
    line-height: 1.6;
    text-align: left;
}

.help-section ol {
    margin-left: 1.5rem;
}

.help-section li {
    margin-bottom: 0.5rem;
}

.help-section strong {
    color: #2d3748;
    font-weight: 600;
}

.help-section a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
}

.help-section a:hover,
.help-section a:focus {
    color: #3182ce;
    text-decoration: underline;
}

/* Strukturierte Hilfe-Inhalte */
.law-overview {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.law-overview h5 {
    color: #2b6cb0;
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.law-overview h5:first-child {
    margin-top: 0;
}

.law-overview ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.law-overview li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Spezielle Fälle Container */
.special-cases {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.special-cases h6 {
    color: #0c4a6e;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 1px solid #bae6fd;
    padding-bottom: 0.25rem;
}

.special-cases h6:first-child {
    margin-top: 0;
}

.special-cases ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding: 0;
}

.special-cases li {
    margin-bottom: 0.4rem;
    line-height: 1.4;
    font-size: 0.95rem;
}

.resources {
    background: #ffffff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.resources h5 {
    color: #2b6cb0;
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resources h5:first-child {
    margin-top: 0;
}

.resources ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.resources li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.resources a {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.resources a:hover,
.resources a:focus {
    color: #2c5282;
    border-bottom-color: #2c5282;
    text-decoration: none;
}

/* Warning Box für wichtige Hinweise */
.warning-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.warning-box p {
    color: #742a2a;
    font-weight: 500;
    margin: 0.5rem 0;
}

.warning-box ul {
    margin: 0.5rem 0 0.5rem 1.5rem;
    color: #742a2a;
}

.warning-box li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-btn {
    background: none;
    border: none;
    color: #2b6cb0;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    position: relative;
}

.tooltip-btn:hover,
.tooltip-btn:focus {
    background: #edf2f7;
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    border: 2px solid #4a5568;
    border-radius: 8px;
    padding: 1rem;
    color: #ffffff;
    font-size: 0.875rem;
    line-height: 1.4;
    min-width: 400px;
    max-width: 600px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    white-space: normal;
    word-wrap: break-word;
    display: none;
}

.tooltip-container:hover .tooltip,
.tooltip-btn:focus + .tooltip,
.tooltip.show {
    display: block;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2d3748;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 1rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 1rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #e2e8f0;
}

/* Footer Styles */
.footer {
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-info p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.footer-subtitle {
    font-size: 0.8rem !important;
    font-style: italic;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #3182ce;
    text-decoration: underline;
    border-color: #4299e1;
    outline: none;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-info {
        text-align: left;
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .section-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .radio-group,
    .checkbox-group {
        gap: 0.5rem;
    }
    
    .output-actions {
        flex-direction: column;
    }
    
    .output-actions .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header .glass-card {
        padding: 2rem 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}

/* Focus Management */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glass-card {
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid #000;
    }
    
    .glass-card:hover {
        border-color: #0066cc;
    }
    
    input, select, textarea {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
    
    input:focus, select:focus, textarea:focus {
        border-color: #0066cc;
        box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
    }
    
    .submit-btn, .action-btn {
        background: #0066cc;
        border: 2px solid #000;
    }
    
    .submit-btn:hover, .action-btn:hover {
        background: #0052a3;
    }
}

/* Clean styles without animations */

/* Print Styles */
@media print {
    body {
        background: #fff;
        color: #000;
    }
    
    .glass-card {
        background: #fff;
        border: 1px solid #000;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    
    .header,
    .form-actions,
    .output-actions {
        display: none;
    }
    
    .output-content {
        background: #fff;
        border: none;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
}
