/* ========================================
   HMF-IT - Projektplaner CSS
   WCAG 2.1 AA konform
   ======================================== */

/* Projektplaner Section */
.projektplaner-section {
    padding: 2rem 0 var(--section-padding);
}

.projektplaner-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-dark);
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
}

[data-bs-theme="light"] .projektplaner-container {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 3rem;
}

.progress-bar-bg {
    height: 6px;
    background: var(--glass-border-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

[data-bs-theme="light"] .progress-bar-bg {
    background: var(--glass-border-light);
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    opacity: 0.5;
    transition: opacity var(--transition-normal);
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

[data-bs-theme="light"] .step-number {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.progress-step.active .step-number {
    background: var(--gradient-primary);
    border-color: var(--hmf-green);
    color: #fff;
}

.progress-step.completed .step-number {
    background: var(--hmf-green);
    border-color: var(--hmf-green);
    color: #fff;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Form Steps */
.form-step {
    display: none;
    border: none;
    padding: 0;
    margin: 0;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0;
}

.step-description {
    opacity: 0.8;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Option Grid (Radio Cards) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    border-radius: 16px;
    transition: all var(--transition-normal);
    min-height: 180px;
}

[data-bs-theme="light"] .option-content {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.option-card:hover .option-content,
.option-card input:focus + .option-content {
    border-color: var(--hmf-green);
    transform: translateY(-4px);
}

.option-card input:checked + .option-content {
    border-color: var(--hmf-green);
    background: rgba(106, 122, 38, 0.15);
    box-shadow: var(--glow-green);
}

.option-card input:focus-visible + .option-content {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.option-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.option-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.option-icon-alt {
    background: var(--gradient-secondary);
}

.option-icon-gray {
    background: linear-gradient(135deg, var(--hmf-gray) 0%, var(--hmf-gray-light) 100%);
}

.option-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    display: block;
}

.option-desc {
    font-size: 0.85rem;
    opacity: 0.7;
    display: block;
}

/* Option List (Umfang) */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-row {
    position: relative;
    cursor: pointer;
}

.option-row input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-row-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    border-radius: 14px;
    transition: all var(--transition-normal);
}

[data-bs-theme="light"] .option-row-content {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.option-row:hover .option-row-content,
.option-row input:focus + .option-row-content {
    border-color: var(--hmf-green);
}

.option-row input:checked + .option-row-content {
    border-color: var(--hmf-green);
    background: rgba(106, 122, 38, 0.15);
    box-shadow: var(--glow-green);
}

.option-row input:focus-visible + .option-row-content {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.option-row-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: var(--glass-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
}

[data-bs-theme="light"] .option-row-icon {
    background: var(--glass-border-light);
}

.option-row-icon-green {
    background: var(--gradient-primary);
    color: #fff;
}

.option-row-icon-red {
    background: var(--gradient-secondary);
    color: #fff;
}

.option-row-icon-gold {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: #fff;
}

.option-row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.option-row-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.option-row-desc {
    font-size: 0.875rem;
    opacity: 0.75;
}

.option-row-badge {
    padding: 0.4rem 0.875rem;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

[data-bs-theme="light"] .option-row-badge {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

/* Checkbox Grid (Features) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.875rem;
}

.checkbox-card {
    position: relative;
    cursor: pointer;
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

[data-bs-theme="light"] .checkbox-content {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.checkbox-card:hover .checkbox-content,
.checkbox-card input:focus + .checkbox-content {
    border-color: var(--hmf-green);
}

.checkbox-card input:checked + .checkbox-content {
    border-color: var(--hmf-green);
    background: rgba(106, 122, 38, 0.15);
}

.checkbox-card input:focus-visible + .checkbox-content {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.checkbox-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: var(--glass-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-normal);
}

[data-bs-theme="light"] .checkbox-icon {
    background: var(--glass-border-light);
}

.checkbox-card input:checked + .checkbox-content .checkbox-icon {
    background: var(--gradient-primary);
}

.checkbox-icon svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.checkbox-card input:checked + .checkbox-content .checkbox-icon svg {
    color: #fff;
    opacity: 1;
}

.checkbox-text {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.checkbox-checkmark {
    display: none;
}


/* Form Fields */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.required {
    color: var(--hmf-red-light);
}

.form-control {
    padding: 0.875rem 1.125rem;
    background: var(--glass-bg-dark);
    border: 2px solid var(--glass-border-dark);
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 1rem;
    color: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-bs-theme="light"] .form-control {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.form-control:hover {
    border-color: var(--hmf-green);
}

.form-control:focus {
    outline: none;
    border-color: var(--hmf-green);
    box-shadow: 0 0 0 3px rgba(106, 122, 38, 0.25);
}

.form-control::placeholder {
    opacity: 0.5;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24' stroke='%23888'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

/* Select Dropdown Options - Dark Mode */
select.form-control option {
    background-color: #1a1a24;
    color: #e8e6e3;
    padding: 0.75rem;
}

select.form-control option:checked {
    background-color: rgba(106, 122, 38, 0.4);
}

/* Select Dropdown Options - Light Mode */
[data-bs-theme="light"] select.form-control option {
    background-color: #ffffff;
    color: #1a1a24;
}

[data-bs-theme="light"] select.form-control option:checked {
    background-color: rgba(106, 122, 38, 0.2);
}

/* ========================================
   Budget Slider
   ======================================== */
.budget-slider-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem 0;
}

.budget-display {
    text-align: center;
    margin-bottom: 2rem;
}

.budget-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--hmf-green-light);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.budget-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

.slider-wrapper {
    padding: 0 0.5rem;
}

.budget-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--glass-border-dark);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

[data-bs-theme="light"] .budget-slider {
    background: var(--glass-border-light);
}

/* Slider Track - Filled Part */
.budget-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
}

.budget-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: var(--glass-border-dark);
}

[data-bs-theme="light"] .budget-slider::-moz-range-track {
    background: var(--glass-border-light);
}

/* Slider Thumb */
.budget-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: var(--hmf-green);
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-top: -10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.budget-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--hmf-green);
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.budget-slider:hover::-webkit-slider-thumb,
.budget-slider:focus::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(106, 122, 38, 0.4);
}

.budget-slider:hover::-moz-range-thumb,
.budget-slider:focus::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(106, 122, 38, 0.4);
}

.budget-slider:focus {
    outline: none;
}

.budget-slider:focus-visible::-webkit-slider-thumb {
    outline: 3px solid var(--hmf-green-light);
    outline-offset: 2px;
}

.budget-slider:focus-visible::-moz-range-thumb {
    outline: 3px solid var(--hmf-green-light);
    outline-offset: 2px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.6;
    font-family: var(--font-mono);
}

.budget-info {
    margin-top: 2rem;
}

.budget-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.7;
    justify-content: center;
    margin: 0;
}

.budget-note svg {
    flex-shrink: 0;
    color: var(--hmf-green-light);
}

.form-hint {
    font-size: 0.8rem;
    opacity: 0.65;
}

/* Checkbox Label (Standard) */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--glass-border-dark);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-top: 2px;
}

[data-bs-theme="light"] .checkbox-custom {
    border-color: var(--glass-border-light);
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--hmf-green);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--hmf-green);
    border-color: var(--hmf-green);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-label input:focus-visible + .checkbox-custom {
    outline: var(--focus-outline);
    outline-offset: var(--focus-offset);
}

.checkbox-label a {
    color: var(--hmf-green-light);
}

/* Form Error */
.form-error {
    color: var(--hmf-red-light);
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(163, 38, 56, 0.15);
    border-radius: 8px;
    display: none;
}

.form-error:not(:empty) {
    display: block;
}

.form-control.error {
    border-color: var(--hmf-red);
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border-dark);
}

[data-bs-theme="light"] .form-navigation {
    border-color: var(--glass-border-light);
}

.btn-prev:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Form Summary */
.form-summary {
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border-dark);
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

[data-bs-theme="light"] .form-summary {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--hmf-green-light);
}

.summary-title svg {
    width: 24px;
    height: 24px;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    padding: 0.75rem 1rem;
    background: var(--glass-bg-dark);
    border-radius: 8px;
}

[data-bs-theme="light"] .summary-item {
    background: var(--glass-bg-light);
}

.summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-weight: 600;
}

/* Form Success */
.form-success {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 2s ease infinite;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(106, 122, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(106, 122, 38, 0);
    }
}

.success-icon svg {
    width: 56px;
    height: 56px;
    color: #fff;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.success-text {
    opacity: 0.85;
    margin-bottom: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* Responsive */
@media (max-width: 767.98px) {
    .projektplaner-container {
        padding: 1.5rem;
        border-radius: 18px;
    }
    
    .progress-steps {
        gap: 0.25rem;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .option-content {
        min-height: auto;
        padding: 1.25rem 1rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .option-row-content {
        flex-wrap: wrap;
    }
    
    .option-row-badge {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .form-navigation {
        flex-wrap: wrap;
    }
    
    .btn-prev,
    .btn-next,
    .btn-submit {
        flex: 1;
        min-width: 140px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .form-step.active {
        animation: none;
    }
    
    .success-icon {
        animation: none;
    }
    
    .option-card:hover .option-content,
    .option-row:hover .option-row-content {
        transform: none;
    }
}

/* High Contrast */
@media (prefers-contrast: high) {
    .option-content,
    .option-row-content,
    .checkbox-content,
    .form-control {
        border-width: 3px;
    }
    
    .progress-bar-fill {
        background: var(--hmf-green);
    }
}

/* Print */
@media print {
    .projektplaner-section {
        display: none;
    }
}
