/* =============================================
   TM24 ANKAUF – CHECKOUT (Modul) v2
   Scoped: nur .checkout-* Klassen + #schritt-4
   Modern Premium Redesign 2026
   ============================================= */

/* ===== CHECKOUT WRAPPER ===== */
#schritt-4 {
    background: linear-gradient(160deg, #f4f5ff 0%, #f8f9fc 100%);
    min-height: 60vh;
    padding-bottom: 60px;
}

/* ===== STEP PROGRESS BAR ===== */
.checkout-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(46,43,203,0.07), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid rgba(46,43,203,0.1);
    position: relative;
}

/* Verbindungslinie zwischen Tabs */
.checkout-tabs::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: #eef0fb;
    z-index: 0;
}

.checkout-tab {
    flex: 1;
    padding: 18px 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    background: #f8f9fc;
    cursor: default;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(46,43,203,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.checkout-tab:last-child {
    border-right: none;
}

/* Aktiver Tab – Premium-Look */
.checkout-tab.active {
    background: #fff;
    color: #1a1a2e;
    font-weight: 700;
}

.checkout-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2e2bcb, #6366f1);
    border-radius: 2px 2px 0 0;
}

/* Erledigter Tab */
.checkout-tab.done {
    background: #f0fdf4;
    color: #16a34a;
    font-weight: 600;
}

.checkout-tab.done::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: #16a34a;
    border-radius: 2px 2px 0 0;
}

/* Tab-Nummern-Kreis */
.checkout-tab-nr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8e8f0;
    color: #aaa;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkout-tab.active .checkout-tab-nr {
    background: linear-gradient(135deg, #2e2bcb 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46,43,203,0.35);
    transform: scale(1.05);
}

.checkout-tab.done .checkout-tab-nr {
    background: #16a34a;
    color: #fff;
    /* Checkmark statt Zahl bei "done" – via JS setzen */
}

/* ===== CHECKOUT LAYOUT ===== */
.checkout-content {
    max-width: 740px;
    margin: 0 auto;
}

.checkout-pane {
    display: none;
}

.checkout-pane.active {
    display: block;
    animation: checkoutFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.checkout-pane-inner {
    background: #fff;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 4px 30px rgba(46,43,203,0.06), 0 1px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(46,43,203,0.08);
}

.checkout-pane-titel {
    font-size: 21px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f1fa;
    letter-spacing: -0.3px;
}

/* ===== TAB 1: ZUSAMMENFASSUNG / ARTIKEL-CARD ===== */
.checkout-item-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f5f6ff 0%, #f0f1ff 100%);
    border-radius: 16px;
    border: 1.5px solid rgba(46,43,203,0.12);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.checkout-item-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, #2e2bcb, #6366f1);
    border-radius: 0 4px 4px 0;
}

.checkout-item-img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(46,43,203,0.1);
}

.checkout-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.checkout-item-details {
    flex: 1;
}

.checkout-item-name {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.checkout-item-meta {
    font-size: 13px;
    color: #7a7a9a;
    margin-bottom: 10px;
    line-height: 1.4;
}

.checkout-item-preis {
    font-size: 26px;
    font-weight: 900;
    color: #16a34a;
    letter-spacing: -0.5px;
}

/* ===== TAB 2: KUNDENDATEN FORMULAR ===== */
.checkout-intro-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
    padding: 12px 16px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 3px solid #6366f1;
}

/* Formular-Styling */
#schritt-4 .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

#schritt-4 .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

#schritt-4 .form-label {
    font-weight: 700;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

#schritt-4 .form-control {
    border-radius: 12px;
    border: 1.5px solid #e4e6f0;
    padding: 12px 16px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fafbff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    width: 100%;
    font-family: inherit;
}

#schritt-4 .form-control::placeholder {
    color: #bbb;
}

#schritt-4 .form-control:focus {
    border-color: #2e2bcb;
    box-shadow: 0 0 0 4px rgba(46,43,203,0.08);
    outline: none;
    background: #fff;
}

#schritt-4 .form-control:valid:not(:placeholder-shown) {
    border-color: #16a34a;
    background: #f0fdf4;
}

#schritt-4 select.form-control {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    cursor: pointer;
    background: #fafbff;
}

/* ===== AUSZAHLUNG ===== */
.auszahlung-titel {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a2e;
    margin-top: 28px;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.auszahlung-disclaimer {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.5;
}

.checkout-payment-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #444;
    background: linear-gradient(135deg, #f5f6ff, #eef0ff);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(46,43,203,0.1);
    margin-bottom: 16px;
    line-height: 1.4;
}

.checkout-payment-hint i {
    color: #2e2bcb;
    font-size: 15px;
    flex-shrink: 0;
}

.auszahlung-optionen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
}

.auszahlung-label {
    cursor: pointer;
}

.auszahlung-label input[type="radio"] {
    display: none;
}

.auszahlung-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 16px;
    border: 2px solid #e4e6f0;
    border-radius: 14px;
    background: #fff;
    font-weight: 700;
    font-size: 14px;
    color: #555;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.auszahlung-box:hover {
    border-color: #c7c9f0;
    background: #fafbff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46,43,203,0.08);
}

.auszahlung-label input[type="radio"]:checked + .auszahlung-box {
    border-color: #2e2bcb;
    background: linear-gradient(135deg, #f0f0ff, #e8e8ff);
    color: #2e2bcb;
    box-shadow: 0 4px 16px rgba(46,43,203,0.15);
}

.auszahlung-label input[type="radio"]:checked + .auszahlung-box::after {
    content: '✓';
    position: absolute;
    top: 8px; right: 10px;
    font-size: 11px;
    font-weight: 900;
    color: #2e2bcb;
    background: rgba(46,43,203,0.1);
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auszahlung-box i {
    font-size: 20px;
}

/* ===== TAB 3: PFLICHT / AGB ===== */
.pflicht-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fc;
    border: 1.5px solid #e4e6f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #444;
    line-height: 1.55;
}

.check-label:hover {
    border-color: rgba(46,43,203,0.3);
    background: #f3f4ff;
    box-shadow: 0 2px 8px rgba(46,43,203,0.06);
}

.check-label:has(input:checked) {
    border-color: #2e2bcb;
    background: linear-gradient(135deg, #f0f1ff, #f5f6ff);
}

.check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #2e2bcb;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    border-radius: 4px;
}

.check-label a {
    color: #2e2bcb;
    text-decoration: underline;
    font-weight: 600;
}

.checkout-final-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #555;
    background: linear-gradient(135deg, #f5f6ff, #f0f1ff);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(46,43,203,0.1);
    margin-bottom: 20px;
    line-height: 1.6;
}

.checkout-final-hint i {
    color: #2e2bcb;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== CHECKOUT BUTTONS ===== */
.checkout-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.btn-checkout-next {
    background: linear-gradient(135deg, #2e2bcb 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(46,43,203,0.28);
    flex: 1;
    max-width: 300px;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.btn-checkout-next::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-checkout-next:hover::before {
    left: 100%;
}

.btn-checkout-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(46,43,203,0.38);
}

.btn-checkout-next:active {
    transform: translateY(0);
}

.btn-checkout-back {
    background: none;
    border: 2px solid #e4e6f0;
    border-radius: 50px;
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-checkout-back:hover {
    border-color: #aaa;
    color: #444;
    background: #f5f5f8;
}

/* Final-Button – Premium grün mit Puls */
.btn-checkout-final {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 17px 44px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(22,163,74,0.32);
    flex: 1;
    max-width: 340px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    font-family: inherit;
}

.btn-checkout-final:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(22,163,74,0.42);
}

.btn-checkout-final:active {
    transform: translateY(0);
}

/* Shimmer-Effekt */
.btn-checkout-final::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 2.5s infinite;
}

/* Puls-Ring um den Button */
@keyframes pulsRing {
    0%   { box-shadow: 0 4px 20px rgba(22,163,74,0.32), 0 0 0 0 rgba(22,163,74,0.3); }
    70%  { box-shadow: 0 4px 20px rgba(22,163,74,0.32), 0 0 0 12px rgba(22,163,74,0); }
    100% { box-shadow: 0 4px 20px rgba(22,163,74,0.32), 0 0 0 0 rgba(22,163,74,0); }
}

.btn-checkout-final {
    animation: pulsRing 2s ease infinite;
}

.btn-checkout-final:hover {
    animation: none;
    box-shadow: 0 8px 32px rgba(22,163,74,0.42);
}

/* ===== SSL HINWEIS ===== */
.ssl-hinweis {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.ssl-hinweis i {
    color: #16a34a;
}

/* ===== IBAN/PayPal Felder ===== */
#feld-iban, #feld-paypal {
    animation: checkoutFadeUp 0.25s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes checkoutFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0%   { left: -100%; }
    50%  { left: 150%; }
    100% { left: 150%; }
}

/* ===== RESPONSIVE TABLET ===== */
@media (max-width: 768px) {
    .checkout-pane-inner {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .checkout-tabs {
        border-radius: 14px;
    }

    .checkout-tab {
        padding: 14px 8px 12px;
        font-size: 12px;
        gap: 6px;
        flex-direction: column;
    }

    .checkout-tab-nr {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .checkout-item-card {
        gap: 14px;
        padding: 16px 18px;
    }

    .checkout-item-name {
        font-size: 16px;
    }

    .checkout-item-preis {
        font-size: 22px;
    }

    #schritt-4 .form-row {
        flex-direction: column;
        gap: 0;
    }

    .checkout-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-checkout-next,
    .btn-checkout-final {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }

    .btn-checkout-back {
        width: 100%;
        text-align: center;
    }

    .auszahlung-optionen {
        grid-template-columns: 1fr 1fr;
    }

    .checkout-pane-titel {
        font-size: 18px;
    }
}

/* ===== RESPONSIVE MOBIL ===== */
@media (max-width: 480px) {
    #schritt-4 {
        padding-bottom: 40px;
    }

    .checkout-pane-inner {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .checkout-tab {
        font-size: 11px;
        padding: 12px 6px 10px;
    }

    .checkout-tab-nr {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .checkout-item-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .checkout-item-card::before {
        width: 100%; height: 4px;
        top: 0; left: 0;
        border-radius: 0 0 4px 4px;
    }

    .checkout-item-img {
        width: 70px;
        height: 70px;
        margin: 0 auto;
    }

    .auszahlung-optionen {
        grid-template-columns: 1fr;
    }

    .btn-checkout-final {
        padding: 16px 32px;
        font-size: 15px;
    }

    .checkout-pane-titel {
        font-size: 17px;
    }
}
