/* =========================================================
   TM24 Zustandsermittlung Wizard – CSS  
   Premium Glassmorphic Design System
   ========================================================= */

:root {
    --cw-primary: #3c57ff;
    --cw-primary-hover: #2540d6;
    --cw-primary-rgb: 60, 87, 255;
    --cw-success: #10b981;
    --cw-success-hover: #059669;
    --cw-danger: #ef4444;
    --cw-text-main: #0f172a;
    --cw-text-sub: #475569;
    --cw-bg-glass: rgba(255, 255, 255, 0.75);
    --cw-border-glass: rgba(255, 255, 255, 0.6);
    --cw-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.15), 0 0 1px 1px rgba(15, 23, 42, 0.05);
}

/* ===== Container / Modal ===== */
.condition-wizard-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 9998;
    backdrop-filter: blur(16px) saturate(190%);
    -webkit-backdrop-filter: blur(16px) saturate(190%);
    animation: cwFadeIn 0.3s ease;
}

.condition-wizard-overlay.is-open {
    display: block;
}

.condition-wizard {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 94vw;
    max-width: 960px;
    max-height: 90vh;
    background: var(--cw-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--cw-border-glass);
    box-shadow: var(--cw-shadow);
    z-index: 9999;
    overflow: hidden;
    font-family: 'Figtree', 'Inter', sans-serif;
    animation: cwModalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.condition-wizard.is-open {
    display: flex;
    flex-direction: column;
}

/* ===== Steps-Bar (oben) ===== */
.cw-steps {
    display: flex;
    background: rgba(248, 250, 252, 0.5);
    border-bottom: 1.5px solid rgba(226, 232, 240, 0.8);
    padding: 10px 16px;
    margin: 0;
    list-style: none;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.cw-steps::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.cw-step {
    flex: 1;
    text-align: center;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    color: var(--cw-text-sub);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cw-step.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--cw-primary), #6366f1);
    box-shadow: 0 4px 14px rgba(var(--cw-primary-rgb), 0.35);
}

.cw-step.is-done {
    color: var(--cw-success);
    background: rgba(16, 185, 129, 0.08);
}

/* ===== Body (Split View) ===== */
.cw-body {
    display: flex;
    flex: 1;
    overflow-y: auto;
    min-height: 440px;
}

/* Linke Seite: Optionen */
.cw-left {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.cw-left h2 {
    font-size: 24px;
    font-weight: 900;
    color: var(--cw-text-main);
    margin: 0 0 24px 0;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

/* Optionskarten */
.cw-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.cw-opt {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.cw-opt:hover {
    border-color: rgba(var(--cw-primary-rgb), 0.3);
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.08);
}

.cw-opt.is-selected {
    background: linear-gradient(135deg, var(--cw-primary), #4f46e5);
    color: #fff !important;
    border-color: var(--cw-primary);
    box-shadow: 0 8px 24px rgba(var(--cw-primary-rgb), 0.25);
}

.cw-opt.is-selected * {
    color: #fff !important;
}

.cw-opt .cw-nr {
    font-size: 28px;
    font-weight: 900;
    width: 38px;
    flex-shrink: 0;
    text-align: center;
    color: var(--cw-primary);
}

.cw-opt .cw-txt {
    font-size: 15px;
    font-weight: 800;
    color: var(--cw-text-main);
}

.cw-opt-custom {
    transition: all 0.25s ease;
}

.cw-opt-custom:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(var(--cw-primary-rgb), 0.4) !important;
}

.cw-opt-custom.is-selected {
    background: linear-gradient(135deg, var(--cw-primary), #4f46e5) !important;
    border-color: var(--cw-primary) !important;
}

.cw-opt-custom.is-selected .cw-opt-icon {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

/* Rechte Seite: Bild-Preview */
.cw-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(248, 250, 252, 0.45);
    border-left: 1.5px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.cw-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-grade-img {
    display: none;
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
}

.cw-grade-item.is-active .cw-grade-img {
    display: block;
    animation: cwScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Navigation (unten) ===== */
.cw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-top: 1.5px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.4);
}

.cw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    background: #fff;
    color: var(--cw-text-main);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
}

.cw-btn:hover {
    background: #f8fafc;
    border-color: rgba(203, 213, 225, 1);
    transform: translateY(-1px);
}

.cw-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    background: #fff !important;
    border-color: rgba(226, 232, 240, 0.8) !important;
}

.cw-btn-next {
    background: linear-gradient(135deg, var(--cw-success), #059669);
    color: #fff;
    border-color: var(--cw-success);
    width: auto;
    padding: 0 28px;
    font-weight: 800;
    font-size: 15px;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.cw-btn-next:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #059669;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.cw-btn-close {
    border: none;
    background: none;
    font-size: 24px;
    color: var(--cw-text-sub);
    cursor: pointer;
}

.cw-btn-close:hover {
    color: var(--cw-text-main);
}

/* ===== Ergebnis / Summary ===== */
.cw-summary {
    text-align: center;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.cw-summary h2 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 24px;
    color: var(--cw-text-main);
    letter-spacing: -0.02em;
}

.cw-summary-imgs {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 28px;
}

.cw-summary-imgs .cw-sum-col {
    flex: 1;
    max-width: 200px;
}

.cw-summary-imgs .cw-sum-col img {
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.cw-summary-imgs .cw-sum-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--cw-text-sub);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cw-result-card {
    background: linear-gradient(135deg, #e0e7ff, #eef2ff);
    border: 2px solid #c7d2fe;
    border-radius: 20px;
    padding: 24px 32px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.12);
}

.cw-result-card h3 {
    font-weight: 800;
    font-size: 14px;
    color: #4f46e5;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cw-result-card .cw-final-condition {
    font-size: 32px;
    font-weight: 950;
    color: #4338ca;
    margin: 0;
    letter-spacing: -0.03em;
}

/* ===== Animations ===== */
@keyframes cwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cwScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cwModalSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .condition-wizard {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
        animation: none;
    }

    .cw-body {
        flex-direction: column;
    }

    .cw-right {
        border-left: none;
        border-top: 1.5px solid rgba(226, 232, 240, 0.8);
        min-height: 220px;
        padding: 24px;
    }

    .cw-step {
        font-size: 11px;
        padding: 10px 6px;
    }

    .cw-left {
        padding: 24px 20px;
    }

    .cw-left h2 {
        font-size: 20px;
        margin-bottom: 18px;
    }

    .cw-opt {
        padding: 12px 16px;
        border-radius: 12px;
    }

    .cw-opt .cw-nr {
        font-size: 22px;
        width: 28px;
    }

    .cw-opt .cw-txt {
        font-size: 14px;
    }

    .cw-opt-custom {
        padding: 14px 16px !important;
        gap: 14px !important;
    }

    .cw-opt-custom .cw-opt-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 20px !important;
    }

    .cw-grade-img {
        max-height: 200px;
    }

    .cw-summary-imgs {
        flex-direction: row;
        align-items: center;
        width: 100%;
        gap: 12px;
    }

    .cw-summary-imgs .cw-sum-col {
        max-width: 130px;
    }
}