/* needsto.be-Hub. Kacheln = die Homescreen-Widgets. Keine externen Quellen (CSP). */
@font-face { font-family: 'Pixelify Sans'; src: url('/fonts/PixelifySans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-20AB, U+20AD-FFFF; }
@font-face { font-family: 'Doto'; src: url('/fonts/Doto.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #140e0b; --card: #1e1511; --line: #3a2a21; --ink: #fff1d7; --dim: #fff1d78f; --faint: #fff1d74d;
  --acc: #ff985b; --acc-ink: #1a0f09; --neg: #ff7a6a; --r: 22px;
  font: 16px/1.4 ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  color: var(--ink); background: var(--bg); color-scheme: dark; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 80% -10%, #2b1d17 0%, var(--bg) 60%) fixed; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.acc { color: var(--acc); }
h1, p { margin: 0; }

.top { max-width: 560px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px 0; display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.brand { font: 700 22px/1 'Pixelify Sans', sans-serif; letter-spacing: -.03em; display: flex; align-items: center; gap: 9px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; transform: rotate(-12deg); }
.brand-mark i { width: 7px; height: 7px; background: #f15b2a; }
.brand-mark i:nth-child(2) { background: #efaa4b; }
.brand-mark i:nth-child(3) { background: #f58c3b; }
.brand-mark i:nth-child(4) { background: #d94727; }
.logout { margin: 0; }
.logout button { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--faint); }
.logout button:hover { color: var(--ink); }
.logout svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 560px; margin: 0 auto; padding: 22px 16px calc(40px + env(safe-area-inset-bottom)); }

/* Kacheln */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; min-width: 0;
  transition: transform .16s cubic-bezier(.2, .8, .2, 1); }
.tile:active { transform: scale(.97); }
.tile strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-label { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-label i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.t-name { font: 700 34px/1 'Pixelify Sans', sans-serif; letter-spacing: -.04em; }

/* Zivi: Punktmatrix wie das Widget */
.tile-zivi { background: #0e0e0e; border: 1px solid #222; font-family: 'Doto', ui-monospace, monospace; font-weight: 700; }
.tile-zivi .t-label { color: #8c8c8c; font-size: 15px; letter-spacing: .04em; }
.tile-zivi .t-label i { background: #d71921; box-shadow: 0 0 10px #d7192188; }
.tile-zivi strong { color: #fff; font-size: clamp(40px, 14vw, 64px); line-height: .9; font-weight: 600; }
.tile-zivi .t-sub { color: #e6e6e6; font-size: 17px; letter-spacing: .02em; }

/* Payment: needsto-Orange */
.tile-payment { background: linear-gradient(160deg, #3a2418, #22160f 70%); border: 1px solid #ff985b33; }
.tile-payment .t-label { color: var(--dim); font-size: 14px; font-weight: 600; }
.tile-payment .t-label i { background: var(--acc); box-shadow: 0 0 10px #ff6a2a88; }
.tile-payment strong { font: 700 clamp(28px, 9vw, 44px)/1 'Pixelify Sans', sans-serif; letter-spacing: -.04em; color: var(--acc); }
.tile-payment .t-sub { color: var(--dim); font-size: 14px; font-weight: 600; }
.tile-payment:has(.t-name) strong { color: var(--ink); text-shadow: none; }

/* Login / Passwort / Fehler */
.gate { padding-top: 8vh; display: grid; gap: 24px; }
.gate h1 { font: 700 clamp(40px, 11vw, 64px)/.95 'Pixelify Sans', sans-serif; letter-spacing: -.04em; text-shadow: 0 0 24px #ff6a2a40; }
.gate h1 em { font-style: normal; color: var(--acc); }
.gate form { margin: 0; }
.eyebrow { color: var(--dim); font-size: 14px; font-weight: 600; }
.pw-row { display: flex; align-items: center; min-height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 6px 0 16px; }
.pw-row:focus-within { border-color: var(--acc); }
.pw-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; caret-color: var(--acc); }
.pw-row input::placeholder { color: var(--faint); }
.pw-row button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--acc); color: var(--acc-ink); font-size: 20px; font-weight: 700; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dim); }
.form input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 14px; font-size: 16px; caret-color: var(--acc); }
.form input:focus { outline: 0; border-color: var(--acc); }
.primary { min-height: 50px; border: 0; border-radius: 12px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 16px; }
.error { color: var(--neg); font-size: 14px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
