/* FootConcept Mobile - PWA Stylesheet */
:root {
    --fc-primary: #1d5fa8;
    --fc-primary-dark: #154d8e;
    --fc-primary-light: #dbeafe;
    --fc-nav-bg: #0f2847;
    --fc-page-bg: #edf2f9;
    --fc-white: #ffffff;
    --fc-text: #1a2e4a;
    --fc-text-muted: #64748b;
    --fc-border: #d0dff0;
    --fc-success: #16a34a;
    --fc-warning: #d97706;
    --fc-danger: #ef4444;
    --fc-radius: 10px;
    --fc-radius-sm: 6px;
    --fc-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fc-page-bg);
    color: var(--fc-text);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* App Shell – feste Hoehe, Flex-Column Layout.
   Bottom-Nav ist als normales flex-Kind platziert (nicht fixed),
   damit sie nach Pull-to-Refresh / Safari-Viewport-Changes nie verschwindet. */
.fc-mobile-app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;  /* das Shell scrollt nicht – nur .fc-content */
}

/* Top Bar */
.fc-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--fc-nav-bg); color: white; z-index: 100; flex-shrink: 0; }
.fc-topbar-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 600; }
.fc-btn-icon { background: rgba(255,255,255,.12); border: none; color: white; padding: 8px; border-radius: var(--fc-radius-sm); cursor: pointer; display: flex; align-items: center; }
.fc-btn-icon:hover { background: rgba(255,255,255,.22); }

/* Bottom Nav – normal im Flex-Layout, nie mehr 'fixed' */
.fc-bottomnav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    background: white;
    border-top: 1px solid var(--fc-border);
    z-index: 100;
    flex-shrink: 0;  /* nie kleiner werden */
}
.fc-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; font-size: 0.7rem; color: var(--fc-text-muted); text-decoration: none; border-radius: 8px; transition: all .2s; }
.fc-nav-item.active, .fc-nav-item:hover { color: var(--fc-primary); }
.fc-nav-item.active { font-weight: 600; }
.fc-nav-primary { color: white !important; background: var(--fc-primary); border-radius: 50%; width: 52px; height: 52px; margin-top: -18px; box-shadow: 0 2px 8px rgba(29,95,168,.4); justify-content: center; padding: 0; }

/* Content – scrollt eigenstaendig, nicht das gesamte Shell.
   Dadurch bleibt die Bottom-Nav immer am unteren Rand sichtbar. */
.fc-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px;
}
.fc-page { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fc-page-title { font-size: 1.4rem; font-weight: 700; color: var(--fc-text); margin-bottom: 4px; }
.fc-section { margin-top: 20px; }
.fc-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.fc-mt { margin-top: 16px; }
.fc-mt-sm { margin-top: 8px; }

/* Cards */
.fc-card { background: white; border-radius: var(--fc-radius); border: 1px solid var(--fc-border); padding: 16px; box-shadow: var(--fc-shadow); }
.fc-card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }
.fc-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.fc-action-card { background: white; border: 1px solid var(--fc-border); border-radius: var(--fc-radius); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 500; box-shadow: var(--fc-shadow); transition: transform .15s; }
.fc-action-card:active { transform: scale(.96); }
.fc-action-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

/* List Items */
.fc-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: white; border: 1px solid var(--fc-border); border-radius: var(--fc-radius-sm); margin-top: 6px; cursor: pointer; transition: background .15s; }
.fc-list-item:active { background: var(--fc-primary-light); }
.fc-list-item-main { display: flex; flex-direction: column; gap: 2px; }
.fc-list-item-main strong { font-size: 0.95rem; }
.fc-list-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fc-selected-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--fc-primary-light); border-radius: var(--fc-radius-sm); font-size: 0.95rem; }

/* Badges */
.fc-badge { padding: 2px 8px; border-radius: 99px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.fc-badge-blue { background: #dbeafe; color: #1d5fa8; }
.fc-badge-yellow { background: #fef3c7; color: #92400e; }
.fc-badge-green { background: #dcfce7; color: #166534; }
.fc-badge-gray { background: #f1f5f9; color: #475569; }
.fc-badge-red { background: #fee2e2; color: #991b1b; }

/* Forms */
.fc-form-group { margin-bottom: 12px; }
.fc-form-group label, .fc-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--fc-text-muted); margin-bottom: 4px; }
.fc-input { width: 100%; padding: 10px 12px; border: 1px solid var(--fc-border); border-radius: var(--fc-radius-sm); font-size: 0.95rem; color: var(--fc-text); background: white; outline: none; transition: border .2s, box-shadow .2s; -webkit-appearance: none; }
.fc-input:focus { border-color: var(--fc-primary); box-shadow: 0 0 0 3px rgba(29,95,168,.15); }
textarea.fc-input { resize: vertical; min-height: 70px; }
.fc-form-row { display: flex; gap: 10px; }
.fc-form-row .fc-form-group { flex: 1; }
.fc-search-bar { margin-top: 12px; }

/* Buttons */
.fc-btn-primary { width: 100%; padding: 12px; background: #1e88e5; color: white; border: none; border-radius: var(--fc-radius-sm); font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s; }
.fc-btn-primary:hover { background: #1565c0; }
.fc-btn-primary:disabled { opacity: .6; cursor: default; }
.fc-btn-success { background: var(--fc-success) !important; }
.fc-btn-success:hover { background: #15803d !important; }
.fc-btn-secondary { padding: 10px 20px; background: white; color: var(--fc-text); border: 1px solid var(--fc-border); border-radius: var(--fc-radius-sm); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.fc-btn-outline { width: 100%; padding: 10px; background: transparent; color: var(--fc-primary); border: 2px dashed var(--fc-primary); border-radius: var(--fc-radius-sm); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.fc-btn-link { background: none; border: none; color: var(--fc-primary); font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.fc-btn-row { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; }

/* Wizard */
.fc-wizard-steps { display: flex; justify-content: space-between; margin-top: 16px; padding: 0 4px; }
.fc-step { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--fc-text-muted); flex: 1; }
.fc-step.active { color: var(--fc-primary); font-weight: 600; }
.fc-step.done { color: var(--fc-success); }
.fc-step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--fc-border); color: var(--fc-text-muted); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; transition: all .2s; }
.fc-step.active .fc-step-dot { background: var(--fc-primary); color: white; }
.fc-step.done .fc-step-dot { background: var(--fc-success); color: white; }
.fc-wizard-nav { display: flex; justify-content: space-between; margin-top: 20px; gap: 12px; }
.fc-wizard-nav .fc-btn-primary { width: auto; flex: 1; }
.fc-wizard-nav .fc-btn-secondary { flex: 0 0 auto; }

/* Fehlstellung Checkboxes */
.fc-checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.fc-checkbox-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 2px solid var(--fc-border); border-radius: var(--fc-radius); cursor: pointer; text-align: center; font-size: 0.75rem; font-weight: 500; transition: all .2s; background: white; user-select: none; }
.fc-checkbox-card input[type=checkbox] { display: none; }
.fc-checkbox-card img { width: 48px; height: 48px; object-fit: contain; }
.fc-checkbox-card.checked { border-color: var(--fc-primary); background: var(--fc-primary-light); color: var(--fc-primary); }

/* Foto */
.fc-foto-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 24px; border: 2px dashed var(--fc-primary); border-radius: var(--fc-radius); color: var(--fc-primary); font-weight: 600; cursor: pointer; margin-top: 12px; background: var(--fc-primary-light); }
.fc-foto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.fc-foto-item { position: relative; aspect-ratio: 1; border-radius: var(--fc-radius-sm); overflow: hidden; border: 1px solid var(--fc-border); }
.fc-foto-item img { width: 100%; height: 100%; object-fit: cover; }
.fc-foto-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: white; border: none; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Summary */
.fc-summary { display: flex; flex-direction: column; gap: 8px; }
.fc-summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--fc-border); font-size: 0.9rem; }
.fc-summary-row span { color: var(--fc-text-muted); }

/* Signature */
.fc-signature-page { display: flex; flex-direction: column; align-items: center; padding: 20px 16px; min-height: 100dvh; }
.fc-signature-header { text-align: center; margin-bottom: 16px; }
.fc-signature-header h2 { font-size: 1.3rem; margin-bottom: 4px; }
.fc-signature-header p { color: var(--fc-text-muted); }
.fc-signature-canvas { width: 100%; max-width: 600px; height: 250px; border: 2px solid var(--fc-border); border-radius: var(--fc-radius); background: white; touch-action: none; cursor: crosshair; }
.fc-signature-actions { display: flex; gap: 12px; margin-top: 16px; width: 100%; max-width: 600px; }
.fc-signature-actions .fc-btn-primary { flex: 1; }
.fc-signature-done, .fc-signature-error { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-top: 60px; }

/* Alerts */
.fc-alert-error { padding: 10px 14px; background: #fee2e2; color: #991b1b; border-radius: var(--fc-radius-sm); font-size: 0.85rem; }

/* Utilities */
.fc-text-muted { color: var(--fc-text-muted); font-size: 0.82rem; }
.fc-text-small { font-size: 0.75rem; color: var(--fc-text-muted); }
.fc-loading { text-align: center; padding: 20px; color: var(--fc-text-muted); }
.fc-spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.fc-login-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 20px; background: linear-gradient(135deg, #0f2847 0%, #1d5fa8 100%); }
.fc-login-card { background: rgba(255,255,255,.95); border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.fc-login-header { text-align: center; margin-bottom: 24px; }
.fc-login-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--fc-text); }
.fc-login-subtitle { font-size: 0.9rem; color: var(--fc-text-muted); margin-top: 4px; }

/* PWA */
@media (display-mode: standalone) { .fc-topbar { padding-top: env(safe-area-inset-top, 12px); } }
@media (min-width: 601px) { .fc-mobile-app { border-left: 1px solid var(--fc-border); border-right: 1px solid var(--fc-border); } }
@media (max-width: 380px) { .fc-checkbox-grid { grid-template-columns: repeat(2, 1fr); } .fc-card-grid { grid-template-columns: repeat(2, 1fr); } }

/* App Badge */
.fc-badge-app { background: #ede9fe; color: #6d28d9; font-size: 0.82rem; padding: 1px 5px; line-height: 1; }
.fc-list-item-clickable { cursor: pointer; }
.fc-list-item-clickable:active { background: var(--fc-primary-light); }

/* Fullscreen Image Overlay */
.fc-fullscreen-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s ease; }
.fc-fullscreen-overlay img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.fc-fullscreen-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); color: white; border: none; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fc-fullscreen-close:hover { background: rgba(255,255,255,.35); }

/* Fussoverlay - Kamera mit Brandsohlen-Overlay */
.fc-fussoverlay-container { display: none; position: fixed; inset: 0; z-index: 9999; background: #000; flex-direction: column; align-items: center; justify-content: center; }
.fc-fussoverlay-container video { width: 100%; height: 100%; object-fit: cover; }
.fc-fussoverlay-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fc-fussoverlay-actions { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 16px; z-index: 10; }
.fc-fussoverlay-capture { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 4px solid #3b82f6; cursor: pointer; transition: transform .15s; }
.fc-fussoverlay-capture:active { transform: scale(.9); }
.fc-fussoverlay-close { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 20px; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; }
.fc-fussoverlay-close:hover { background: rgba(0,0,0,0.7); }
/* Sohle rechts: horizontal spiegeln (viewBox 400x800, Mitte bei x=200) */
.fc-sohle-group { transform-origin: 200px 400px; transition: transform .25s ease-out; }
.fc-sohle-mirror { transform: scaleX(-1); }

/* Kleiner Spinner im Label (z.B. "Filiale wird geladen…") */
.fc-label-hint { font-size: .8rem; color: #6b7280; margin-left: 8px; font-weight: normal; }
.fc-spinner-sm {
    display: inline-block; width: 10px; height: 10px;
    border: 2px solid rgba(59,130,246,.25); border-top-color: #3b82f6;
    border-radius: 50%; animation: fc-spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }

/* Freistellen-Toggle oben links im Kamera-Overlay */
.fc-fussoverlay-toggle {
    position: absolute;
    top: 16px; left: 16px;
    z-index: 11;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 6px 14px 6px 10px;
    color: #fff;
    font-size: .9rem;
    user-select: none;
}
.fc-fussoverlay-toggle-label { display:flex; align-items:center; gap:8px; cursor:pointer; margin:0; }
.fc-fussoverlay-toggle-label input[type=checkbox] {
    width: 18px; height: 18px; accent-color: #3b82f6; cursor: pointer;
}

/* Blazor Error UI */
#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
