:root {
    --bg: #eef1f4;
    --card: #ffffff;
    --text: #1f2733;
    --muted: #6b7683;
    --border: #d6dbe1;
    --accent: #0a7d3c;       /* FEZZ-Gruen, bei Bedarf anpassen */
    --accent-dark: #075f2d;
    --error: #c0392b;
    --error-bg: #fdecea;
    --success: #0a7d3c;
    --success-bg: #e7f6ee;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(20, 30, 45, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.card {
    position: relative;
    width: 100%;
    max-width: 860px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px clamp(20px, 5vw, 52px);
}

.logout {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: #f1f4f7;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.logout:hover { background: #e7ebf0; color: var(--text); }

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.logo img {
    width: auto;
    height: auto;
    max-height: 88px;
    max-width: 300px;
}
.logo-partner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-left: 22px;
    border-left: 1px solid var(--border);
}
.logo-partner .coop {
    font-size: .72rem;
    color: var(--muted);
    letter-spacing: .02em;
}
.logo-partner img {
    max-height: 68px;
    max-width: 200px;
}
@media (max-width: 520px) {
    .logo-partner { border-left: none; padding-left: 0; }
}

h1 {
    font-size: 1.45rem;
    margin: 0 0 4px;
    text-align: center;
}
.lead {
    text-align: center;
    color: var(--muted);
    margin: 0 0 20px;
}

/* ---- Gruppen-Panel pro Abschnitt ---- */
.group {
    background: #f7f9fb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 20px 22px;
    margin-bottom: 18px;
}
.section {
    margin: 0 0 16px;
    font-size: 1.02rem;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    color: var(--accent-dark);
}

/* ---- 6-Spalten-Raster fuer Felder ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px 18px;
}
.field { display: flex; flex-direction: column; grid-column: 1 / -1; }
.field--full      { grid-column: span 6; }
.field--half      { grid-column: span 3; }
.field--twothirds { grid-column: span 4; }
.field--third     { grid-column: span 2; }
@media (max-width: 560px) {
    .field--full, .field--half, .field--twothirds, .field--third { grid-column: 1 / -1; }
}

label {
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 6px;
}
.req { color: var(--error); }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=url], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 125, 60, .15);
}

.checkbox, .radio {
    flex-direction: row;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-weight: 500;
    cursor: pointer;
}
.checkbox input, .radio input { margin-top: 3px; flex: 0 0 auto; }
.radio-group { display: flex; flex-direction: column; gap: 8px; }

/* Info-Icon mit Tooltip */
.info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px; font-weight: 700; font-style: normal;
    line-height: 1;
    cursor: help;
    position: relative;
    vertical-align: middle;
    user-select: none;
}
.info::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 240px;
    background: #1f2733;
    color: #fff;
    font-size: .8rem; font-weight: 400;
    line-height: 1.35;
    text-align: left;
    padding: 8px 10px;
    border-radius: 7px;
    box-shadow: 0 6px 18px rgba(20,30,45,.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s;
    z-index: 10;
    pointer-events: none;
}
.info:hover::after, .info:focus::after { opacity: 1; visibility: visible; }

.help { color: var(--muted); font-size: .82rem; margin-top: 5px; font-weight: 400; }
.field-error { color: var(--error); font-size: .82rem; margin-top: 5px; min-height: 0; }
.field-error:empty { margin: 0; }

.btn {
    margin-top: 22px;
    width: 100%;
    padding: 13px 20px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
    content: "";
    position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status, .success {
    padding: 12px 14px;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: .95rem;
}
.status.error { color: var(--error); background: var(--error-bg); border: 1px solid #f3c4be; }
.success { color: var(--success); background: var(--success-bg); border: 1px solid #b9e3cc; text-align: center; font-weight: 600; }

/* ---- Inszenierte Übertragungs-Sequenz ---- */
.success.transmit {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 400;
    padding: 28px 22px;
}
.transmit-head {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 18px;
    color: var(--text);
}
.progress-list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 420px;
    text-align: left;
}
.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 2px;
    opacity: .4;
    transition: opacity .3s;
}
.progress-item.active, .progress-item.done { opacity: 1; }
.p-icon { position: relative; width: 22px; height: 22px; flex: 0 0 auto; }
.p-icon .spinner {
    position: absolute; inset: 0;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: spin .7s linear infinite;
}
.progress-item.active .spinner { opacity: 1; }
.progress-item.done .spinner { opacity: 0; }
.p-icon .check {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    border-radius: 50%;
    font-size: 13px; font-weight: 700;
    transform: scale(0);
    transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.progress-item.done .check { transform: scale(1); }
.p-label { font-size: .95rem; }

.transmit-final {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid var(--border);
    font-weight: 700; font-size: 1.05rem;
    color: var(--success);
}
.final-check {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: var(--success); color: #fff;
    border-radius: 50%; font-size: 17px;
    transform: scale(0);
    animation: pop .45s .05s forwards cubic-bezier(.2,1.5,.4,1);
}
@keyframes pop { to { transform: scale(1); } }

.pin-form .field { max-width: 220px; margin: 0 auto; }
.pin-form #pin { text-align: center; letter-spacing: .35em; font-size: 1.25rem; }
.pin-form .help { text-align: center; }
.pin-form .btn { max-width: 220px; margin-left: auto; margin-right: auto; display: block; }

/* Testmodus-Leiste */
.testbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #fff7e6;
    border: 1px dashed #e0b34d;
    border-radius: 9px;
}
.testbadge {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9a6a00;
    background: #ffe9b8;
    padding: 3px 9px;
    border-radius: 99px;
}
.btn-small {
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: #7a5500;
    background: #ffd98a;
    border: none;
    border-radius: 7px;
    padding: 7px 13px;
    cursor: pointer;
    transition: background .15s;
}
.btn-small:hover { background: #ffcf6b; }

.btn-danger {
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    background: var(--error);
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background .15s;
}
.btn-danger:hover { background: #a3271c; }

.action-link {
    display: inline-block;
    margin-right: 10px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}
.action-link:hover { text-decoration: underline; }
.action-link.as-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
}

.foot { margin-top: 26px; text-align: center; color: var(--muted); font-size: .8rem; }

/* Honeypot unsichtbar machen */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
