/* ========================================
   NexusOptimo Driver - Control Room Light
   Touch-optimised styles for the driver PWA.

   This app does not load site.css. The tokens below are copied from
   wwwroot/css/site.css and must stay identical to it.
   ======================================== */

:root {
    /* Surfaces */
    --ground: #EDF0EB;
    --panel: #FFFFFF;
    --panel-raised: #E9F0E6;
    --line: #D3DAD2;
    --line-strong: #B9C3BA;

    /* Ink */
    --ink: #12201A;
    --muted: #56645B;

    /* Brand. --brand is a fill and always carries --ink text. Use --green for text and
       thin marks: brand green on white is only 1.87:1. */
    --brand: #28DB14;
    --brand-hover: #22C311;
    --green: #0A7D14;
    --green-dark: #086610;
    --green-tint: #E3F1E1;

    /* Status */
    --critical: #C2410C;
    --critical-dark: #9A3412;
    --critical-tint: #FBE9E0;
    --amber: #B45309;
    --amber-dark: #8A4B08;
    --amber-tint: #FDF0D8;
    --neutral-tint: #E9EDE7;

    /* Fill level marks: only high fill takes colour. */
    --fill-high: #C2410C;
    --fill-medium: #7C8A80;
    --fill-low: #C5CEC6;

    /* Map */
    --map-land: #E6EBE3;

    /* Type */
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Shape */
    --radius: 8px;
    --radius-sm: 6px;

    /* Legacy names, still used by inline styles in views and rendered HTML. */
    --primary-color: var(--green);
    --primary-dark: var(--green-dark);
    --primary-light: var(--green-tint);
    --secondary-color: var(--muted);
    --success-color: var(--green);
    --warning-color: var(--amber);
    --danger-color: var(--critical);
    --info-color: var(--muted);
    --white: #FFFFFF;
    --bg-light: var(--ground);
    --bg-gray: var(--ground);
    --gray-50: #F6F8F5;
    --gray-100: #EDF0EB;
    --gray-200: #D3DAD2;
    --gray-300: #B9C3BA;
    --gray-400: #8C9A90;
    --gray-500: #56645B;
    --gray-600: #46544B;
    --gray-700: #36443C;
    --gray-800: #22302A;
    --gray-900: #12201A;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --font-family: var(--font-sans);
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 8px 24px rgba(18, 32, 26, 0.14);
    --shadow-xl: 0 12px 32px rgba(18, 32, 26, 0.18);

    /* Driver app only */
    --font-size-xs: 0.75rem;
    --radius-full: 9999px;
    --touch-target-min: 44px;
    --touch-target-comfortable: 56px;
    --header-height: 56px;
    --nav-height: 64px;

    /* Safe areas for notch devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

/* Reset & base */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--ink);
    background: var(--ground);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.25;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* App shell */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100vw;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-area-top));
    background: var(--panel);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: var(--safe-area-top) var(--spacing-md) 0;
    z-index: 1000;
}

.app-header-title {
    flex: 1;
    font-size: var(--font-size-lg);
    font-weight: 600;
    text-align: center;
}

.app-header-spacer {
    flex: 0 0 auto;
    width: var(--touch-target-min);
}

.app-header-btn {
    flex: 0 0 auto;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.app-header-btn:active {
    background: var(--ground);
}

/* Main content */
.app-content {
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    padding: var(--spacing-md);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-content.no-bottom-nav {
    margin-bottom: 0;
}

.app-shell.no-header .app-content {
    margin-top: 0;
    padding: 0;
}

/* Bottom navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: var(--muted);
    font-size: var(--font-size-xs);
}

.nav-item.active {
    color: var(--green);
    font-weight: 600;
}

.nav-item:active {
    background: var(--gray-50);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-weight: 500;
}

.nav-item.active .nav-label {
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--spacing-sm);
}

/* List items */
.list-item {
    display: flex;
    align-items: center;
    min-height: var(--touch-target-comfortable);
    padding: 12px var(--spacing-md);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-plain {
    padding: 0;
    border-bottom: none;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.list-item-action {
    margin-left: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-target-comfortable);
    padding: 0 var(--spacing-lg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary,
.btn-success {
    background: var(--brand);
    color: var(--ink);
    font-weight: 700;
}

.btn-primary:active,
.btn-success:active {
    background: var(--brand-hover);
}

.btn-secondary,
.btn-outline {
    background: var(--panel);
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-secondary:active,
.btn-outline:active {
    background: var(--ground);
}

.btn-danger {
    background: var(--critical);
    color: #FFFFFF;
}

.btn-danger:active {
    background: var(--critical-dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--ink);
}

.form-input {
    width: 100%;
    min-height: var(--touch-target-comfortable);
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    color: var(--ink);
    background: var(--panel);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: 2px solid var(--green);
    outline-offset: 0;
    border-color: var(--green);
}

.form-input::placeholder {
    color: var(--muted);
    opacity: 1;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: var(--green-tint); color: var(--green-dark); }
.badge-warning { background: var(--amber-tint); color: var(--amber-dark); }
.badge-danger { background: var(--critical-tint); color: var(--critical-dark); }
.badge-info { background: var(--neutral-tint); color: var(--gray-700); }

/* Progress */
.progress {
    height: 6px;
    background: var(--neutral-tint);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.segments {
    display: flex;
    gap: 3px;
}

.segments > span {
    flex: 1 1 0;
    height: 6px;
    border-radius: 2px;
    background: var(--line);
}

.segments > span.on {
    background: var(--green);
}

.segments > span.skipped {
    background: var(--gray-400);
}

/* Map chrome */
/* On the layer wrapper: ol.css applies "all: unset" to canvases, which would drop a filter there. */
.basemap-muted {
    filter: saturate(0.2) contrast(0.92) brightness(1.04);
}

.map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    background: var(--map-land);
}

.map-controls {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 100;
}

.map-control-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.map-control-btn:active {
    background: var(--ground);
}

.no-route-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 48px);
    max-width: 320px;
    padding: var(--spacing-lg);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    z-index: 100;
}

.no-route-card svg {
    margin-bottom: var(--spacing-md);
    color: var(--gray-400);
}

.no-route-card h3 {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
    color: var(--ink);
}

.no-route-card p {
    margin-bottom: var(--spacing-md);
    color: var(--muted);
}

.map-info-title {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.map-info-text {
    margin-bottom: var(--spacing-md);
    color: var(--muted);
}

.map-toast {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    background: var(--ink);
    color: #FFFFFF;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    z-index: 9999;
}

/* Bottom sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 32, 26, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.bottom-sheet {
    width: 100%;
    max-height: 80vh;
    background: var(--panel);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    margin: 0 auto var(--spacing-lg);
}

.modal-title {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
}

.modal-text {
    margin-bottom: var(--spacing-lg);
    color: var(--muted);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
}

.modal-actions .btn {
    flex: 1;
    padding: 0 var(--spacing-sm);
}

/* Sync status indicator. Never takes taps: it floats over the page's action buttons. */
.sync-indicator {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 900;
    display: none;
}

/* Without a header it sits in the free space of the route card, beside the refresh button. */
.app-shell.no-header .sync-indicator {
    top: calc(var(--safe-area-top) + 24px);
    left: auto;
    right: 72px;
    transform: none;
    padding: 2px var(--spacing-sm);
}

.sync-indicator.active {
    display: block;
}

.sync-indicator.syncing {
    background: var(--info-color);
    color: #FFFFFF;
}

.sync-indicator.offline {
    background: var(--warning-color);
    color: #FFFFFF;
}

.sync-indicator.error {
    background: var(--danger-color);
    color: #FFFFFF;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: var(--spacing-lg);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    color: var(--muted);
}

/* Offline screen */
.offline-page {
    min-height: calc(100vh - var(--safe-area-top) - var(--safe-area-bottom));
}

.offline-page .empty-state-icon {
    width: 80px;
    height: 80px;
}

.offline-page .empty-state-text {
    max-width: 300px;
}

.offline-note {
    font-size: var(--font-size-xs);
}

/* Routes screen: map and route card */
.route-hero {
    position: relative;
    padding: 12px;
}

.route-hero.has-map {
    padding: 0;
}

.route-map {
    display: none;
}

/* The map is an overview only: touches pass through so the page scrolls over it. */
.route-hero.has-map .route-map {
    display: block;
    height: 38vh;
    min-height: 220px;
    background: var(--map-land);
    pointer-events: none;
}

.route-hero.has-map .route-card {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 5;
}

.route-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 12px 12px;
}

.route-card-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 6px;
}

.route-card-text {
    flex: 1;
    min-width: 0;
}

.route-card-plate {
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.route-card-progress {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.route-refresh {
    flex: 0 0 auto;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
}

.route-refresh:active {
    background: var(--ground);
}

/* Routes screen: next-stop sheet */
.next-stop {
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: var(--spacing-md);
}

.next-stop-label {
    font-size: var(--font-size-sm);
    color: var(--muted);
    margin-bottom: var(--spacing-xs);
}

.next-stop-address {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.next-stop-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-sm);
    margin: 12px 0 14px;
}

.next-stop-facts dt {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.next-stop-facts dd {
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Fill text stays ink: the mark beside it carries the colour. */
.fill-high::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--critical);
    vertical-align: 1px;
}

.next-stop-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.next-stop-collect {
    flex: 2;
}

.next-stop-skip {
    flex: 1;
}

.next-stop-then {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.next-stop-then-address {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.next-stop-complete {
    display: flex;
    align-items: center;
    gap: 12px;
}

.next-stop-complete svg {
    flex: 0 0 auto;
    color: var(--green);
}

.next-stop-complete h2 {
    font-size: var(--font-size-lg);
}

.next-stop-complete p {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

/* Routes screen: all stops */
.section-heading {
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px var(--spacing-md);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.route-item:first-child {
    border-top: 1px solid var(--line);
}

.route-item:active {
    background: var(--gray-50);
}

.route-number {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--neutral-tint);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.route-number.collected {
    background: var(--green-tint);
    color: var(--green-dark);
}

.route-number.skipped {
    color: var(--muted);
}

.route-details {
    flex: 1;
    min-width: 0;
}

.route-address {
    font-weight: 500;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.route-info {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.route-status {
    flex: 0 0 auto;
}

.route-item.collected .route-address,
.route-item.skipped .route-address,
.route-item.collected .fill-level-text,
.route-item.skipped .fill-level-text {
    color: var(--muted);
}

/* Fill level meter */
.fill-level {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.fill-level-bar {
    flex: 0 0 44px;
    height: 6px;
    background: var(--neutral-tint);
    border-radius: 3px;
    overflow: hidden;
}

.fill-level-value {
    height: 100%;
    border-radius: 3px;
}

.fill-level-text {
    min-width: 40px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--ink);
    text-align: right;
}

/* Settings */
.settings-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.settings-avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-user-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.settings-user-role {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.stat-cell {
    padding: 12px;
    background: var(--panel);
    text-align: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-2xl);
    font-weight: 500;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--muted);
}

.settings-about {
    font-size: var(--font-size-sm);
    color: var(--muted);
}

.list-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Message bubbles */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--panel-raised);
    color: var(--ink);
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
}

.message-time {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--muted);
    margin-top: var(--spacing-xs);
}

/* Sign-in and loading */
.auth-page {
    min-height: calc(100vh - var(--safe-area-top) - var(--safe-area-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--ground);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.auth-header {
    margin-bottom: 22px;
    text-align: center;
}

.auth-header img {
    display: block;
    width: 150px;
    height: 50px;
    margin: 0 auto var(--spacing-sm);
}

.auth-header p {
    color: var(--muted);
}

.auth-loading {
    text-align: center;
}

.auth-loading .spinner {
    margin: 0 auto var(--spacing-md);
}

.auth-loading p:last-child {
    color: var(--muted);
}

.login-error {
    display: none;
    margin-bottom: var(--spacing-md);
    padding: 10px 12px;
    background: var(--critical-tint);
    color: var(--critical-dark);
    border-radius: var(--radius-sm);
}

.login-error.show {
    display: block;
}

/* Utilities */
.text-muted {
    color: var(--muted);
}

.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.hidden {
    display: none !important;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* On a brand fill the green arc would disappear. */
.btn-primary .spinner,
.btn-success .spinner {
    border-color: rgba(18, 32, 26, 0.25);
    border-top-color: var(--ink);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Required OpenStreetMap credit: kept small so it doesn't compete with the map. */
.ol-attribution {
    font-size: 10px;
}

.ol-attribution ul {
    margin: 0;
    padding: 1px 4px;
}
