/* druckstatus.datrax.de — Statusseite
   Theme abgeleitet aus der Fotobox-App, optimiert für Smartphone-Browser. */

:root {
    --bg:         #0d0d1a;
    --bg2:        #161628;
    --bg3:        #1e1e35;
    --surface:    #232340;
    --border:     #2e2e50;
    --accent:     #6c63ff;
    --accent2:    #a78bfa;
    --accent-dim: #3d3880;
    --text:       #e8e8f0;
    --text2:      #9898b8;
    --text3:      #5a5a7a;
    --danger:     #ff4d6d;
    --success:    #4ade80;
    --warning:    #fbbf24;
    --radius:     14px;
    --radius-lg:  24px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 18px 24px;
    /* Achtung: KEIN background-attachment:fixed — verursacht massiven
       Paint-Lag auf Mobile (Touch-Events unresponsive). */
    background:
        radial-gradient(1200px 600px at 18% -8%, rgba(108,99,255,.28), transparent 62%),
        radial-gradient(900px 500px at 112% 108%, rgba(167,139,250,.18), transparent 58%),
        var(--bg);
}

/* ── Brand-Header außerhalb der Card ──────────────────────────────── */
.app-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 22px;
    color: var(--text2);
}
.app-brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 0 14px rgba(108,99,255,.7);
}
.app-brand-text {
    font-size: 13px;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
    width: 100%; max-width: 580px;
    background: linear-gradient(180deg, var(--bg2), #131322);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 26px 30px;
    /* Mobile-friendly: keine Mega-Schatten, nur dezenter Glow */
    box-shadow: 0 12px 40px rgba(0,0,0,.4),
                0 1px 0 rgba(255,255,255,.04) inset;
    position: relative;
    overflow: hidden;
}
.card::before {
    /* dezenter Top-Highlight-Streifen */
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,.5), transparent);
}

/* ── Header in der Card (Code-Pill) ──────────────────────────────── */
.hdr {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 22px;
}
.brand {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text3);
    font-weight: 600;
}
.code-pill {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    letter-spacing: .15em;
    font-weight: 700;
}

/* ── Status-Hero ──────────────────────────────────────────────────── */
.status-hero {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    text-align: center;
}
.status-icon {
    width: 96px; height: 96px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--accent2);
    position: relative;
    transition: all .35s ease;
}
.status-icon svg { width: 48px; height: 48px; }

.status-icon.is-printing {
    background: linear-gradient(135deg, var(--accent-dim), rgba(108,99,255,.15));
    color: #fff;
    box-shadow: 0 0 32px rgba(108,99,255,.45),
                inset 0 0 0 1px rgba(167,139,250,.4);
}
.status-icon.is-printing svg { animation: status-spin 6s linear infinite; transform-origin: 50% 50%; }
.status-icon.is-ready {
    background: linear-gradient(135deg, #2d6b3f, #16a34a);
    color: #fff;
    box-shadow: 0 0 36px rgba(74,222,128,.55),
                inset 0 0 0 1px rgba(74,222,128,.55);
}
.status-icon.is-ready svg { animation: status-pop .6s cubic-bezier(.5,1.6,.6,1) 1; }
.status-icon.is-error {
    background: linear-gradient(135deg, #8a1c2e, #b91c1c);
    color: #fff;
    box-shadow: 0 0 24px rgba(255,77,109,.3);
}
/* Bei Endzuständen ALLE Endlos-Animationen + teure Glow-Shadows ausschalten.
   Ohne das hängt der Browser auf Mobile beim Scrollen/Tippen, weil GPU
   permanent Shimmer + Spinner + Glow neu rendert. */
body.is-terminal .progress-fill::after,
body.is-terminal .status-icon.is-printing svg { animation: none !important; }
body.is-terminal .progress-fill           { box-shadow: none; }
body.is-terminal .status-icon.is-printing { box-shadow: none; }
body.is-terminal .status-icon.is-ready    { box-shadow: 0 0 0 1px rgba(74,222,128,.55) inset; }
body.is-terminal .status-icon.is-error    { box-shadow: 0 0 0 1px rgba(255,77,109,.55) inset; }
body.is-terminal .app-brand-dot           { box-shadow: none; }
@keyframes status-spin { to { transform: rotate(360deg); } }
@keyframes status-pop {
    from { transform: scale(.4); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
}
.muted     { color: var(--text2); }
.small     { font-size: 13px; }
.error-txt { color: var(--danger); }
a          { color: var(--accent2); text-decoration: none; font-weight: 600; }
a:hover    { text-decoration: underline; }

/* ── Progress ────────────────────────────────────────────────────── */
.progress-wrap {
    display: flex; align-items: center; gap: 14px;
    margin: 6px 0 22px;
}
.progress-bar {
    flex: 1;
    height: 16px;
    background: var(--bg3);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.4);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%);
    border-radius: 999px;
    transition: width .8s cubic-bezier(.3,.7,.3,1);
    box-shadow: 0 0 18px rgba(108,99,255,.6);
    position: relative;
    overflow: hidden;
}
.progress-fill::after {
    /* Shimmer-Streifen */
    content: '';
    position: absolute; top: 0; left: -40%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
    animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { to { left: 130%; } }

.progress-text {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 22px;
    min-width: 70px;
    text-align: right;
    letter-spacing: -.02em;
}

/* ── Meta-Grid ───────────────────────────────────────────────────── */
.meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
}
.meta > div {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: left;
}
.meta dt {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text3);
    margin-bottom: 4px;
    font-weight: 600;
}
.meta dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    line-height: 1.2;
}

/* Status-Text farbig je Zustand */
#status-raw[data-status="awaiting_pickup"],
#status-raw[data-status="done"]     { color: var(--success); }
#status-raw[data-status="failed"]   { color: var(--danger); }
#status-raw[data-status="cancelled"]{ color: var(--warning); }

/* Status-Meldung */
.message {
    padding: 14px 16px;
    background: var(--bg3);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    margin: 0 0 18px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

/* Notification-Hinweis-Card */
.notify-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    color: var(--text2);
    font-size: 13px;
    line-height: 1.4;
}
.notify-card svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent2); }
.notify-card button {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; border: none;
    padding: 8px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; flex-shrink: 0;
}
.notify-card[hidden] { display: none; }

/* Form (Landing) */
.form { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 22px; }
.form label {
    display: flex; flex-direction: column; gap: 8px;
    font-size: 13px; color: var(--text2); font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.form input {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 17px;
    font-family: ui-monospace, monospace;
    letter-spacing: .1em;
    text-transform: none;
    font-weight: 600;
}
.form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(108,99,255,.25);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border: none;
    padding: 16px 22px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 12px 32px rgba(108,99,255,.35);
    transition: transform .12s, filter .15s, box-shadow .15s;
}
.btn:hover  { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }

/* Hint-Text + Footer */
.hint { color: var(--text3); font-size: 12.5px; line-height: 1.5; text-align: center; margin: 4px 0 0; }
.footer {
    margin-top: 22px;
    font-size: 12px;
    color: var(--text3);
    display: flex; gap: 14px;
}
.footer a { color: var(--text2); font-weight: 400; }

/* Mobile-Tweaks */
@media (max-width: 480px) {
    body { padding: 22px 14px 18px; }
    .card { padding: 26px 20px 24px; border-radius: 22px; }
    h1 { font-size: 28px; }
    .status-icon { width: 84px; height: 84px; }
    .status-icon svg { width: 40px; height: 40px; }
    .meta { grid-template-columns: 1fr 1fr; }
    .progress-text { font-size: 20px; min-width: 60px; }
}

/* Reduce motion: keine Animationen */
@media (prefers-reduced-motion: reduce) {
    .status-icon.is-printing svg,
    .progress-fill::after { animation: none; }
    .progress-fill { transition: width .2s linear; }
}

/* Text-Seiten (Datenschutz/Impressum) */
.text-page .card { max-width: 640px; }
.text-page h2 { color: var(--text2); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin: 24px 0 8px; font-weight: 700; }
.text-page p, .text-page li { line-height: 1.65; font-size: 15px; }
.text-page ul { padding-left: 20px; }

/* ── Landing: Feature-Liste ──────────────────────────────────────── */
.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0 20px;
}
.feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.feature-ic {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-dim), rgba(108,99,255,.18));
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent2);
    flex-shrink: 0;
}
.feature-ic svg { width: 22px; height: 22px; }
.feature-h {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.feature-p {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text2);
}

.card-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 6px 0 18px;
}

/* Code-Eingabe als Disclosure */
.code-entry {
    margin: 0 0 18px;
}
.code-entry summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; justify-content: space-between;
    user-select: none;
}
.code-entry summary::-webkit-details-marker { display: none; }
.code-entry summary::after {
    content: '+';
    color: var(--accent2);
    font-size: 22px;
    line-height: 1;
    transition: transform .2s;
}
.code-entry[open] summary::after { transform: rotate(45deg); }
.code-entry[open] summary {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
}
.code-entry[open] .form,
.code-entry[open] .muted {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding-left: 16px; padding-right: 16px;
}
.code-entry[open] .form {
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding-bottom: 16px;
    margin: 0;
}
