/* ===== Reset & Variables ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* my-PV Corporate Design v4 – Hauptfarben */
    --teal: #006699;
    --teal-light: #3399cc;
    --green: #99cc00;
    --green-dark: #7DAA00;
    --green-light: #AADD11;
    --navy: #333333;
    --orange: #ff6600;
    --dark: #333333;
    --gray: #636E72;
    --gray-light: #B2BEC3;
    --gray-lighter: #DFE6E9;
    --gray-bg: #f5f5f5;
    --white: #FFFFFF;
    --shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-pill: 6px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Open Sans', Arial, sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--gray-bg);
}

/* ===== Overlay ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 39, 46, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* ===== Wizard Card ===== */
.wizard {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 680px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: wizardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wizardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Header ===== */
.wizard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 32px 0;
    gap: 16px;
}

.wizard-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo {
    flex-shrink: 0;
    text-align: right;
}

.logo-svg {
    width: 156px;
    height: auto;
}

/* ===== Progress Bar ===== */
.progress {
    padding: 16px 32px 0;
}

.progress-track {
    position: relative;
    height: 28px;
    background: var(--gray-lighter);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 16.67%;
    background: linear-gradient(90deg, var(--green) 0%, var(--green-light) 100%);
    border-radius: var(--radius-pill);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dark);
    z-index: 1;
    pointer-events: none;
}

/* ===== Steps Container ===== */
.steps-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.steps-container {
    padding: 24px 32px 8px;
}

.step {
    display: none;
    animation: stepIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.step.active {
    display: block;
}

.step.slide-out-left {
    animation: slideOutLeft 0.25s ease-in both;
}

.step.slide-out-right {
    animation: slideOutRight 0.25s ease-in both;
}

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

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

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ===== Question Headings ===== */
.question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 16px;
    line-height: 1.45;
}

.question.mt {
    margin-top: 28px;
}

.hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 12px;
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    gap: 12px;
}

.card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== Selection Cards ===== */
.select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px 14px;
    background: var(--white);
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: inherit;
    outline: none;
    text-align: center;
    min-height: 100px;
}

@media (hover: hover) {
    .select-card:hover {
        border-color: var(--gray-light);
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-2px);
    }
}

.select-card:focus-visible {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 102, 153, 0.15);
}

.select-card.selected {
    border-color: var(--green);
    background: rgba(153, 204, 0, 0.06);
    box-shadow: 0 0 0 1px var(--green), var(--shadow-card);
}

.select-card.selected .card-icon {
    color: var(--green-dark);
}


.card-icon {
    width: 40px;
    height: 40px;
    color: var(--gray);
    transition: color var(--transition);
    flex-shrink: 0;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.35;
}

/* ===== Radio Group ===== */
.radio-group {
    display: inline-flex;
    gap: 8px;
}

.radio-btn {
    padding: 12px 24px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-pill);
    background: var(--white);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

@media (hover: hover) {
    .radio-btn:hover {
        border-color: var(--gray-light);
        background: var(--gray-bg);
    }
}

.radio-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 102, 153, 0.15);
}

.radio-btn.selected {
    border-color: var(--green);
    background: var(--green);
    color: var(--white);
}

/* ===== Form Inputs ===== */
.input-row {
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-suffix {
    font-size: 0.85rem;
    color: var(--gray);
    white-space: nowrap;
}

.optional-label {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--gray);
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: var(--gray-light);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(153, 204, 0, 0.15);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23636E72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.input-with-unit {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

.input-with-unit .form-input {
    padding-right: 56px;
}

.input-unit {
    position: absolute;
    right: 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray);
    pointer-events: none;
}

/* Remove number input spinners */
.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Range Slider ===== */
.slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 420px;
}

.form-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-lighter);
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.form-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}

.slider-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--teal);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* ===== Conditional Section ===== */
.conditional-section {
    display: none;
    animation: condIn 0.3s ease both;
}

.conditional-section.visible {
    display: block;
}

@keyframes condIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Contact Form (Step 6) ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form .form-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(153, 204, 0, 0.18);
}

/* Checkbox */
.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    margin-top: 12px;
    padding: 12px 20px;
    min-height: 44px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    transition: all var(--transition);
}

.checkbox-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    margin-top: 1px;
    transition: all var(--transition);
    position: relative;
}

.checkbox-row input:checked + .checkbox-custom {
    background: var(--green);
    border-color: var(--green);
}

.checkbox-row input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-row input:focus-visible + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(153, 204, 0, 0.2);
}

.checkbox-label {
    font-size: 0.95rem;
    color: var(--navy);
    line-height: 1.45;
    font-weight: 500;
}

/* Submit Button */
.btn-submit {
    margin-top: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    box-shadow: 0 4px 14px rgba(153, 204, 0, 0.35);
}

@media (hover: hover) {
    .btn-submit:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(153, 204, 0, 0.45);
    }
}

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

.btn-submit:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Footer Navigation ===== */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px 24px;
    min-height: 60px;
}

.btn-back {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    padding: 8px 4px;
    transition: color var(--transition);
    outline: none;
    visibility: hidden;
}

.btn-back.visible {
    visibility: visible;
}

@media (hover: hover) {
    .btn-back:hover {
        color: var(--dark);
    }
}

.btn-next {
    padding: 10px 32px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--green);
    color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    margin-left: auto;
}

@media (hover: hover) {
    .btn-next:hover:not(:disabled) {
        background: var(--green-dark);
        box-shadow: 0 4px 12px rgba(153, 204, 0, 0.3);
    }
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next.hidden {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .wizard-header {
        padding: 20px 20px 0;
        flex-wrap: wrap;
    }

    .wizard-title {
        font-size: 1.4rem;
    }

    .logo-svg {
        width: 120px;
    }

    .progress {
        padding: 12px 20px 0;
    }

    .steps-container {
        padding: 20px 20px 8px;
    }

    .wizard-footer {
        padding: 12px 20px 20px;
    }

    .card-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .select-card {
        padding: 12px 8px 10px;
        min-height: 85px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
    }

    .card-label {
        font-size: 0.8rem;
    }

    .btn-next {
        padding: 10px 24px;
    }

    .input-row {
        max-width: 100%;
    }

    .slider-row {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .card-grid.cols-3,
    .card-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Utility: slider track fill ===== */
.form-range {
    --range-progress: 32%;
}

/* Webkit slider track fill via linear-gradient */
@supports selector(::-webkit-slider-runnable-track) {
    .form-range {
        background: linear-gradient(
            to right,
            var(--green) 0%,
            var(--green) var(--range-progress),
            var(--gray-lighter) var(--range-progress),
            var(--gray-lighter) 100%
        );
        border-radius: 3px;
    }
}

/* Firefox slider track fill */
.form-range::-moz-range-progress {
    background: var(--green);
    border-radius: 3px;
    height: 6px;
}

.form-range::-moz-range-track {
    background: var(--gray-lighter);
    border-radius: 3px;
    height: 6px;
}

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

/* ===== Autocomplete Fields ===== */
.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
}

.autocomplete-field {
    position: relative;
}

.autocomplete-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.autocomplete-input-wrap .form-input {
    padding-right: 40px;
}

.autocomplete-input-wrap .form-input:disabled {
    background: var(--gray-bg);
    color: var(--dark);
    opacity: 1;
}

.edit-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--teal);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.edit-btn:hover {
    color: var(--green);
}

.edit-btn.hidden {
    display: none;
}

.autocomplete-results {
    display: none;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 260px;
    overflow-y: auto;
    z-index: 10;
}

.autocomplete-results.open {
    display: block;
}

.autocomplete-result {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-lighter);
    transition: all 0.15s ease;
}

.autocomplete-result:last-child {
    border-bottom: none;
}

.autocomplete-result:hover {
    background: rgba(0, 102, 153, 0.06);
    border-left: 3px solid var(--teal);
    padding-left: 11px;
}

.autocomplete-result-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark);
}

.autocomplete-result-address {
    font-size: 0.78rem;
    color: var(--gray);
    margin-top: 2px;
}

.autocomplete-not-listed {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 500;
    border-top: 1px solid var(--gray-lighter);
    transition: background 0.15s ease;
}

.autocomplete-not-listed:hover {
    background: var(--gray-bg);
}

.autocomplete-manual-entry {
    padding: 12px 14px;
}

.autocomplete-manual-entry input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 8px;
    outline: none;
    transition: border-color var(--transition);
}

.autocomplete-manual-entry input:focus {
    border-color: var(--green);
}

.autocomplete-manual-entry input::placeholder {
    color: var(--gray-light);
}

.autocomplete-manual-apply {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: var(--white);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.autocomplete-manual-apply:hover {
    background: var(--teal-light);
}
