/* Digitale Warteschlange -- Kund:innen-Web-App
   Design-Tokens und Komponenten, Optik abgeleitet aus assets/Mockups. */

:root {
    --primary: #2563eb;
    --primary-dark: #1e3a8a;
    --primary-soft: #eff6ff;

    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #111827;
    --muted: #6b7280;
    --muted-2: #9ca3af;

    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #f59e0b;
    --warning-soft: #fef9c3;
    --warning-text: #854d0e;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --gold: #f59e0b;
    --dark: #0f172a;
    --frame: #1a1f2e;

    --radius: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Geraet / Screen --------------------------------------------------- */

.screen {
    position: relative;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Header ------------------------------------------------------------ */

.app-header {
    background: var(--primary);
    color: #fff;
    padding: 16px 20px 20px;
    text-align: center;
    flex-shrink: 0;
}

.app-header .title {
    font-size: 19px;
    font-weight: 700;
}

.app-header .subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 3px;
}

.app-header.brand {
    padding: 22px 20px 26px;
}

.app-header.brand .title {
    font-size: 20px;
}

/* Header mit Zurueck-Pfeil fuer Unterseiten */
.app-header.nav {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    text-align: center;
    padding: 14px 16px;
}

.app-header.nav .back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #fff;
}

.app-header.nav .title {
    font-size: 17px;
}

.app-header .label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
}

.app-header .head-center {
    line-height: 1.2;
}

/* --- Main / Layout ----------------------------------------------------- */

main {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

main.center {
    justify-content: center;
}

.section-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

.center-text {
    text-align: center;
}

/* --- Card -------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card.soft {
    background: var(--primary-soft);
    border-color: #dbeafe;
}

.card.warning {
    background: var(--warning-soft);
    border-color: var(--warning);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.card.soft .card-title {
    color: var(--primary-dark);
}

/* --- Ticket-/Positions-Anzeige ----------------------------------------- */

.position {
    text-align: center;
}

.position .label {
    font-size: 13px;
    color: var(--muted);
}

.position .number {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.05;
    color: var(--primary);
}

.position .sub {
    font-size: 13px;
    color: var(--muted);
}

.waittime {
    text-align: center;
}

.waittime .label {
    font-size: 13px;
    color: var(--muted);
}

.waittime .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 2px;
}

.big-ticket {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- Progress ---------------------------------------------------------- */

.called-label {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 8px;
}

.progress {
    height: 9px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
}

.progress-fill.warning {
    background: var(--warning);
}

/* --- Buttons ----------------------------------------------------------- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger-solid {
    background: var(--danger);
    color: #fff;
}

.btn-dark {
    background: var(--dark);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-pause {
    background: var(--warning-soft);
    color: var(--warning-text);
}

/* --- Sprachlinks / Pills ----------------------------------------------- */

.lang-links {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.lang-links a {
    color: var(--muted);
    padding: 0 4px;
}

.lang-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pills.segmented {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.pills.segmented .pill {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    border-radius: 7px;
}

.pills.segmented .pill.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* --- Stepper ----------------------------------------------------------- */

.stepper {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 17px;
    font-weight: 600;
}

.stepper button {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.link {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* --- Hint / Banner ----------------------------------------------------- */

.hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    background: var(--surface-2);
    color: var(--muted);
}

.hint.info {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.hint.success {
    background: var(--success-soft);
    color: #166534;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.hint.warning {
    background: var(--warning-soft);
    color: var(--warning-text);
}

/* --- Sterne ------------------------------------------------------------ */

.stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 40px;
    line-height: 1;
}

.star {
    color: var(--border-strong);
}

.star.filled {
    color: var(--gold);
}

/* --- Wallet ------------------------------------------------------------ */

.wallet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
}

.wallet-btn.apple {
    background: var(--dark);
    color: #fff;
}

.wallet-btn.google {
    background: var(--primary);
    color: #fff;
}

/* --- QR-Code ----------------------------------------------------------- */

.qr {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.qr-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    grid-template-rows: repeat(21, 1fr);
}

.qr-grid div {
    background: #111827;
}

.qr-grid div.off {
    background: #fff;
}

/* --- Link-Box ---------------------------------------------------------- */

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: "SFMono-Regular", Menlo, monospace;
    font-size: 13px;
    color: var(--text);
}

.link-box .url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-box button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* --- Mitglieder -------------------------------------------------------- */

.member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.member + .member {
    border-top: 1px solid var(--border);
}

.member .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.member .name {
    font-size: 15px;
    font-weight: 600;
}

.member .meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 3px 9px;
    border-radius: 999px;
}

/* --- Schritt-Liste (nummeriert) ---------------------------------------- */

.steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step .num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step .text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.45;
}

/* --- Praesenz-Hero ----------------------------------------------------- */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 12px 8px;
}

.hero .pulse {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 0 0 14px rgba(37, 99, 235, 0.06);
}

.hero h2 {
    font-size: 24px;
    font-weight: 700;
}

.hero p {
    font-size: 15px;
    color: var(--muted);
    max-width: 280px;
}

.countdown {
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
}

.countdown strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.countdown-big {
    font-size: 44px;
    font-weight: 700;
    color: var(--warning-text);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* --- Stat-Zeilen ------------------------------------------------------- */

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
}

.stat-row + .stat-row {
    border-top: 1px solid var(--border);
}

.stat-label {
    font-size: 14px;
    color: var(--muted);
}

.stat-value {
    font-size: 15px;
    font-weight: 600;
}

/* --- Footer-Actions ---------------------------------------------------- */

.footer-actions {
    padding: 12px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

/* --- Status-Pill ------------------------------------------------------- */

.status-pill {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: var(--success-soft);
    color: #166534;
}

/* --- Textarea ---------------------------------------------------------- */

.textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    resize: none;
}

.textarea::placeholder {
    color: var(--muted-2);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

/* --- Pause-Badge ------------------------------------------------------- */

.pause-badge {
    display: inline-block;
    align-self: center;
    background: var(--warning);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 999px;
}

/* --- Overlay / Bottom-Sheet (verlassen.html) --------------------------- */

.dim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: flex-end;
    z-index: 10;
}

.sheet {
    width: 100%;
    background: var(--surface);
    border-radius: 22px 22px 36px 36px;
    padding: 12px 22px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.sheet .handle {
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--border-strong);
    margin-bottom: 4px;
}

.sheet .warn-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--danger-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.sheet h2 {
    font-size: 20px;
    font-weight: 700;
}

.sheet p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.sheet .btn {
    margin-top: 4px;
}

/* --- Drawer / Menue (menue.html) --------------------------------------- */

.backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 10;
}

.drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 312px;
    background: var(--surface);
    z-index: 11;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
}

.drawer-head {
    background: var(--primary);
    color: #fff;
    padding: 22px 20px;
}

.drawer-head .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.drawer-head .number {
    font-size: 30px;
    font-weight: 700;
    margin: 2px 0;
}

.drawer-head .meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

.drawer-section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.drawer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 15px;
    color: var(--text);
}

.drawer-row .ic {
    width: 30px;
    text-align: center;
    font-size: 17px;
}

.drawer-foot {
    margin-top: auto;
    padding: 18px 20px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* --- QR-Scan-Illustration (einstieg.html) ------------------------------ */

.scan-card {
    text-align: center;
    padding: 28px 18px;
}

.scan-card .cam {
    font-size: 56px;
}

.scan-card h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 12px;
}

.scan-card p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

.divider {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
