* {
    box-sizing: border-box;
}

:root {
    --background: #f7f7f4;
    --card: #ffffff;
    --text: #1c2520;
    --muted: #66726b;
    --border: #dfe4df;
    --accent: #285c45;
    --accent-dark: #1f4937;
    --danger: #8f2929;
    --success: #25633f;
    --warning: #745513;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

body {
    margin: 0;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    width: calc(100% - 32px);
    max-width: none;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: 190px;
    object-fit: contain;
}

.test-label {
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-menu {
    position: relative;
}

.site-menu__toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.site-menu__icon {
    font-size: 1rem;
    line-height: 1;
}

.site-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 2000;
    width: min(250px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgba(18, 32, 24, 0.14);
}

.site-menu__panel[hidden] {
    display: none;
}

.site-menu__panel > a,
.site-menu__link-button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
}

.site-menu__panel > a:hover,
.site-menu__panel > a:focus,
.site-menu__link-button:hover,
.site-menu__link-button:focus {
    background: #f2f7f3;
    color: var(--accent);
    text-decoration: none;
}

.site-menu__logout {
    display: block;
    gap: 0;
}

.site-menu__divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--border);
}

main {
    padding: 56px 0;
}

.hero {
    min-height: 58vh;
    display: grid;
    align-items: center;
    max-width: 760px;
}

h1 {
    margin: 0.2em 0;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.06;
}

.card h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.lead {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.25rem;
}

.small-lead {
    font-size: 1.08rem;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button,
button {
    display: inline-block;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.button:hover,
button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.button.secondary {
    border: 1px solid var(--accent);
    background: #ffffff;
    color: var(--accent);
}

.button.small {
    padding: 8px 13px;
}

.logout-form {
    display: inline;
}

.link-button {
    padding: 0;
    background: none;
    color: var(--accent);
    font-weight: 400;
}

.link-button:hover {
    background: none;
    text-decoration: underline;
}

.card {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 8px 30px rgba(18, 32, 24, 0.05);
}

.narrow {
    max-width: 620px;
    margin: 0 auto;
}

form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #bdc7c0;
    border-radius: 9px;
    background: #ffffff;
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(40, 92, 69, 0.15);
    border-color: var(--accent);
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.notice {
    padding: 13px 15px;
    border-radius: 9px;
    margin: 0 0 20px;
}

.notice.error {
    border: 1px solid #efc4c4;
    background: #fff0f0;
    color: var(--danger);
}

.notice.success {
    border: 1px solid #bfe0ca;
    background: #edf9f1;
    color: var(--success);
}

.notice.info {
    border: 1px solid #c8dcd0;
    background: #eef5f1;
    color: #244b39;
    margin-top: 28px;
}

.profile {
    display: grid;
    gap: 0;
    margin: 28px 0;
}

.profile div {
    display: grid;
    grid-template-columns: 180px 1fr;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.profile dt {
    font-weight: 700;
}

.profile dd {
    margin: 0;
}

.form-footer,
.small-text {
    color: var(--muted);
    font-size: 0.92rem;
}

.site-footer {
    padding: 30px 0;
    color: var(--muted);
}

.market-map-placeholder {
    margin-top: 30px;
    height: 600px;
    border: 2px dashed #cfd8dc;
    border-radius: 12px;
    background: #f8faf9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.2rem;
}

/* Leaflet-kort */
#market-map {
    width: 100%;
    height: 600px;
    margin-top: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #dbe8ec;
}

.leaflet-container {
    position: relative;
    overflow: hidden;
    outline: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
    position: absolute;
    top: 0;
    left: 0;
}

.leaflet-container img.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: 256px;
    height: 256px;
    padding: 0;
    border: 0;
}

.leaflet-tile {
    visibility: hidden;
}

.leaflet-tile-loaded {
    visibility: inherit;
}

.leaflet-map-pane {
    z-index: 200;
}

.leaflet-tile-pane {
    z-index: 200;
}

.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-shadow-pane {
    z-index: 500;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-tooltip-pane {
    z-index: 650;
}

.leaflet-popup-pane {
    z-index: 700;
}

.leaflet-control {
    position: relative;
    z-index: 800;
    pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-top {
    top: 0;
}

.leaflet-right {
    right: 0;
}

.leaflet-bottom {
    bottom: 0;
}

.leaflet-left {
    left: 0;
}

.leaflet-control {
    float: left;
    clear: both;
}

.leaflet-right .leaflet-control {
    float: right;
}

.leaflet-top .leaflet-control {
    margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
    margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
    margin-left: 10px;
}

.leaflet-right .leaflet-control {
    margin-right: 10px;
}

.leaflet-bar a {
    display: block;
    width: 30px;
    height: 30px;
    border-bottom: 1px solid #ccc;
    background: #ffffff;
    color: #172019;
    font-size: 22px;
    line-height: 30px;
    text-align: center;
    text-decoration: none;
}

.leaflet-bar a:first-child {
    border-radius: 4px 4px 0 0;
}

.leaflet-bar a:last-child {
    border-bottom: 0;
    border-radius: 0 0 4px 4px;
}

.leaflet-control-attribution {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    font-size: 11px;
}

.leaflet-control-attribution a {
    color: #285c45;
}

.leaflet-zoom-animated {
    transform-origin: 0 0;
}

.leaflet-interactive {
    cursor: pointer;
}

.leaflet-grab {
    cursor: grab;
}

.leaflet-dragging .leaflet-grab {
    cursor: grabbing;
}

@media (max-width: 650px) {
    .site-header {
        position: relative;
        z-index: 3000;
    }

    main {
        padding: 28px 0 40px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .header-inner {
        min-height: 72px;
        padding: 14px 0;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }

    .brand-wrap {
        flex: 0 1 auto;
        min-width: 0;
    }

    .brand-logo {
        width: clamp(88px, 28vw, 120px);
        height: auto;
        max-width: none;
    }

    nav {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 8px;
        transform: translateY(2px);
    }

    .site-menu__toggle {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    .card {
        padding: 22px;
    }

    .profile div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .market-map-placeholder,
    #market-map {
        height: 420px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .header-inner {
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

/* HomeLater cookie-samtykke */
.cookie-consent {
    position: fixed;
    right: 18px;
    bottom: 18px;
    left: 18px;
    z-index: 4000;
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1120px, 100%);
    gap: 24px;
    margin: 0 auto;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 42px rgba(18, 32, 24, 0.18);
}

.cookie-consent__copy {
    display: grid;
    max-width: 650px;
    gap: 3px;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.cookie-consent__copy strong {
    font-size: 0.98rem;
}

.cookie-consent__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.cookie-consent__link {
    padding: 9px 5px;
    white-space: nowrap;
}

.cookie-consent__button {
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 9px;
    white-space: nowrap;
    font-size: 0.9rem;
}

.cookie-consent__button--secondary {
    border: 1px solid var(--accent);
    background: #ffffff;
    color: var(--accent);
}

.cookie-consent__button--secondary:hover,
.cookie-consent__button--secondary:focus {
    background: #f2f7f3;
    color: var(--accent-dark);
}

@media (max-width: 760px) {
    .cookie-consent {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .cookie-consent__inner {
        display: grid;
        gap: 14px;
        padding: 15px;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .cookie-consent__link {
        grid-column: 1 / -1;
        padding: 0 0 2px;
        text-align: center;
    }

    .cookie-consent__button {
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 390px) {
    .cookie-consent__copy {
        font-size: 0.84rem;
    }

    .cookie-consent__actions {
        grid-template-columns: 1fr;
    }

    .cookie-consent__link {
        grid-column: auto;
    }
}

