/* Base styles */
body {
    font-family: system-ui, -apple-system, sans-serif;
}

/* Container styles */
.progress-container {
    position: relative;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

.progress-line {
    position: absolute;
    top: 25px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: #E5E7EB;
    z-index: 1;  /* Make sure this is lower than steps and circles */
}

.progress-line-fill {
    position: absolute;
    height: 100%;
    background: #3B82F6;
    transition: width 0.3s ease;
    z-index: 1;  /* Add this to match progress-line */
}

/* Step indicators */
.steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 3;  /* Increase this value */
    width: 100%;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E5E7EB;
    color: #6B7280;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    position: relative;  /* Add this */
    z-index: 3;  /* Add this */
}

.step.active .step-circle {
    background: #3B82F6;
    color: white;
}

.step.completed .step-circle {
    background: #60A5FA;
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: #6B7280;
    text-align: center;
    transition: all 0.3s ease;
    max-width: 80px;
}

.step.active .step-label {
    color: #3B82F6;
    font-weight: 500;
}

.step.completed .step-label {
    color: #60A5FA;
    font-weight: 500;
}

/* Form section styles */
.form-section {
    margin-bottom: 2rem;
}

.section-header {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 1rem;
    min-height: 1.75rem;
    display: flex;
    align-items: center;
}

/* Form group and input styles */
.form-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.input-field:disabled {
    background-color: #F3F4F6;
    cursor: not-allowed;
}

/* Toggle container styles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #F3F4F6;
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.toggle-option {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.toggle-option.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
}

.toggle-option:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Child card styles */
.child-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
}

.child-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.05);
}

.child-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Add child button styles */
.add-child-button {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 2px dashed #E5E7EB;
    border-radius: 0.75rem;
    background: transparent;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-child-button:hover {
    border-color: #3B82F6;
    color: #3B82F6;
    background: #EFF6FF;
}

/* Mehrbedarf styles */
.mehrbedarf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mehrbedarf-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mehrbedarf-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.05);
}

.mehrbedarf-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 2px solid #D1D5DB;
    accent-color: #3B82F6;
}

.mehrbedarf-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Info tooltip styles */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #6B7280;
    font-size: 12px;
    margin-left: 4px;
    cursor: help;
    transition: all 0.2s ease;
    position: relative;
}

.info-icon:hover {
    background: #D1D5DB;
    color: #374151;
}

.info-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1F2937;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    width: max-content;
    max-width: 250px;
    margin-bottom: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1F2937 transparent transparent transparent;
}

.info-icon:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Radio button styles */
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white;
    position: relative;
    cursor: pointer;
}

input[type="radio"]:checked {
    border-color: #3B82F6;
    background: #3B82F6;
}

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

/* Navigation buttons */
.nav-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-button-primary {
    background: #3B82F6;
    color: white;
}

.nav-button-primary:hover {
    background: #2563EB;
}

.nav-button-secondary {
    background: #F3F4F6;
    color: #374151;
}

.nav-button-secondary:hover {
    background: #E5E7EB;
}

/* Utility classes */
.hidden {
    display: none;
}

.no-spinners::-webkit-inner-spin-button,
.no-spinners::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinners {
    -moz-appearance: textfield;
}

/* Mobile optimizations */
@media (max-width: 639px) {
    .progress-container {
        padding: 0 0.5rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .step-label {
        font-size: 0.625rem;
        max-width: 60px;
    }

    .progress-line {
        left: 8%;
        right: 8%;
    }

    .toggle-option {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .child-card {
        padding: 0.75rem;
    }

    .child-grid {
        grid-template-columns: 1fr;
    }

    .mehrbedarf-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile tooltip support */
@media (max-width: 768px) {
    .info-icon.active .info-tooltip {
        visibility: visible;
        opacity: 1;
    }
}

/* Step content transitions */
.step-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-content.active {
    opacity: 1;
}

/* Ensure content is hidden by default */
.step-content:not(.active) {
    display: none;
}

.title-section {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.step-progress-section {
    width: 100%;
    margin: 2rem 0;
    position: relative;
    z-index: 2;
}

@media screen {
    .print-only {
        display: none;
    }
}

@media print {
    /* Hide ALL non-print elements */
    .no-print,
    .step-progress-section,
    .title-section:not(.print-only) {
        display: none !important;
    }

    /* Show print-specific title */
    .print-only {
        display: block !important;
        text-align: center;
        margin-bottom: 2rem !important;
    }

    /* Page setup */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    /* Base resets */
    body {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    /* Container adjustments */
    .bg-white {
        background: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* Typography */
    h1 {
        font-size: 18pt !important;
        margin-bottom: 0.3cm !important;
    }

    h3 {
        font-size: 14pt !important;
        margin: 0.5cm 0 0.3cm 0 !important;
        page-break-after: avoid !important;
    }

    /* Results styling */
    .text-5xl {
        font-size: 28pt !important;
        color: #047857 !important;
        margin: 0.5cm 0 0.2cm 0 !important;
    }

    /* Grid layouts */
    .grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.2cm !important;
        margin-bottom: 0.5cm !important;
    }

    /* Page break controls */
    .page-break-avoid {
        page-break-inside: avoid !important;
    }

    /* Important notices section */
    .wichtige-hinweise {
        margin-top: 0.5cm !important;
        page-break-inside: avoid !important;
    }

    .wichtige-hinweise ul {
        margin: 0.3cm 0 !important;
        padding-left: 0 !important;
        list-style: none !important;
    }

    .wichtige-hinweise li {
        margin-bottom: 0.2cm !important;
        padding-left: 1em !important;
        text-indent: -1em !important;
    }

    .wichtige-hinweise li:before {
        content: "•";
        padding-right: 0.5em !important;
    }

    /* Footer domain */
    .domain-footer {
        margin-top: 0.5cm !important;
        text-align: center !important;
        border-top: 1px solid #E5E7EB !important;
        padding-top: 0.3cm !important;
    }

    /* Links */
    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    /* Form elements */
    input[type="checkbox"],
    input[type="radio"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        margin: 0 !important;
        font: inherit !important;
    }

    /* Reset backgrounds and shadows */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Ensure all text is visible */
    * {
        color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide buttons and nav elements */
    button,
    .flex.gap-4,
    .progress-container,
    .step-progress-section,
    .print\\:hidden {
        display: none !important;
    }
}