/* Pia in paraOffice – Styles nach Style Guide (Farbpalette und Inter, Schrift liegt bei) */

/* =====================================================================
   Design tokens
   ===================================================================== */

:root {
    /* Farbpalette laut Style Guide */
    --brand-red: #ED1C24;
    --brand-grey: #504F5F;
    --brand-teal-light: #7AC5D4;
    --brand-teal: #4B93A1;
    --brand-sand: #EFECEA;
    --brand-steel: #A6C3CC;

    /* alle Seiten dunkel: Hintergrund im Grau der Marke, Flächen etwas heller */
    --ink: var(--brand-grey);
    --ink-2: #5A596A;
    --ink-3: #6B6A7B;
    --paper: var(--ink-2);
    --card: var(--ink-2);
    --line: var(--ink-3);
    --text: #FFFFFF;
    --muted: var(--brand-steel);
    --soft: var(--brand-sand);
    --accent: var(--brand-red);
    --highlight: var(--brand-teal-light);
    --sky: var(--brand-steel);
    --red: var(--brand-red);
    --red-bg: rgba(237, 28, 36, .16);
    --green: var(--brand-teal-light);
    --green-bg: rgba(122, 197, 212, .16);
    --blue-bg: rgba(122, 197, 212, .16);
    --sans: "Inter", "Segoe UI", Arial, sans-serif;
    --serif: var(--sans);
    --radius: 18px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Regular.ttf") format("truetype");
    font-weight: 400 600;
    font-style: normal;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Bold.ttf") format("truetype");
    font-weight: 700 800;
    font-style: normal;
}

/* =====================================================================
   Base
   ===================================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    --topbar-h: 84px; /* 60px logo + 2 x 12px padding */
    font-family: var(--sans);
    color: var(--text);
    background: var(--paper);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

/* =====================================================================
   Top bar and progress
   ===================================================================== */

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 24px;
    transition: color .4s var(--ease);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--highlight), var(--accent));
    color: #fff;
    font-size: 15px;
    box-shadow: 0 6px 16px -6px rgba(237, 28, 36, .8);
}

.step-label {
    margin-left: auto;
    font-size: 13px;
    opacity: .75;
    letter-spacing: .04em;
}

.topbar .buy-mini {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px -10px rgba(237, 28, 36, .9);
}

body.on-dark .topbar {
    color: #fff;
}

/* der dunkle Hintergrund liegt nur am body (der nicht scrollt), die Schritte selbst sind durchsichtig */
body.on-dark {
    background: radial-gradient(1200px 700px at 80% 10%, #5F5E70 0%, var(--ink) 55%);
}

body.on-dark .topbar .buy-mini {
    background: #fff;
    color: var(--ink);
}

.progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    height: 3px;
    background: transparent;
}

.progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--highlight), var(--brand-steel));
    transition: width .6s var(--ease);
}

/* =====================================================================
   Steps
   ===================================================================== */

.stage {
    position: fixed;
    inset: 0;
}

.step {
    position: absolute;
    /* starts below the top bar, so scrolled content never runs under the header */
    inset: var(--topbar-h) 0 0 0;
    display: flex;
    flex-direction: column;
    justify-content: safe center; /* overflowing content scrolls instead of being cut off at the top */
    padding: 16px max(24px, 6vw) 110px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(60px) scale(.985);
    transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s linear .7s;
    will-change: opacity, transform;
    contain: layout paint;
}

.step.before {
    transform: translateX(-60px) scale(.985);
}

.step.active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s;
}

.step.dark {
    color: #fff;
}

.inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

/* Staggered entrance for elements marked .rise */
.rise {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease), transform .7s var(--ease);
}

.step.active .rise {
    opacity: 1;
    transform: none;
}

.step.active .rise:nth-child(1) { transition-delay: .08s; }
.step.active .rise:nth-child(2) { transition-delay: .16s; }
.step.active .rise:nth-child(3) { transition-delay: .24s; }
.step.active .rise:nth-child(4) { transition-delay: .32s; }
.step.active .rise:nth-child(5) { transition-delay: .40s; }
.step.active .rise:nth-child(6) { transition-delay: .48s; }
.step.active .rise:nth-child(7) { transition-delay: .56s; }
.step.active .rise:nth-child(8) { transition-delay: .64s; }
.step.active .rise:nth-child(9) { transition-delay: .72s; }

/* =====================================================================
   Typography
   ===================================================================== */

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.dark .eyebrow {
    color: var(--sky);
}

h1,
h2 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 700;
    letter-spacing: -.02em;
}

h1 {
    font-size: clamp(40px, 6.4vw, 84px);
    line-height: 1.02;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(30px, 4vw, 50px);
    line-height: 1.08;
}

.lead {
    max-width: 720px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: clamp(17px, 1.6vw, 21px);
    line-height: 1.55;
}

.lead--compact {
    margin-bottom: 20px;
}

.lead--flush {
    margin-bottom: 0;
}

.dark .lead {
    color: var(--soft);
}

.grad {
    background: linear-gradient(90deg, #fff, var(--sky));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =====================================================================
   Buttons
   ===================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:focus-visible,
.navbtn:focus-visible,
.tab:focus-visible,
.dot:focus-visible {
    outline: 3px solid var(--highlight);
    outline-offset: 3px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 30px -12px rgba(237, 28, 36, .9);
}

.btn-light {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6);
}

.btn-ghost {
    border: 1.5px solid currentColor;
    background: transparent;
    color: inherit;
}

/* =====================================================================
   Screenshot frame and lightbox
   ===================================================================== */

.frame {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 40px 80px -30px rgba(40, 39, 50, .45), 0 8px 20px -10px rgba(40, 39, 50, .2);
}

.frame-bar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--brand-sand);
}

.frame-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-steel);
}

.frame-bar i:nth-child(1) { background: var(--brand-red); }
.frame-bar i:nth-child(2) { background: var(--brand-sand); }
.frame-bar i:nth-child(3) { background: var(--brand-teal-light); }

/* Click a screenshot to see it in full size */
.frame img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}

.frame.crop {
    position: relative;
}

.frame.crop .clip {
    overflow: hidden;
}

.frame.crop img {
    margin-bottom: -7%;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(40, 39, 50, .86);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    cursor: zoom-out;
    transition: opacity .3s var(--ease), visibility 0s linear .3s;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s var(--ease);
}

.lightbox img {
    max-width: min(1600px, 100%);
    max-height: calc(100vh - 110px);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .8);
    transform: scale(.96);
    transition: transform .35s var(--ease);
}

.lightbox.open img {
    transform: none;
}

.lightbox .lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
}

.lightbox .lb-caption {
    position: absolute;
    right: 0;
    bottom: 20px;
    left: 0;
    color: var(--soft);
    font-size: 14px;
    text-align: center;
}

/* =====================================================================
   Step 1 – Hero
   ===================================================================== */

/* Wider than the other steps so the screenshot is large and readable */
.inner.hero {
    display: grid;
    grid-template-columns: .5fr 1.1fr;
    gap: 56px;
    align-items: center;
    max-width: 1440px;
}

.hero h1 {
    margin: 22px 0 18px;
    font-size: clamp(34px, 4.2vw, 62px);
}

.hero .lead {
    margin-bottom: 34px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions .btn {
    padding: 12px 20px;
    font-size: 15px;
}

.hero-visual {
    perspective: 2200px;
}

/* Only a slight tilt: a strong 3D rotation makes the screenshot blurry and small */
.hero-visual .frame {
    transform: rotateY(-5deg) rotateX(2deg);
    box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .08), 0 0 80px -10px rgba(122, 197, 212, .45);
    transition: transform .8s var(--ease), box-shadow .8s var(--ease);
    animation: float 7s ease-in-out infinite;
}

.hero-visual .frame:hover {
    transform: none;
}

.zoom-hint {
    margin-top: 14px;
    color: var(--soft);
    font-size: 13px;
    text-align: center;
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -12px; }
}

.glow {
    position: absolute;
    top: 18%;
    right: 4%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(122, 197, 212, .35), transparent 65%);
    pointer-events: none;
}

/* =====================================================================
   Step 2 – Auf einen Blick
   ===================================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 10px;
}

.stat {
    padding: 26px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

.stat b {
    display: block;
    color: var(--accent);
    font-family: var(--serif);
    font-size: clamp(44px, 5vw, 68px);
    line-height: 1;
}

.stat span {
    display: block;
    margin-top: 12px;
    font-size: 17px;
    font-weight: 600;
}

.stat small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.fact {
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
}

.fact b {
    display: block;
    font-family: var(--serif);
    font-size: 21px;
}

.fact span {
    color: var(--soft);
    font-size: 15px;
}

/* =====================================================================
   Step 3 – Highlights
   ===================================================================== */

.hl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hl {
    position: relative;
    overflow: hidden;
    padding: 22px 20px 24px;
    border: 1px solid var(--ink-3);
    border-radius: var(--radius);
    background: var(--ink-2);
    transition: transform .3s var(--ease), border-color .3s, background .3s;
}

.hl:hover {
    border-color: var(--highlight);
    background: var(--ink-3);
    transform: translateY(-6px);
}

.hl::after {
    content: "";
    position: absolute;
    inset: auto -40% -60% auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(122, 197, 212, .28), transparent 70%);
    transition: transform .5s var(--ease);
}

.hl:hover::after {
    transform: scale(1.5);
}

.hl .ico {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(122, 197, 212, .18);
    color: var(--brand-teal-light);
}

.hl .ico svg {
    width: 22px;
    height: 22px;
}

.hl h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.hl p {
    margin: 0;
    color: var(--soft);
    font-size: 15px;
    line-height: 1.5;
}

.hl-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.hl-group {
    margin: 28px 0 14px;
    color: var(--brand-teal-light);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hl-control {
    margin: 26px 0 0;
    color: var(--soft);
    font-size: 16px;
    line-height: 1.5;
}

.hl-control::before {
    content: "✔ ";
    color: var(--highlight);
}

/* =====================================================================
   Step 4 – ERV-Eingaben (tabs and screenshots)
   ===================================================================== */

.split {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 40px;
    align-items: start;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tab {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}

.tab[aria-selected="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.shot-swap {
    position: relative;
}

.shot-swap .frame {
    transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.shot-swap .frame.fade {
    opacity: 0;
    transform: translateY(10px) scale(.99);
}

.checks {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checks li {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 12px;
    align-items: start;
    font-size: 16px;
    line-height: 1.5;
}

.checks li::before {
    content: "✓";
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue-bg);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.checks b {
    display: block;
}

.checks span {
    color: var(--muted);
}

.dark .checks span {
    color: var(--soft);
}

.dark .checks li::before {
    background: rgba(122, 197, 212, .2);
    color: var(--brand-teal-light);
}

/* =====================================================================
   Step 5 – Geschäftsregeln live (demo form)
   ===================================================================== */

.demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 24px 50px -30px rgba(40, 39, 50, .35);
}

.panel h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.panel .hint {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.field label .d {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    transition: background .3s;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    transition: border-color .3s, box-shadow .3s;
}

/* Amount with the € sign inside the field */
.field .affix {
    position: relative;
}

.field .affix input {
    padding-right: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.field .affix__sym {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    transform: translateY(-50%);
    pointer-events: none;
}

/* IBAN in groups of four, easy to read */
.field #iban {
    letter-spacing: .04em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.field #iban::placeholder {
    text-transform: none;
}

.field-link {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.field-link:hover {
    text-decoration: underline;
}

/* ---------- Custom dropdown (Dienststelle) ---------- */

.select {
    position: relative;
}

.select__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 40px 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: border-color .3s, box-shadow .3s;
}

/* Chevron */
.select__btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .2s;
}

.select__btn[aria-expanded="true"]::after {
    transform: translateY(-30%) rotate(-135deg);
}

.select__placeholder {
    color: var(--muted);
}

.select__code {
    flex: none;
    min-width: 40px;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--ink-3);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.select__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.select__text b {
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.select__text small {
    color: var(--muted);
    font-size: 12px;
}

.select__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #fff;
    box-shadow: 0 18px 40px -12px rgba(40, 39, 50, .3);
    list-style: none;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: top;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
}

.select__menu.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.select__opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.select__opt.active {
    background: var(--ink-3);
}

.select__opt[aria-selected="true"] .select__text b {
    color: var(--accent);
}

.select__opt[aria-selected="true"]::after {
    content: "✓";
    margin-left: auto;
    color: var(--accent);
    font-weight: 700;
}

/* ---------- Field states (set by the rules) ---------- */

.field.st-violated input,
.field.st-violated select,
.field.st-violated .select__btn {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(237, 28, 36, .12);
}

.field.st-fulfilled input,
.field.st-fulfilled select,
.field.st-fulfilled .select__btn {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(122, 197, 212, .12);
}

.field.st-optional input,
.field.st-optional select,
.field.st-optional .select__btn {
    border-color: var(--highlight);
    box-shadow: 0 0 0 4px rgba(122, 197, 212, .14);
}

.field.st-violated label .d { background: var(--red); }
.field.st-fulfilled label .d { background: var(--green); }
.field.st-optional label .d { background: var(--highlight); }

.field.st-violated label {
    color: var(--red);
}

/* ---------- Rule list ---------- */

.counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.count {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.count.v {
    background: var(--red-bg);
    color: var(--red);
}

.count.f {
    background: var(--green-bg);
    color: var(--green);
}

.count.o {
    background: var(--blue-bg);
    color: var(--accent);
}

.rules {
    display: grid;
    gap: 10px;
}

.rule {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: background .35s, border-color .35s;
}

.rule .d {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
}

.rule b {
    font-size: 15px;
}

.rule small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.rule .tag {
    padding: 3px 8px;
    border-radius: 6px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
}

.rule.violated {
    border-color: var(--brand-red);
    background: var(--red-bg);
}

.rule.violated .d { background: var(--red); }
.rule.violated .tag { color: var(--red); }

.rule.fulfilled {
    border-color: var(--brand-teal);
    background: var(--green-bg);
}

.rule.fulfilled .d { background: var(--green); }
.rule.fulfilled .tag { color: var(--green); }

.rule.optional {
    border-color: var(--brand-teal-light);
    background: var(--blue-bg);
}

.rule.optional .d { background: var(--highlight); }
.rule.optional .tag { color: var(--accent); }

.rule.flash {
    animation: flash .6s var(--ease);
}

@keyframes flash {
    0% { transform: scale(1); }
    40% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.demo-note {
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

/* =====================================================================
   Steps 6 and 7 – Explorer (Rückverkehr, Datenbankabfragen)
   ===================================================================== */

.rv-top {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 26px;
}

.explorer {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.groups {
    display: grid;
    gap: 8px;
    align-content: start;
}

.group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    text-align: left;
    transition: background .2s, color .2s, transform .2s;
}

.group:hover {
    transform: translateX(4px);
}

.group .n {
    color: var(--accent);
    font-family: var(--serif);
    font-size: 22px;
}

.group[aria-selected="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.group[aria-selected="true"] .n {
    color: var(--sky);
}

.items {
    min-height: 320px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.items h3 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 28px;
}

.items .sub {
    margin: 0 0 20px;
    color: var(--muted);
}

.big-total {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 4px 0 22px;
}

.big-total b {
    color: var(--accent);
    font-family: var(--serif);
    font-size: 64px;
    line-height: 1;
}

.big-total span {
    color: var(--muted);
    font-size: 17px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px) scale(.97);
    animation: chipIn .45s var(--ease) forwards;
}

@keyframes chipIn {
    to {
        opacity: 1;
        transform: none;
    }
}

/* =====================================================================
   Step 8 – Onboarding
   ===================================================================== */

.timeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 8px 0 26px;
}

/* Grey track and the coloured line that fills it when the step is shown */
.timeline::before,
.timeline::after {
    content: "";
    position: absolute;
    top: 27px;
    left: 6%;
    height: 3px;
    border-radius: 3px;
}

.timeline::before {
    right: 6%;
    background: var(--line);
}

.timeline::after {
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 1.6s var(--ease) .3s;
}

.step.active .timeline::after {
    width: 88%;
}

.tl {
    position: relative;
    z-index: 1;
    text-align: left;
}

.tl .num {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
}

.tl:last-child .num {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.tl h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.tl p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.onboard-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
    padding: 22px 26px;
    border: 1px solid var(--brand-teal-light);
    border-radius: var(--radius);
    background: var(--blue-bg);
}

.onboard-cta b {
    display: block;
    font-size: 18px;
}

.onboard-cta span {
    color: var(--muted);
    font-size: 15px;
}

/* =====================================================================
   Step 9 – Schnittstelle (API)
   ===================================================================== */

.api-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.api-big b {
    display: block;
    color: var(--sky);
    font-family: var(--serif);
    font-size: 72px;
    line-height: 1;
}

.api-big span {
    color: var(--soft);
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.api {
    padding: 20px;
    border: 1px solid var(--ink-3);
    border-radius: 16px;
    background: var(--ink-2);
    transition: transform .3s var(--ease), border-color .3s;
}

.api:hover {
    border-color: var(--highlight);
    transform: translateY(-5px);
}

.api code {
    display: inline-block;
    margin-bottom: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(122, 197, 212, .16);
    color: var(--brand-teal-light);
    font-size: 12px;
}

.api h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.api p {
    margin: 0;
    color: var(--soft);
    font-size: 14px;
    line-height: 1.5;
}

/* =====================================================================
   Step 10 – Sicher & zuverlässig (Kanzlei → UVST-App → Gericht)
   ===================================================================== */

.flow {
    display: grid;
    grid-template-columns: 1fr 120px 1.1fr 120px 1fr;
    align-items: center;
    margin: 14px 0 34px;
}

.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 26px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    text-align: center;
    box-shadow: 0 24px 50px -32px rgba(40, 39, 50, .5);
}

.flow-node b {
    font-size: 19px;
}

.flow-node span {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

.flow-ico {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: var(--blue-bg);
    color: var(--highlight);
    font-size: 26px;
    font-weight: 700;
}

.flow-ico svg {
    width: 28px;
    height: 28px;
}

.flow-node.main {
    padding: 34px 22px;
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.flow-node.main span {
    color: var(--soft);
}

.flow-node.main .flow-ico {
    background: linear-gradient(135deg, var(--highlight), var(--accent));
    color: #fff;
    box-shadow: 0 10px 24px -8px rgba(237, 28, 36, .9);
}

/* Data moving in both directions: requests to the court (blue), answers back (green) */
.flow-wire {
    position: relative;
    overflow: hidden;
    height: 4px;
    margin: 0 10px;
    border-radius: 4px;
    background: var(--line);
}

.flow-wire::before,
.flow-wire::after {
    content: "";
    position: absolute;
    top: -2px;
    width: 26%;
    height: 8px;
    border-radius: 4px;
}

.flow-wire::before {
    left: -30%;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    animation: flowRight 1.8s linear infinite;
    will-change: transform;
}

.flow-wire::after {
    right: -30%;
    background: linear-gradient(90deg, transparent, var(--brand-teal-light), transparent);
    animation: flowLeft 1.8s linear infinite .9s;
    will-change: transform;
}

.flow-wire.d2::before {
    animation-delay: .5s;
}

.flow-wire.d2::after {
    animation-delay: 1.4s;
}

@keyframes flowRight {
    to { transform: translateX(540%); }
}

@keyframes flowLeft {
    to { transform: translateX(-540%); }
}

.benefits {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.benefits div {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
}

.benefits b {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
}

.benefits span {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

/* Last card ("Produktiv im Einsatz") is highlighted in green */
.benefits div:last-child {
    border-color: var(--brand-teal);
    background: var(--green-bg);
}

.benefits div:last-child b {
    color: var(--green);
}

/* =====================================================================
   Step 11 – Neues Design (gallery)
   ===================================================================== */

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.gallery figure {
    margin: 0;
}

.gallery figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
}

.gallery figcaption b {
    color: var(--text);
}

.gallery .frame {
    transition: transform .4s var(--ease);
}

.gallery figure:hover .frame {
    transform: translateY(-6px) rotate(-.4deg);
}

/* =====================================================================
   Step 12 – Jetzt starten
   ===================================================================== */

.final {
    text-align: center;
}

.final .glow {
    top: 30%;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.final h1 {
    max-width: 900px;
    margin: 20px auto 18px;
}

.final .lead {
    margin: 0 auto 36px;
}

.final .cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.btn-buy {
    padding: 18px 36px;
    position: relative;
    background: linear-gradient(135deg, #fff, var(--brand-sand));
    color: var(--ink);
    font-size: 19px;
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .7);
}

.btn-buy::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 8px rgba(166, 195, 204, .55);
    opacity: 0;
    pointer-events: none;
    animation: pulse 2.4s ease-out infinite;
    will-change: transform, opacity;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(.96); }
    70%, 100% { opacity: 0; transform: scale(1.18); }
}

.final-points {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-top: 40px;
    color: var(--soft);
    font-size: 15px;
}

.final-points span::before {
    content: "✓ ";
    color: var(--brand-teal-light);
    font-weight: 700;
}

#confetti {
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
}

/* =====================================================================
   Bottom navigation
   ===================================================================== */

.nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 18px 40px -18px rgba(40, 39, 50, .55);
    transform: translateX(-50%);
}

.navbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.navbtn.next {
    background: var(--accent);
    color: #fff;
}

.navbtn:disabled {
    opacity: .35;
    cursor: default;
}

.dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: #C4CDDC;
    transition: width .35s var(--ease), background .35s;
}

.dot.on {
    width: 26px;
    background: var(--accent);
}

.keys-hint {
    position: fixed;
    right: 24px;
    bottom: 30px;
    z-index: 40;
    color: var(--muted);
    font-size: 12px;
}

body.on-dark .keys-hint {
    color: var(--soft);
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1000px) {
    .inner.hero,
    .split,
    .demo,
    .explorer,
    .rv-top {
        grid-template-columns: 1fr;
    }

    .hero-visual .frame {
        transform: none;
        animation: none;
    }

    .stats,
    .hl-grid,
    .api-grid,
    .benefits {
        grid-template-columns: repeat(2, 1fr);
    }

    .facts {
        grid-template-columns: 1fr;
    }

    .timeline {
        grid-template-columns: 1fr 1fr;
    }

    .timeline::before,
    .timeline::after {
        display: none;
    }

    .flow {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .flow-wire {
        width: 4px;
        height: 34px;
        margin: 0 auto;
    }

    .flow-wire::before,
    .flow-wire::after {
        display: none;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .step {
        justify-content: flex-start;
    }

    .keys-hint {
        display: none;
    }
}

@media (max-width: 560px) {
    .stats,
    .hl-grid,
    .api-grid,
    .benefits,
    .timeline {
        grid-template-columns: 1fr;
    }

    .step {
        padding: 12px 16px 104px;
    }

    .dots,
    .step-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
    }
}

/* Logo (statt "§") oben links und in der Mitte des Ablaufs auf "Sicher & zuverlässig" */
.brand-logo {
    width: 60px;
    height: 60px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    object-fit: contain;
    box-shadow: 0 6px 16px -6px rgba(237, 28, 36, .5);
}

.flow-node.main .flow-ico {
    background: #fff;
}

.flow-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Neues Design: beide Screenshots gleich breit und gleich hoch (oberer Teil der Ansicht) */
.gallery {
    align-items: start;
}

.gallery .frame img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top left;
}

/* =====================================================================
   Step 12 – Kontaktformular (Versand per SMTP an office@uvst.at)
   ===================================================================== */

.contact {
    max-width: 680px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(6px);
    text-align: left;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.cf {
    display: grid;
    /* keep the input at the top when the neighbouring field shows an error and the row gets taller */
    align-content: start;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
}

.cf--wide {
    grid-column: 1 / -1;
}

.cf input,
.cf textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    background: rgba(255, 255, 255, .95);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    resize: vertical;
}

.cf input:focus,
.cf textarea:focus {
    outline: 3px solid var(--highlight);
    outline-offset: 1px;
}

.cf .is-invalid {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 2px rgba(237, 28, 36, .6);
}

/* nur für Bots: außerhalb des sichtbaren Bereichs */
.cf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cf-consent {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
}

.cf-consent input {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
    accent-color: var(--highlight);
}

.contact .cta {
    justify-content: center;
}

.contact .btn-buy:disabled {
    opacity: .7;
    cursor: progress;
    animation: none;
}

.cf-status {
    min-height: 1.2em;
    margin: 12px 0 0;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .85);
}

.cf-status.is-error {
    color: #F7A6A9;
}

.cf-status a {
    color: #fff;
}

.contact-done {
    display: grid;
    gap: 6px;
    max-width: 680px;
    margin: 0 auto;
    padding: 26px;
    border: 1px solid rgba(122, 197, 212, .5);
    border-radius: 18px;
    background: rgba(122, 197, 212, .12);
}

.contact-done b {
    font-size: 20px;
}

.contact-done[hidden],
.contact[hidden] {
    display: none;
}

.final .final-points {
    margin-top: 28px;
}

@media (max-width: 560px) {
    .contact {
        padding: 16px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Letzte Seite mit Formular: kompakter, damit alles ohne Abschneiden passt (oben nicht abschneiden: "safe center") */
.step.final {
    justify-content: safe center;
}

.final h1 {
    margin: 0 auto 12px;
    font-size: clamp(30px, 4vw, 52px);
}

.final .lead {
    margin-bottom: 22px;
}

/* Kontaktformular: Prüfhinweise direkt unter dem Feld, Zeichenzähler bei "Nachricht" */
.cf-error {
    min-height: 0;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    color: #F7A6A9;
}

.cf-error:empty {
    display: none;
}

.cf-error--consent {
    display: block;
    margin: -12px 0 14px;
    text-align: center;
}

.cf-count {
    float: right;
    font-weight: 400;
    color: rgba(255, 255, 255, .55);
}

.cf-consent:has(input.is-invalid) {
    color: #F7A6A9;
}

.cf-consent input.is-invalid {
    outline: 2px solid var(--brand-red);
    outline-offset: 2px;
}

/* =====================================================================
   Laptops: the tour is designed for full-HD height. On lower windows
   (1366x768, 1920x1080 at 125%/150% scaling) everything is scaled down
   so the content fits between the top bar and the navigation.
   ===================================================================== */

@media (min-width: 1001px) and (max-height: 940px) {
    html { zoom: .9; }
}

@media (min-width: 1001px) and (max-height: 820px) {
    html { zoom: .8; }
}

@media (min-width: 1001px) and (max-height: 700px) {
    html { zoom: .7; }
}

/* very low windows: the summary row below the contact form would end up under the navigation */
@media (min-width: 1001px) and (max-height: 700px) {
    .final-points { display: none; }
}
