/* Deine Sparflamme – Mitarbeiter-Check
   Bühne: Navy. Ausweis: Creme-Karte mit Flammen-Hologrammstreifen.
   Eine Lade-Sequenz (Karte hebt sich → Streifen schimmert → Siegel zeichnet → Fakten erscheinen). */

:root {
    --flame: #E8571F;
    --flame-light: #FF8A50;
    --flame-glow: #FFC297;
    --ember: #C43E0C;
    --navy: #0B1A2E;
    --navy-deep: #06111F;
    --navy-mid: #132B4A;
    --navy-light: #1E3A5F;
    --cream: #FDF8F4;
    --cream-warm: #FFF1E8;
    --sand: #F5EDE6;
    --text: #1A1A1A;
    --text-mid: #555;
    --text-soft: #8A8380;
    --green: #1B9E4B;
    --white: #FFFFFF;
    --on-navy: rgba(253, 248, 244, 0.78);
    --on-navy-soft: rgba(253, 248, 244, 0.5);
    --r-card: 22px;
    --r-md: 12px;
    --r-pill: 100px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-settle: cubic-bezier(0.22, 1.2, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Manrope', system-ui, sans-serif;
    color: var(--on-navy);
    background: var(--navy);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, .badge-name { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; line-height: 1.1; }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--flame-light);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ═══ BÜHNE ═══ */
.stage {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 50% -10%, rgba(232, 87, 31, 0.28), transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 110%, rgba(19, 43, 74, 0.9), transparent 70%),
        var(--navy);
}
.stage-lamp {
    position: absolute; left: 50%; top: 0;
    width: 140vw; height: 70vh; max-width: 1100px;
    transform: translateX(-50%) scaleY(0.6);
    transform-origin: 50% 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 194, 151, 0.35), rgba(232, 87, 31, 0.12) 40%, transparent 70%);
    opacity: 0;
    animation: lamp-on 1.6s var(--ease-out) 0.1s forwards;
}
.stage-grain {
    position: absolute; inset: 0; opacity: 0.06; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.embers { position: absolute; inset: 0; overflow: hidden; }
.embers span {
    position: absolute; bottom: -10px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--flame-glow);
    box-shadow: 0 0 8px 2px rgba(255, 138, 80, 0.5);
    opacity: 0;
    animation: ember-rise var(--dur, 14s) linear var(--delay, 0s) infinite;
    left: var(--x, 50%);
}

/* ═══ LAYOUT ═══ */
.page {
    position: relative; z-index: 1;
    max-width: 560px; margin: 0 auto;
    padding: 1.4rem 1rem 3rem;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.2rem 0.2rem 1.6rem;
    opacity: 0; animation: fade-in 0.8s var(--ease-out) 0.2s forwards;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--cream); }
.brand img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em; }
.brand-name span { color: var(--flame-light); }
.topbar-title {
    font-size: 0.85rem; font-weight: 600; color: var(--on-navy-soft);
    display: inline-flex; align-items: center; gap: 0.45rem;
}
.topbar-title svg { width: 16px; height: 16px; }

/* ═══ AUSWEIS ═══ */
.badge-scene { perspective: 1400px; }
.badge {
    position: relative;
    background: linear-gradient(165deg, var(--white) 0%, var(--cream) 55%, var(--cream-warm) 100%);
    color: var(--text);
    border-radius: var(--r-card);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.7) inset,
        0 40px 80px -30px rgba(0, 0, 0, 0.7),
        0 20px 40px -20px rgba(232, 87, 31, 0.35);
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    opacity: 0;
    animation: card-rise 1.3s var(--ease-settle) 0.35s forwards;
    transition: transform 0.25s ease-out, box-shadow 0.4s ease;
}
.badge.tilting { transition: transform 0.08s linear; }
.badge.settled { animation: none; opacity: 1; }

/* Hologramm-Streifen */
.holo {
    height: 14px;
    background:
        linear-gradient(90deg, var(--ember), var(--flame) 30%, var(--flame-glow) 50%, var(--flame) 70%, var(--ember));
    position: relative; overflow: hidden;
}
.holo::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.75) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: holo-sweep 1.1s var(--ease-out) 1.25s forwards, holo-loop 7s ease-in-out 4s infinite;
}
.holo::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.14) 0 2px, transparent 2px 7px);
    mix-blend-mode: overlay;
}

.badge-body { padding: 1.5rem 1.5rem 1.35rem; }

.badge-head { display: grid; grid-template-columns: 116px 1fr; gap: 1.25rem; align-items: center; }

.photo {
    position: relative; width: 116px; height: 116px; border-radius: 50%;
    padding: 4px;
    background: conic-gradient(from var(--ring-angle, 0deg), var(--ember), var(--flame), var(--flame-glow), var(--flame), var(--ember));
    animation: ring-spin 12s linear infinite;
    box-shadow: 0 10px 24px -10px rgba(232, 87, 31, 0.6);
}
@property --ring-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.photo-inner {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    background: var(--sand); border: 3px solid var(--white);
    display: grid; place-items: center;
}
.photo-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-inner img[hidden] { display: none; }
.initials {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.2rem; color: var(--ember); letter-spacing: 0.02em;
    display: none;
}
.photo-inner.no-photo .initials { display: block; }

.badge-id { min-width: 0; }
.badge-name { font-size: clamp(1.75rem, 6.5vw, 2.15rem); color: var(--text); letter-spacing: -0.01em; }
.badge-role { margin-top: 0.3rem; font-weight: 600; color: var(--text-mid); font-size: 0.95rem; line-height: 1.4; }
.badge-region { color: var(--text-soft); font-size: 0.9rem; margin-top: 0.15rem; }

/* Fakten wie auf einem echten Ausweis: Begriff links, Wert rechts, Punktlinie dazwischen */
.facts { margin-top: 1.4rem; border-top: 1px solid rgba(26, 26, 26, 0.1); }
.facts div {
    display: flex; align-items: baseline; gap: 0.75rem;
    padding: 0.7rem 0; border-bottom: 1px solid rgba(26, 26, 26, 0.08);
    opacity: 0; transform: translateY(6px);
    animation: fact-in 0.6s var(--ease-out) forwards;
}
.facts div:nth-child(1) { animation-delay: 1.5s; }
.facts div:nth-child(2) { animation-delay: 1.62s; }
.facts div:nth-child(3) { animation-delay: 1.74s; }
.facts div:nth-child(4) { animation-delay: 1.86s; }
.facts dt { color: var(--text-soft); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.facts .dots { flex: 1; border-bottom: 2px dotted rgba(26, 26, 26, 0.18); transform: translateY(-4px); min-width: 12px; }
.facts dd { font-weight: 700; font-size: 0.98rem; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.facts dd.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.facts dd a { color: var(--ember); text-decoration: none; border-bottom: 1px solid rgba(196, 62, 12, 0.3); }
.facts dd a:hover { border-bottom-color: var(--ember); }

.status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--green); }
.status i {
    width: 9px; height: 9px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 0 0 rgba(27, 158, 75, 0.5);
    animation: pulse 2.2s ease-out 2s infinite;
}

/* Siegel */
.seal-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.seal-text { font-size: 0.86rem; color: var(--text-mid); line-height: 1.45; }
.seal-text strong { color: var(--text); display: block; font-size: 0.95rem; }
.seal { width: 72px; height: 72px; flex: none; position: relative; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal .ring { fill: none; stroke: var(--flame); stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 214; stroke-dashoffset: 214;
    animation: draw 0.9s var(--ease-out) 1.35s forwards; }
.seal .ring-soft { fill: rgba(232, 87, 31, 0.08); stroke: none; transform-origin: center;
    transform: scale(0.6); opacity: 0; animation: seal-pop 0.7s var(--ease-settle) 1.4s forwards; }
.seal .tick { fill: none; stroke: var(--flame); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 40; stroke-dashoffset: 40;
    animation: draw 0.5s var(--ease-out) 2.05s forwards; }
.seal .glow { position: absolute; inset: -20px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 138, 80, 0.55), transparent 65%);
    opacity: 0; animation: glow-flash 1.2s ease-out 2.1s forwards; }

/* ═══ UNTER DER KARTE ═══ */
.after {
    opacity: 0; animation: fade-up 0.9s var(--ease-out) 2.2s forwards;
}
.lead {
    text-align: center; margin: 2rem auto 1.25rem; max-width: 34ch;
    font-size: 1.05rem; color: var(--on-navy);
}
.lead strong { color: var(--cream); font-weight: 700; }

.call {
    display: flex; align-items: center; justify-content: center; gap: 0.7rem;
    width: 100%; padding: 1rem 1.25rem;
    background: var(--flame); color: var(--white);
    border-radius: var(--r-pill); text-decoration: none;
    font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em;
    box-shadow: 0 14px 34px -14px rgba(232, 87, 31, 0.9);
    transition: transform 0.25s var(--ease-out), background 0.25s, box-shadow 0.25s;
}
.call:hover { background: var(--flame-light); transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(255, 138, 80, 0.9); }
.call:active { transform: translateY(0); }
.call svg { width: 20px; height: 20px; }
.call-hint { text-align: center; font-size: 0.82rem; color: var(--on-navy-soft); margin-top: 0.7rem; }

/* Erkennungsmerkmale */
.marks { margin-top: 3rem; }
.marks h2 { font-size: 1.55rem; color: var(--cream); margin-bottom: 1.1rem; }
.marks ul { list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.marks li {
    display: grid; grid-template-columns: 40px 1fr; gap: 1rem; align-items: start;
    padding: 1.1rem 0.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.marks li svg { width: 40px; height: 40px; color: var(--flame-light); }
.marks li p { font-size: 0.95rem; line-height: 1.5; }
.marks li strong { color: var(--cream); display: block; margin-bottom: 0.1rem; }
.marks a { color: var(--flame-glow); text-decoration: none; border-bottom: 1px solid rgba(255, 194, 151, 0.35); }

/* Footer */
.foot {
    margin-top: auto; padding-top: 3rem;
    display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; justify-content: center;
    font-size: 0.8rem; color: var(--on-navy-soft);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--cream); }
.foot .stand { flex-basis: 100%; text-align: center; margin-top: 0.5rem; }

/* ═══ INDEX-SEITE (Suche) ═══ */
.search-card {
    background: linear-gradient(165deg, var(--white) 0%, var(--cream) 55%, var(--cream-warm) 100%);
    color: var(--text); border-radius: var(--r-card); overflow: hidden;
    box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7), 0 20px 40px -20px rgba(232,87,31,0.35);
    opacity: 0; animation: card-rise 1.2s var(--ease-settle) 0.3s forwards;
}
.search-card .badge-body h1 { font-size: 1.9rem; }
.search-card p { color: var(--text-mid); margin-top: 0.5rem; font-size: 0.95rem; }
.search-form { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.search-form input {
    flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 1rem;
    padding: 0.85rem 1rem; border-radius: var(--r-md);
    border: 2px solid rgba(26,26,26,0.12); background: var(--white); color: var(--text);
}
.search-form input:focus { border-color: var(--flame); outline: none; }
.search-form button {
    font: inherit; font-weight: 700; color: var(--white); background: var(--navy);
    border: 0; border-radius: var(--r-md); padding: 0 1.2rem; cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover { background: var(--flame); }
.search-msg { margin-top: 0.8rem; font-size: 0.9rem; min-height: 1.4em; color: var(--ember); }
.search-msg:empty { display: none; }

/* ═══ ANIMATIONEN ═══ */
@keyframes lamp-on { to { opacity: 1; transform: translateX(-50%) scaleY(1); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes card-rise {
    0%   { opacity: 0; transform: translateY(70px) rotateX(18deg) scale(0.94); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}
@keyframes holo-sweep { to { transform: translateX(120%); } }
@keyframes holo-loop {
    0%, 70% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}
@keyframes ring-spin { to { --ring-angle: 360deg; } }
@keyframes fact-in { to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes seal-pop { to { opacity: 1; transform: scale(1); } }
@keyframes glow-flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(27,158,75,0.5); } 100% { box-shadow: 0 0 0 10px rgba(27,158,75,0); } }
@keyframes ember-rise {
    0%   { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
    10%  { opacity: 0.9; }
    50%  { transform: translateY(-50vh) translateX(var(--drift, 20px)) scale(1); }
    100% { transform: translateY(-105vh) translateX(calc(var(--drift, 20px) * -1)) scale(0.4); opacity: 0; }
}

@media (min-width: 600px) {
    .page { padding-top: 2.2rem; }
    .badge-body { padding: 1.9rem 2rem 1.6rem; }
    .badge-head { grid-template-columns: 132px 1fr; gap: 1.5rem; }
    .photo { width: 132px; height: 132px; }
}
@media (max-width: 380px) {
    .badge-head { grid-template-columns: 1fr; justify-items: start; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .embers { display: none; }
    .badge, .stage-lamp, .topbar, .after, .facts div, .search-card { opacity: 1; transform: none; }
    .seal .ring, .seal .tick { stroke-dashoffset: 0; }
    .seal .ring-soft { opacity: 1; transform: none; }
}
