:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e1ef;
    --brand: #0c7cd5;
    --brand-dark: #075ea4;
    --ok: #108a43;
    --err: #b42318;
    --shadow: 0 18px 50px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e4f2ff, transparent 38%), var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 28px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar strong {
    display: block;
    font-size: 18px;
}

.topbar span {
    color: var(--muted);
    font-size: 14px;
}

.topbar nav {
    display: flex;
    gap: 14px;
}

.topbar a {
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 700;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.hero {
    padding: 32px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0c7cd5, #42b3ff);
    color: white;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 44px);
}

.hero p { margin: 0; max-width: 760px; opacity: .95; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 22px;
    padding: 28px;
    margin: 22px 0;
}

.card h1, .card h2 {
    margin-top: 0;
}

.card h3 {
    margin: 22px 0 10px;
    color: #344054;
}

.week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.narrow {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: block;
    font-weight: 700;
    color: #344054;
}

input, select, textarea {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #c7d2e5;
    border-radius: 14px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(12, 124, 213, .18);
    border-color: var(--brand);
}

.check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 12px 0;
}

.check input {
    width: auto;
    margin-top: 4px;
}

button, .button {
    display: inline-block;
    border: 0;
    background: var(--brand);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(12, 124, 213, .25);
}

button:hover, .button:hover {
    background: var(--brand-dark);
}

.button.secondary {
    background: #eef5ff;
    color: var(--brand-dark);
    box-shadow: none;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin: 26px 0;
}

.hint {
    color: var(--muted);
    font-size: 14px;
}

.success {
    border-color: rgba(16, 138, 67, .35);
}

.error {
    border-color: rgba(180, 35, 24, .35);
}

.msg.error, .card.error {
    color: var(--err);
}

.split {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--brand-dark);
    font-weight: 800;
    font-size: 12px;
}

.details {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 8px 18px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.details dt {
    color: var(--muted);
    font-weight: 800;
}

.details dd {
    margin: 0;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 28px;
    font-size: 13px;
}

code {
    background: #eef2f8;
    padding: 2px 6px;
    border-radius: 6px;
}

@media (max-width: 760px) {
    .grid, .details, .week-grid {
        grid-template-columns: 1fr;
    }

    .topbar, .split {
        align-items: flex-start;
        flex-direction: column;
    }

    .card, .hero {
        padding: 22px;
    }
}


/* UX Version 3 */
.wow-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    position: relative;
}

.wow-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -70px;
    top: -90px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 900;
    opacity: .86;
    font-size: 12px;
}

.hero-badge {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 22px;
    padding: 18px 20px;
    min-width: 150px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.hero-badge strong {
    display: block;
    font-size: 22px;
}

.hero-badge span {
    display: block;
    font-size: 13px;
    opacity: .9;
}

.progress-card {
    position: sticky;
    top: 75px;
    z-index: 4;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    margin-bottom: 22px;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.progress-track {
    height: 10px;
    background: #e7edf7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #0c7cd5, #42b3ff);
    transition: width .25s ease;
}

.step-dots {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 0;
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.step-dots li {
    position: relative;
    padding-top: 18px;
    text-align: center;
}

.step-dots li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #c9d4e8;
    position: absolute;
    top: 0;
    left: calc(50% - 5px);
}

.step-dots li.active {
    color: var(--brand-dark);
    font-weight: 900;
}

.step-dots li.active::before {
    background: var(--brand);
    box-shadow: 0 0 0 5px rgba(12,124,213,.15);
}

.step-dots li.done::before {
    background: #12b76a;
}

.autosave-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #7a4b00;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-weight: 800;
}

.form-step[hidden] {
    display: none;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    position: sticky;
    bottom: 0;
    padding: 16px 0 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.wizard-actions button,
.wizard-actions .button {
    min-width: 130px;
}

.preset-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 22px 0 4px;
    padding: 14px;
    background: #f4f8ff;
    border: 1px solid #d9e8ff;
    border-radius: 16px;
}

.preset-bar span {
    font-weight: 900;
    color: #344054;
}

.chip {
    padding: 9px 12px;
    border-radius: 999px;
    box-shadow: none;
    font-size: 14px;
}

.ghost {
    background: #ffffff;
    color: var(--brand-dark);
    border: 1px solid #cfe0f8;
    box-shadow: none;
}

.info-box,
.rv-box,
.review-box,
.mini-summary {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #dce8f8;
}

.rv-box.highlight {
    background: #ecfdf3;
    border-color: #abefc6;
}

.mini-summary {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 17px;
}

.field-hint {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
}

.field-hint.ok {
    color: #108a43;
}

.field-hint.warn {
    color: #b54708;
}

input.invalid,
select.invalid,
textarea.invalid {
    border-color: #f04438 !important;
    outline: 3px solid rgba(240, 68, 56, .14);
}

.shake {
    animation: shake .38s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    50% { transform: translateX(7px); }
    75% { transform: translateX(-4px); }
}

.review-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 14px;
    margin-top: 12px;
}

.review-grid span {
    color: var(--muted);
}

.big-success {
    text-align: center;
    padding: 48px 28px;
}

.big-success h1 {
    font-size: clamp(32px, 5vw, 54px);
}

@media (max-width: 900px) {
    .step-dots {
        grid-template-columns: repeat(4, 1fr);
    }

    .progress-card {
        top: 68px;
    }
}

@media (max-width: 760px) {
    input, select, textarea {
        font-size: 17px;
        padding: 15px 14px;
    }

    .wow-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-badge {
        width: 100%;
        text-align: left;
    }

    .step-dots {
        display: none;
    }

    .progress-card {
        top: 0;
        border-radius: 0 0 18px 18px;
        margin-left: -20px;
        margin-right: -20px;
    }

    .wizard-actions {
        margin-left: -20px;
        margin-right: -20px;
        padding: 14px 20px;
        background: rgba(245,247,251,.96);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
    }

    .wizard-actions button {
        flex: 1;
        min-width: 0;
    }

    .preset-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .chip {
        width: 100%;
    }

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


/* Version 4 DATEV-nahe Ergänzungen */
.step-dots {
    grid-template-columns: repeat(10, 1fr);
}

.conditional-field[hidden],
.conditional-panel[hidden] {
    display: none !important;
}

.grid .full {
    grid-column: 1 / -1;
}

.conditional-panel {
    margin-top: 14px;
    padding: 18px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px dashed #b9cbe8;
}

@media (max-width: 1100px) {
    .step-dots {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 760px) {
    .step-dots {
        display: none;
    }
}


/* Version 8 Smart UX */
.ref-number {
    display: inline-block;
    margin-top: 8px;
    font-size: clamp(28px, 5vw, 44px);
    color: #0c7cd5;
    letter-spacing: .04em;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0 10px;
}

#cashPaymentInfo {
    margin-top: 16px;
}

@media (max-width: 760px) {
    .success-actions {
        flex-direction: column;
    }

    .success-actions .button {
        width: 100%;
        text-align: center;
    }
}
