html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Clip the ~scrollbar-width overshoot from full-bleed (100vw) elements so
       the page never scrolls sideways. */
    overflow-x: hidden;
    max-width: 100%;
}

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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4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azor-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;
}
/* ---- Identity / account pages (static-rendered, no MudBlazor JS) ---- */
.account-card {
    max-width: 26rem;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.account-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
    line-height: 1.2;
}

.account-subtitle {
    color: #6b6b6b;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    flex: 1;
    min-width: 0; /* allow the field to shrink within the flex row */
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
}

.form-input {
    width: 100%;
    box-sizing: border-box; /* keep padding/border inside the column width */
    padding: 0.6rem 0.75rem;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.account-button {
    width: 100%;
    padding: 0.7rem;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.account-button:hover {
    background: #1b5e20;
}

.account-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.9rem;
}

.account-alert {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .account-card { margin: 1rem; padding: 1.5rem; }
    .form-row { flex-direction: column; gap: 0; }
}

/* ---- Public landing page ---- */
/* Pull the page flush under the app bar; sections + photo bands scroll normally. */
.landing {
    margin-top: -16px; /* offsets MudContainer's my-4 top margin */
}

/* Break an element out of the centered layout container to span the viewport. */
.full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Hero: scrolling photo with a darkened overlay and centred text. */
.landing-hero {
    min-height: 78vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.38)),
                url('/images/Vagen.jpg') center/cover no-repeat;
    color: #fff;
}

.landing-hero__inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem clamp(1.25rem, 5vw, 4rem);
    text-align: center;
}

.landing-hero__title {
    color: #fff;
    font-weight: 700;
    max-width: 42rem;
    margin: 0 auto;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.landing-hero__subtitle {
    color: rgba(255, 255, 255, 0.94);
    font-weight: 400;
    max-width: 34rem;
    margin: 0.75rem auto 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.landing-hero__login-hint {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.landing-hero__login-link {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

/* White-outlined notice box with an action button. */
.landing-hero__notice {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 640px;
    margin: 2rem auto 0;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background: rgba(39, 51, 56, 0.4);
    backdrop-filter: blur(2px);
    color: #fff;
    text-align: left;
}

.landing-hero__notice-icon {
    color: #fff;
    flex-shrink: 0;
}

.landing-hero__notice-text {
    flex: 1;
    color: #fff;
}

@media (max-width: 600px) {
    .landing-hero__notice {
        flex-direction: column;
        text-align: center;
    }
}

.landing-hero__hint {
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.85);
    animation: landing-bounce 1.8s ease-in-out infinite;
}

@keyframes landing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Full-width photo band between content sections. */
.landing-band {
    min-height: 42vh;
    display: flex;
    align-items: flex-end;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    margin: 3.5rem 0;
}

.landing-band__caption {
    width: 100%;
    padding: 2rem clamp(1.25rem, 5vw, 4rem);
    background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(39, 51, 56, 0.7) 100%);
}

.landing-band__caption .mud-typography {
    color: #fff;
    max-width: 1100px;
    margin: 0 auto;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* Sections scroll clear of the fixed app bar when reached via anchor links.
   Horizontal padding keeps the text off the edges (the hero/bands are full-bleed,
   so without this the body content looks cramped against the gutter). */
.landing-section {
    scroll-margin-top: 80px;
    margin-bottom: 3.5rem;
    padding-inline: clamp(0.5rem, 3vw, 2rem);
}

.landing-section--last {
    margin-bottom: 2rem;
}

.h-100 {
    height: 100%;
}

/* ---- Leaflet map boxes ---- */
.rr-map {
    height: 360px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    z-index: 0; /* keep map panes under MudBlazor overlays/menus */
}

.rr-map--sm {
    height: 240px;
}

/* ---- Site footer ---- */
.app-footer {
    background: #273338;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 3rem;
}

.app-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem clamp(1.25rem, 5vw, 4rem) 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
}

.app-footer__col {
    flex: 1 1 220px;
}

.app-footer__brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.app-footer__col h4 {
    color: #fff;
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.app-footer__col a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 0.4rem;
}

.app-footer__col a:hover {
    color: #fff;
    text-decoration: underline;
}

.app-footer__col p {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.app-footer__bar {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem clamp(1.25rem, 5vw, 4rem);
    font-size: 0.85rem;
    text-align: center;
}

/* ---- Login / register full-screen photo background ---- */
.account-bg {
    min-height: 100vh;
    background: url('/images/login-bg.jpg') center/cover no-repeat fixed;
}

.account-bg-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Darken slightly so the white card and text stay readable over the photo. */
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.45));
}

.account-bg .account-card {
    margin: 0;
    width: 100%;
    max-width: 26rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------------------
   Admin-editable texts (<EditableText>). The pen only renders for admins; it
   sits at the top-right of the text block and brightens on hover/focus.
   --------------------------------------------------------------------------- */
.editable-text {
    position: relative;
    display: block;
}

/* Keep wrapped text clear of the pen so it never covers a word. */
.editable-text--admin > .mud-typography {
    padding-right: 2.25rem;
}

.editable-text__pen {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    opacity: 0.45;
    transition: opacity 0.15s ease-in-out;
    z-index: 1;
}

.editable-text--admin:hover .editable-text__pen,
.editable-text__pen:focus-visible {
    opacity: 1;
}

.editable-text--editing {
    width: 100%;
    text-align: left;
}
