/* ============================================================
   stn Kundenportal — Layout & Komponenten
   Body: Poppins · Überschriften: Zilla Slab · Akzent: #ca4e43
   ============================================================ */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'Poppins', system-ui, -apple-system, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-weight: 600;
    color: var(--anthrazit);
    margin: 0 0 .4em;
    line-height: 1.2;
}

a { color: var(--rot); }

[hidden] { display: none !important; }

/* ---------- Kopf / Layout ---------- */
.topbar {
    background: var(--weiss);
    border-bottom: 1px solid var(--rahmen-soft);
    padding: 16px 20px;
    text-align: center;
}
.topbar__logo { height: 64px; width: auto; }

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    padding: 24px 16px 40px;
    line-height: 1.6;
}

/* ---------- Karte / Verifizierung ---------- */
.card {
    background: var(--weiss);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px 22px;
    max-width: 460px;
    margin: 16px auto;
}
.card__title { font-size: 1.7rem; text-align: center; }
.card__lead { color: var(--muted); text-align: center; margin: 0 0 20px; font-size: .95rem; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 600; font-size: .9rem; }
.field__input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--rahmen);
    border-radius: var(--radius);
    padding: 0 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
}
.field__input:focus {
    outline: none;
    border-color: var(--rot);
    box-shadow: 0 0 0 3px rgba(202, 78, 67, 0.15);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--rot); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--rot-dark); }
.btn--ghost {
    background: transparent;
    color: var(--anthrazit);
    border-color: var(--rahmen);
    min-height: 40px;
    padding: 8px 14px;
}
.btn--ghost:hover:not(:disabled) { background: #f1f1f1; }
.btn--block { width: 100%; }

/* ---------- Meldungen ---------- */
.msg {
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: .9rem;
    margin: 6px 0;
}
.msg--error { background: #fdecea; border: 1px solid #f5c6c2; color: #9b2c22; }
.msg--info  { background: #eef4ff; border: 1px solid #cfe0fb; color: #1d4ed8; }
.msg--ok    { background: #ecfdf3; border: 1px solid #b6ecc6; color: #1c7a3c; }

/* ---------- Portal-Kopf / Tabs ---------- */
.portal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.portal__title { font-size: 1.6rem; margin: 0; }
.portal__sub { color: var(--muted); margin: 2px 0 0; font-size: .9rem; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs__btn {
    flex: 1 1 auto;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--rahmen);
    border-radius: var(--radius);
    background: #fff;
    color: var(--anthrazit);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.tabs__btn.is-active { background: var(--anthrazit); color: #fff; border-color: var(--anthrazit); }
.tabs__btn:disabled { opacity: .55; cursor: not-allowed; }
.tabs__btn .fa-lock { margin-left: 6px; font-size: .8em; }

/* ---------- Legende ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 2px 18px; font-size: .82rem; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot--gruen { background: var(--gruen); }
.dot--orange { background: var(--orange); }
.dot--rot { background: var(--rot-ampel); }

/* ---------- Zeitstrahl ---------- */
.timeline { position: relative; margin-top: 8px; }

.tstep { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.tstep__rail { position: relative; flex: 0 0 52px; display: flex; justify-content: center; }
/* Verbindungslinie */
.tstep__rail::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -22px;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: var(--rahmen);
    z-index: 0;
}
.tstep:last-child .tstep__rail::before { display: none; }

.tstep__node {
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--rahmen);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--muted);
    flex: 0 0 auto;
}

.tstep__body {
    flex: 1 1 auto;
    background: #fff;
    border: 1px solid var(--rahmen-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
    min-width: 0;
}
.tstep__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tstep__title { font-size: 1.08rem; margin: 0; }
.tstep__hint { color: var(--muted); font-size: .86rem; margin: 6px 0 0; }

.tag {
    flex: 0 0 auto;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.tag--stn { background: #eef0f2; color: var(--anthrazit); }
.tag--kunde { background: #fff1e2; color: var(--orange-dark); }

.next-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    background: var(--rot);
    padding: 3px 10px;
    border-radius: 999px;
}

.tstep__fields { margin: 10px 0 0; display: grid; gap: 6px 18px; }
.tstep__fields > div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; border-top: 1px dashed var(--rahmen-soft); padding-top: 6px; }
.tstep__fields dt { color: var(--muted); margin: 0; }
.tstep__fields dd { margin: 0; font-weight: 500; text-align: right; }

/* Status-Farben am Knoten */
.tstep.is-gruen  .tstep__node { border-color: var(--gruen); color: #fff; background: var(--gruen); }
.tstep.is-orange .tstep__node { border-color: var(--orange); color: var(--orange-dark); background: #fff7ee; }
.tstep.is-rot    .tstep__node { border-color: var(--rot-ampel); color: var(--rot-ampel); background: #fff; }
.tstep.is-info   .tstep__node { border-color: var(--rahmen); color: var(--info); background: #fff; }

.tstep.is-gruen  .tstep__rail::before { background: var(--gruen); }

/* Hervorhebung des nächsten Schritts */
.tstep.is-next .tstep__body { border-color: var(--rot); box-shadow: 0 0 0 2px rgba(202,78,67,.15), var(--shadow-soft); }
.tstep.is-next .tstep__node { box-shadow: 0 0 0 4px rgba(202,78,67,.18); }

/* ---------- Bestätigung (orange) ---------- */
.confirm { margin-top: 12px; border-top: 1px solid var(--rahmen-soft); padding-top: 12px; }
.confirm__note {
    width: 100%;
    min-height: 70px;
    border: 1px solid var(--rahmen);
    border-radius: var(--radius);
    padding: 10px 12px;
    font: inherit;
    resize: vertical;
    margin-bottom: 10px;
}
.confirm__note:focus { outline: none; border-color: var(--rot); box-shadow: 0 0 0 3px rgba(202,78,67,.15); }
.confirm__check { display: flex; align-items: center; gap: 10px; font-size: .92rem; margin-bottom: 10px; cursor: pointer; }
.confirm__box { width: 20px; height: 20px; accent-color: var(--rot); }
.confirm__hint { color: var(--muted); font-size: .78rem; margin: 0 0 10px; }

/* ---------- Ladezustand ---------- */
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mobile ---------- */
@media (max-width: 520px) {
    .portal__head { flex-direction: column; }
    .tstep__fields > div { flex-direction: column; gap: 2px; }
    .tstep__fields dd { text-align: left; }
    .tstep__rail { flex-basis: 44px; }
    .tstep__node { width: 44px; height: 44px; font-size: 1rem; }
}
