/* WaterMeter CSS variables — water-utility theme (blues/teals) */
:root {
    --wc-primary: #0d6efd;
    --wc-secondary: #0dcaf0;
    --wc-accent: #20c997;
    --wc-danger: #dc3545;
    --wc-bg: #f8f9fa;
    --wc-surface: #ffffff;
    --wc-text: #212529;
    --wc-muted: #6c757d;
    --wc-border: #dee2e6;
    --wc-sidebar-width: 240px;
    --wc-sidebar-bg: #212529;
    --wc-touch-target: 44px;
}

[data-theme=dark] {
    --wc-bg: #1a1d20;
    --wc-surface: #212529;
    --wc-text: #f8f9fa;
    --wc-muted: #adb5bd;
    --wc-border: #495057;
}

.wc-app-shell {
    min-height: 100vh;
}

.wc-sidebar {
    width: var(--wc-sidebar-width);
    flex-shrink: 0;
}

.wc-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.wc-nav .active {
    background-color: var(--wc-primary) !important;
}

/* Phase 14 MRP-03: Sidebar-Collapse + Hamburger-Toggle (`<992px`) — see also
   MainLayout.razor.css for scoped Topbar styles + checkbox-hack toggle.
   We must keep the `.wc-sidebar` collapse rule global (not in `.razor.css`) so it wins
   against component-scoped overrides; the toggle-on rule uses `:has(#wc-sidebar-toggle:checked)`
   on `.wc-app-shell` so it matches the same specificity tier.

   Phase 14 MRP-05: Modal-Fullscreen on `<576px` — the project keeps Modal.razor
   untouched (Olaf-WIP); same effect achieved here via CSS-Override on Bootstrap's
   `.modal-dialog`. Equivalent to Bootstrap class `modal-fullscreen-sm-down`. */
@media (max-width: 991.98px) {
    /* `!important` on `display` is required because the aside in MainLayout.razor
       carries Bootstrap's `.d-flex` utility (`display: flex !important`), which
       otherwise wins the cascade and keeps the sidebar visible on mobile —
       covering the page with a full-height empty container and pushing <main>
       off-screen (post-Phase-14 hotfix 2026-04-27, login-blank bug). */
    .wc-sidebar {
        display: none !important;
        width: 100% !important;
    }

    .wc-app-shell:has(#wc-sidebar-toggle:checked) .wc-sidebar {
        display: flex !important;
    }
}

@media (max-width: 575.98px) {
    .modal .modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }

    .modal .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4O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.blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------------------------------------------------------------------------
   UAT-CAPTURE-FULLSCREEN-FIX: body-class rules for FullscreenCaptureLayout.
   Razor scoped CSS cannot reach <body> or app-shell siblings, so these rules
   live globally. Toggled via window.captureFullscreen.activate()/.deactivate()
   in wwwroot/js/capture-fullscreen.js.
   --------------------------------------------------------------------------- */
body.wc-fullscreen-active {
    overflow: hidden;
    height: 100vh;
}

body.wc-fullscreen-active .wc-mobile-topbar,
body.wc-fullscreen-active .wc-sidebar,
body.wc-fullscreen-active .top-row,
body.wc-fullscreen-active #blazor-error-ui {
    display: none !important;
}

/* ---------------------------------------------------------------------------
   UAT-CAPTURE-FULLSCREEN-FIX: FullscreenCaptureLayout — moved here from the
   .razor.css scoped file because Razor scoped-CSS attribute mangling combined
   with `::deep` did not reliably hit the rendered elements at runtime (white
   background + tiny default buttons in the live UI). Plain global selectors
   are deterministic and match the rendered DOM 1:1.
   --------------------------------------------------------------------------- */
.wc-fc-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    overflow: hidden;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}

/* UAT-CAPTURE-PINCH-CANVAS: Background fills viewport; centers the photo wrapper. */
.wc-fc-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.wc-fc-bg .wc-camera-live,
.wc-fc-bg .wc-camera-live video {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #000 !important;
}

/* Pinch-zoom target: pinchZoomInterop sets `transform` inline. The transition only
   animates the snap-back (no transition during active pinch, which sets transform
   directly each frame). */
.wc-fc-zoom-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: transform 220ms ease-out;
    will-change: transform;
}

/* Photo at natural aspect ratio. Letterbox padding is OK — the brush-stack is
   sized via JS to match the rendered (contained) image rect exactly. */
.wc-fc-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* JS sets position/left/top/width/height after image-load to match the rendered
   <img> bounding box exactly. The brush-stack itself is transparent to pointer
   events; the active canvas inside re-enables them. */
.wc-fc-brush-stack {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wc-fc-brush-stack > * {
    pointer-events: auto;
}

.wc-fc-brush-stack .wc-fc-brush-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Back arrow top-left */
.wc-fc-back {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-fc-back:active {
    background: rgba(0, 0, 0, 0.8);
}

/* UAT-CAPTURE-TOUCH-FIX Bug 2: prominent "weiter" pill top-right (mirror of back arrow). */
.wc-fc-next-top {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    border-radius: 22px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}

.wc-fc-next-top:active {
    transform: scale(0.96);
}

/* Circle row at bottom */
.wc-fc-circles {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 16px;
    pointer-events: none; /* let children opt-in */
}

.wc-fc-circles > * {
    pointer-events: auto;
}

.wc-fc-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 100ms;
    -webkit-tap-highlight-color: transparent;
}

.wc-fc-circle:active:not(:disabled) {
    transform: scale(0.92);
}

.wc-fc-circle.active {
    border-width: 6px;
    border-color: #fff;
    transform: scale(1.05);
}

.wc-fc-circle:disabled {
    opacity: 0.45;
}

.wc-fc-circle.busy {
    opacity: 0.6;
}

.wc-fc-circle-id {
    background: #1a3fff; /* Olaf-Mock blau */
}

.wc-fc-circle-cam {
    background: #2dd4bf; /* Olaf-Mock cyan/türkis */
    width: 52px;
    height: 52px; /* primary action — slightly larger */
    color: #003330;
}

.wc-fc-circle-cam i {
    font-size: 1.05rem;
}

.wc-fc-circle-z {
    background: #ef4444; /* Olaf-Mock rot */
}

/* Z-Button stack with "weiter" pill below */
.wc-fc-circle-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wc-fc-next {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    border-radius: 22px;
    padding: 8px 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}

.wc-fc-next:active {
    transform: scale(0.96);
}

/* Pixel-5 + small phones: bump touch-target up to Apple's 44px minimum-comfort
   (still much smaller than the original 88/96px that Olaf flagged as "vielzugroß"). */
@media (max-width: 380px) {
    .wc-fc-circle {
        width: 48px;
        height: 48px;
        font-size: 0.85rem;
    }
    .wc-fc-circle-cam {
        width: 56px;
        height: 56px;
    }
    .wc-fc-circle-cam i {
        font-size: 1.15rem;
    }
}
/* BUG-FIX 2026-05-04: photo thumb + lightbox on the value-entry screen so the
   worker can read the meter when OCR returns no value. Plain <img> with native
   browser pinch-zoom in the lightbox — no custom interop. */
.wc-value-photo-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
}
.wc-value-photo-thumb img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    background: #000;
}
.wc-value-photo-thumb-hint {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
}

.wc-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pinch-zoom;
}
.wc-photo-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: pinch-zoom;
}
.wc-photo-lightbox-close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #000;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    -webkit-tap-highlight-color: transparent;
}
