/*
 * Animierte Rechnungs-Oberflaeche im Modul "Rechnungsportal" (Startseite).
 * Alle Masse in cqw (Breite des Rahmens), damit alles mit dem Rahmen skaliert.
 * Ohne JS bzw. bei "Bewegung reduzieren" bleibt der Endzustand stehen
 * (fertiges PDF mit E-Rechnung). Ablauf: assets/js/invoice-demo.js.
 */
@property --invd-k {
    syntax: '<integer>';
    inherits: false;
    initial-value: 385;
}

.invd {
    position: absolute;
    inset: 0;
    container-type: inline-size;
    background: radial-gradient(90cqw 70cqw at 80% 40%, #16264a 0%, #0b1426 70%);
    color: #e2e6e9;
    font-family: inherit;
    overflow: hidden;
}

.invd-ui {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.invd-head {
    flex: none;
    height: 7.5cqw;
    display: flex;
    align-items: center;
    padding: 0 2.6cqw;
    font-size: 3.3cqw;
    font-weight: 700;
    border-bottom: 1px solid rgba(226, 230, 233, 0.1);
}

.invd-head i {
    width: 1.3cqw;
    height: 1.3cqw;
    border-radius: 50%;
    background: #47b2e4;
    margin-right: 1.6cqw;
}

.invd-body {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1cqw;
    padding: 1.6cqw 2.4cqw;
}

.invd-row {
    flex: none;
    height: 7.6cqw;
    display: flex;
    align-items: center;
    gap: 2cqw;
    padding: 0 2cqw;
    border: 1px solid rgba(226, 230, 233, 0.1);
    border-radius: 1.6cqw;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0; /* Ohne JS: Zeilen aus, Endzustand zeigt das fertige PDF */
}

.invd-num {
    position: relative;
    flex: none;
    width: 4.4cqw;
    height: 4.4cqw;
    border: 0.2cqw solid #a9b5c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6cqw;
    font-weight: 700;
    color: #a9b5c7;
}

.invd-tick {
    position: absolute;
    inset: -0.2cqw;
    border-radius: 50%;
    background: #5fd39a;
    color: #06301d;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.invd-tick svg {
    width: 2.4cqw;
    height: 2.4cqw;
}

.invd-lab {
    flex: none;
    width: 22cqw;
    font-size: 2.9cqw;
    font-weight: 600;
    color: #a9b5c7;
    white-space: nowrap;
}

.invd-val {
    flex: 1;
    min-width: 0;
    font-size: 3.2cqw;
    font-weight: 600;
    white-space: nowrap;
}

.invd-val em {
    font-style: normal;
    font-weight: 400;
    font-size: 2.7cqw;
    color: #a9b5c7;
    margin-left: 1cqw;
}

.invd-chips {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.2cqw;
    white-space: nowrap;
}

.invd-chip {
    position: relative;
    padding: 0.9cqw 1.8cqw;
    border: 0.2cqw solid rgba(226, 230, 233, 0.14);
    border-radius: 1.2cqw;
    font-size: 2.8cqw;
    font-weight: 600;
    color: #a9b5c7;
}

.invd-chip--main {
    color: #e2e6e9;
}

.invd-badge {
    position: absolute;
    top: -1.9cqw;
    right: 0.8cqw;
    padding: 0.1cqw 1cqw;
    border-radius: 99cqw;
    background: #47b2e4;
    color: #06223a;
    font-size: 1.9cqw;
    font-weight: 700;
    line-height: 1.5;
}

.invd-tag {
    flex: none;
    padding: 0.5cqw 1.5cqw;
    border-radius: 99cqw;
    background: rgba(71, 178, 228, 0.18);
    color: #47b2e4;
    font-size: 2.5cqw;
    font-weight: 600;
    white-space: nowrap;
}

.invd-wert {
    color: #47b2e4;
    font-size: 3.5cqw;
    font-variant-numeric: tabular-nums;
}

.invd-wert::after {
    counter-reset: invd-k var(--invd-k);
    content: counter(invd-k) '.000 \20AC';
}

.invd-ok {
    color: #5fd39a;
}

.invd-btn {
    position: relative;
    flex: none;
    height: 7.6cqw;
    margin-top: auto;
    border-radius: 1.6cqw;
    background: #47b2e4;
    color: #06223a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.1cqw;
    font-weight: 700;
    opacity: 0;
}

.invd-flash {
    position: absolute;
    inset: 0;
    border-radius: 1.6cqw;
    background: #fff;
    opacity: 0;
}

.invd-btn-t {
    position: relative;
}

/* Fertiges PDF + Stempel (Endzustand) */
.invd-sheet {
    position: absolute;
    left: 14cqw;
    top: 1.8cqw;
    width: 36cqw;
    height: 46.5cqw;
    padding: 3.2cqw 3cqw;
    border-radius: 0.8cqw;
    background: #f6f8fa;
    color: #1a2a44;
    box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, 0.5);
}

.invd-sheet-t {
    font-size: 3.4cqw;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2cqw;
}

.invd-sheet i {
    display: block;
    height: 0.9cqw;
    border-radius: 0.5cqw;
    background: #d5dce6;
    margin-bottom: 1.1cqw;
}

.invd-sheet-gap {
    height: 2.8cqw;
}

.invd-pos {
    display: flex;
    justify-content: space-between;
    gap: 1.6cqw;
    margin-top: 1.1cqw;
}

.invd-pos i {
    margin: 0;
}

.invd-sum {
    position: absolute;
    left: 3cqw;
    right: 3cqw;
    bottom: 3cqw;
    padding-top: 1.2cqw;
    border-top: 0.2cqw solid #1a3c6e;
    font-size: 2.6cqw;
    font-weight: 700;
}

.invd-stamp {
    position: absolute;
    left: 40cqw;
    top: 24cqw;
    display: flex;
    align-items: center;
    gap: 1.2cqw;
    padding: 1.3cqw 2cqw;
    border-radius: 1.3cqw;
    background: #5fd39a;
    color: #06301d;
    font-size: 2.9cqw;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1.6cqw 4cqw rgba(0, 0, 0, 0.4);
}

.invd-stamp-ic svg {
    display: block;
    width: 2.8cqw;
    height: 2.8cqw;
}

/* ===== Akt 2: Zahlungsstand und Mahnwesen ===== */
.invd-head {
    position: relative;
}

.invd-h2 {
    position: absolute;
    left: 5.5cqw;
    opacity: 0;
}

.invd-act2 {
    position: absolute;
    inset: 1.6cqw 2.4cqw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.6cqw;
    pointer-events: none;
}

.invd-inv {
    padding: 2.4cqw 2.6cqw 2cqw;
    border: 1px solid rgba(226, 230, 233, 0.1);
    border-radius: 1.8cqw;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
}

.invd-inv-top {
    display: flex;
    align-items: center;
    gap: 2cqw;
}

.invd-inv-id {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4cqw;
}

.invd-inv-id b {
    font-size: 3.3cqw;
    font-weight: 700;
    white-space: nowrap;
}

.invd-inv-id span {
    font-size: 2.6cqw;
    color: #a9b5c7;
    white-space: nowrap;
}

.invd-inv-amt {
    font-size: 3.6cqw;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.invd-states {
    position: relative;
    flex: none;
    width: 20cqw;
    height: 5cqw;
}

.invd-st {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
    height: 100%;
    padding: 0 1.4cqw;
    border-radius: 99cqw;
    font-size: 2.6cqw;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
}

.invd-st--open { background: rgba(138, 180, 248, 0.18); color: #8ab4f8; }
.invd-st--late { background: rgba(255, 138, 101, 0.2); color: #ff9a76; }
.invd-st--part { background: rgba(255, 193, 77, 0.2); color: #ffc14d; }
.invd-st--paid { background: rgba(95, 211, 154, 0.2); color: #5fd39a; }

.invd-bar {
    margin-top: 2.2cqw;
    height: 1.4cqw;
    border-radius: 99cqw;
    background: rgba(226, 230, 233, 0.12);
    overflow: hidden;
}

.invd-bar-fill {
    display: block;
    height: 100%;
    border-radius: 99cqw;
    background: #ffc14d;
    transform: scaleX(0);
    transform-origin: left;
}

.invd-notes {
    position: relative;
    height: 3.6cqw;
    margin-top: 1.4cqw;
}

.invd-note {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 2.7cqw;
    color: #a9b5c7;
    white-space: nowrap;
    opacity: 0;
}

.invd-note--2 {
    color: #5fd39a;
}

.invd-drow {
    height: 7.2cqw;
}

.invd-ic {
    flex: none;
    width: 4.4cqw;
    height: 4.4cqw;
    border-radius: 50%;
    background: rgba(71, 178, 228, 0.18);
    color: #47b2e4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invd-ic svg {
    width: 2.5cqw;
    height: 2.5cqw;
}

.invd-tag--warn {
    background: rgba(255, 138, 101, 0.2);
    color: #ff9a76;
}

.invd-tag--paused {
    background: rgba(255, 193, 77, 0.2);
    color: #ffc14d;
    opacity: 0;
}

.invd-switch {
    position: relative;
    flex: none;
    width: 7cqw;
    height: 3.8cqw;
    border-radius: 99cqw;
    background: rgba(226, 230, 233, 0.22);
}

.invd-switch i {
    position: absolute;
    left: 0.4cqw;
    top: 0.4cqw;
    width: 3cqw;
    height: 3cqw;
    border-radius: 50%;
    background: #fff;
}
