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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .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;
}

/* ── Customer Portal — Mobile-First Design System ──────────────────────── */

:root {
    --primary:        #1e40af;
    --primary-light:  #dbeafe;
    --danger:         #dc2626;
    --success:        #16a34a;
    --warning:        #d97706;
    --surface:        #ffffff;
    --bg:             #f3f4f6;
    --border:         #e5e7eb;
    --text:           #111827;
    --text-muted:     #6b7280;
    --radius:         12px;
    --radius-sm:      8px;
    --topbar-h:       56px;
    --bottomnav-h:    64px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Top bar ──────────────────────────────────────────────────────────── */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    padding: 0 56px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.top-bar-title { font-weight: 700; font-size: 1rem; }
.top-bar-back {
    position: absolute; left: 12px;
    background: none; border: none; cursor: pointer;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; color: var(--text);
}
.top-bar-back:hover { background: var(--bg); }

/* ── Bottom navigation ────────────────────────────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--bottomnav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; text-decoration: none;
    color: var(--text-muted); font-size: .7rem;
    transition: color .15s;
    min-height: 44px;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--primary); }
.bottom-nav .nav-icon { font-size: 1.2rem; opacity: .7; }
.bottom-nav a.active .nav-icon { opacity: 1; }

/* ── Page content area ────────────────────────────────────────────────── */
.page-content {
    padding-top: calc(var(--topbar-h) + 12px);
    padding-bottom: calc(var(--bottomnav-h) + 12px);
    padding-left: 16px; padding-right: 16px;
    max-width: 600px; margin: 0 auto;
}
.page-content-no-nav {
    padding: 24px 16px;
    max-width: 480px; margin: 0 auto;
}

/* ── Auth / Login ─────────────────────────────────────────────────────── */
.auth-wrap {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    padding: 24px 16px;
}
.auth-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 32px 24px; width: 100%; max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 56px; }
.auth-logo img.verificer-logo { display: block; height: 36px; margin: 0 auto 14px; }
.auth-logo h1 { font-size: 1.5rem; color: var(--primary); margin: 8px 0 4px; }
.auth-logo p  { color: var(--text-muted); font-size: .875rem; margin: 0; }
.auth-step-label { font-size: .8rem; color: var(--text-muted); margin-bottom: 20px; text-align: center; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card + .card:not(.quick-action) { margin-top: 12px; }
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: .9rem;
}
.card-body { padding: 14px 16px; }

/* Quick actions grid */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action {
    display: flex; flex-direction: column; justify-content: center;
    height: 92px; padding: 16px;
    text-decoration: none; text-align: center;
}
.quick-action-icon  { font-size: 1.6rem; line-height: 1; }
.quick-action-label { font-size: .85rem; margin-top: 6px; font-weight: 500; color: var(--text); }

.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 16px 0 8px; }

/* ── Form controls ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-control {
    display: block; width: 100%;
    padding: 10px 14px;
    font-size: 1rem; line-height: 1.5;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .15s;
    -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin: 4px 0 0; }
.form-check {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: .85rem; color: var(--text);
}
.form-check input[type=checkbox] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.pin-boxes { display: flex; gap: 8px; }
.pin-box { flex: 1; min-width: 0; text-align: center; font-size: 1.4rem; font-weight: 700; padding: 10px 0; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; min-height: 44px;
    font-size: .95rem; font-weight: 600; border-radius: var(--radius-sm);
    cursor: pointer; border: 1.5px solid transparent; transition: opacity .15s, background .15s;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-secondary { background: #f3f4f6; color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: .85rem; }
.btn-loading { position: relative; color: transparent !important; }
.btn-spinner {
    position: absolute; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fade-in .15s ease;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    width: 100%;
    max-height: 90dvh;
    display: flex; flex-direction: column;
    animation: slide-up .18s ease;
}
.modal-sm { max-width: 380px; }
.modal-md { max-width: 480px; }
.modal-lg { max-width: 600px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    transition: background .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    flex-shrink: 0;
}
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 99px; font-size: .73rem; font-weight: 600;
}
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef9c3; color: #a16207; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-secondary{ background: #f3f4f6; color: #6b7280; }
.badge-primary  { background: var(--primary-light); color: var(--primary); }

/* ── List items (delivery orders) ────────────────────────────────────── */
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg); }
.list-item-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-light); font-size: 1.1rem; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub   { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Filter tabs ──────────────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.filter-tab {
    flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--text-muted);
    cursor: pointer; text-align: center; transition: background .15s, color .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.filter-tab.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ── Signature pad ────────────────────────────────────────────────────── */
.signature-pad-wrap {
    border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
    background: var(--surface); touch-action: none;
}
.signature-pad-wrap canvas { display: block; width: 100%; height: 200px; touch-action: none; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 14px; }
.alert-danger { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #15803d; }

/* ── Utility ──────────────────────────────────────────────────────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .85rem; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.required { color: var(--danger); }
