/**
 * FuturaMap — component styles.
 *
 * Every color, size and timing is a CSS custom property declared on `.fm-map`
 * below, preset to the Futura Website Figma prototype values. Override any of
 * them from the host stylesheet (`.fm-map { --fm-surface: ...; }`) without
 * touching this file.
 *
 * ── Token reference ─────────────────────────────────────────────────────────
 * Surfaces        --fm-surface, --fm-surface-hover, --fm-card-bg
 * Text            --fm-on-surface, --fm-text-heading, --fm-text-body,
 *                 --fm-text-muted, --fm-accent-text, --fm-error
 * Borders         --fm-border, --fm-border-subtle, --fm-focus-ring
 * Map artwork     --fm-map-opacity, --fm-country-fill, --fm-country-stroke,
 *                 --fm-country-stroke-width, --fm-region-fill,
 *                 --fm-region-hover-fill, --fm-region-stroke
 * Markers         --fm-marker-fill, --fm-pin-scale, --fm-pin-scale-active,
 *                 --fm-dot-radius, --fm-dot-scale-active, --fm-hit-radius,
 *                 --fm-cluster-fill, --fm-cluster-stroke, --fm-cluster-text,
 *                 --fm-cluster-radius, --fm-cluster-font
 * Type            --fm-font, --fm-title-size, --fm-title-top
 * Layout          --fm-aspect, --fm-height, --fm-viewport-offset,
 *                 --fm-max-height, --fm-min-height, --fm-inset-x,
 *                 --fm-inset-bottom, --fm-card-width, --fm-card-inset
 * Shape/motion    --fm-radius-pill, --fm-radius-lg, --fm-radius-md,
 *                 --fm-transition, --fm-transition-slow
 * ────────────────────────────────────────────────────────────────────────────
 */

.fm-map {
    /* palette (Figma variables) */
    --fm-surface: #7f3035;
    --fm-surface-hover: #6b2a2e;
    --fm-card-bg: #ffffff;
    --fm-on-surface: #ffffff;
    --fm-text-heading: #25282a;
    --fm-text-body: #4a4e50;
    --fm-text-muted: #898c8e;
    --fm-accent-text: #7f3035;
    --fm-border: #bfc1c2;
    --fm-border-subtle: #e0e1e1;
    --fm-disabled-bg: #e0e1e1;
    --fm-error: #b3261e;
    --fm-focus-ring: rgb(255 255 255 / 0.55);
    --fm-focus-ring-dark: rgb(127 48 53 / 0.35);

    /* map artwork — countries are stroke-only, the whole layer sits at 14%.
       The idle fill is painted-transparent (not `none`) so country interiors
       stay hit-testable for hover/click. */
    --fm-map-opacity: 0.14;
    --fm-country-fill: rgb(255 255 255 / 0);
    --fm-country-stroke: #ffffff;
    --fm-country-stroke-width: 1px;
    --fm-region-fill: #ffffff;          /* selected region, inside the 14% layer */
    --fm-region-hover-fill: rgb(255 255 255 / 0.5); /* TODO: no hover in Figma — placeholder preview */
    --fm-region-stroke: #7f3035;

    /* markers (sizes are SVG units: they shrink with the rendered map, hence
       the larger mobile values in the media query below) */
    --fm-marker-fill: #ffffff;
    --fm-pin-scale: 0.8;
    --fm-pin-scale-active: 1.066;       /* Figma: 21x30 -> 28x39 (x4/3) */
    --fm-dot-radius: 5px;
    --fm-dot-scale-active: 1.3;
    --fm-hit-radius: 16px;              /* invisible touch/click target */
    --fm-cluster-fill: #ffffff;
    --fm-cluster-stroke: #7f3035;
    --fm-cluster-text: #7f3035;
    --fm-cluster-radius: 16px;
    --fm-cluster-font: 12px;

    /* typography (Lato in Figma — load it host-side) */
    --fm-font: 'Lato', system-ui, sans-serif;

    /* layout — the section is aspect-driven but capped to the viewport, so the
       map never scrolls out of view on laptop screens. Set --fm-viewport-offset
       to the height of whatever the host renders above it (WP header + title),
       or set --fm-height directly to take full control. */
    --fm-aspect: 1920 / 1100;
    --fm-height: auto;                 /* e.g. calc(100dvh - 240px); wins over --fm-aspect */
    --fm-viewport-offset: 0px;         /* header + title height above the section */
    --fm-max-height: calc(100dvh - var(--fm-viewport-offset));
    --fm-min-height: 420px;
    --fm-inset-x: clamp(20px, 8.3vw, 160px);
    --fm-inset-bottom: clamp(24px, 4.6vw, 89px);
    --fm-card-width: 532px;
    --fm-card-inset: clamp(16px, 4.1vw, 80px);

    /* shape & motion */
    --fm-radius-pill: 999px;
    --fm-radius-lg: 16px;
    --fm-radius-md: 8px;
    --fm-transition: 0.2s ease;
    --fm-transition-slow: 0.7s ease;

    position: relative;
    background: var(--fm-surface);
    aspect-ratio: var(--fm-aspect);
    height: var(--fm-height);
    max-height: var(--fm-max-height);
    min-height: var(--fm-min-height);
    font-family: var(--fm-font);
    overflow: hidden;
}

/* the component must not depend on the host theme's reset */
.fm-map,
.fm-map *,
.fm-map *::before,
.fm-map *::after {
    box-sizing: border-box;
}

/* click affordance base rule, scoped to the component */
.fm-map button:not(:disabled) {
    cursor: pointer;
}

/* ── stage & artwork ──────────────────────────────────────────────────────── */

.fm-stage {
    position: absolute;
    inset: 0;
}

/* section title rendered on the map (init option `title`) */
.fm-title {
    position: absolute;
    z-index: 2;
    top: var(--fm-title-top, clamp(20px, 2.5vw, 48px));
    left: var(--fm-inset-x);
    margin: 0;
    font-size: var(--fm-title-size, clamp(28px, 2.1vw, 40px));
    line-height: 1.2;
    font-weight: 700;
    color: var(--fm-on-surface);
    pointer-events: none;
}

.fm-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.fm-svg * {
    vector-effect: non-scaling-stroke; /* keep strokes 1px while zooming */
}

.fm-map-content {
    opacity: var(--fm-map-opacity);
}

.fm-country,
.fm-country * {
    fill: var(--fm-country-fill);
    stroke: var(--fm-country-stroke);
    stroke-width: var(--fm-country-stroke-width);
    transition: fill var(--fm-transition-slow);
}

.fm-country.fm-hover,
.fm-country.fm-hover * {
    fill: var(--fm-region-hover-fill);
}

.fm-country.fm-selected,
.fm-country.fm-selected * {
    fill: var(--fm-region-fill);
    stroke: var(--fm-region-stroke);
}

/* countries are clickable only in sales mode and only when part of a region */
.fm-map[data-mode='sales'] .fm-country.fm-in-region {
    cursor: pointer;
}

/* ── marker layers ────────────────────────────────────────────────────────── */

.fm-layer {
    transition: opacity var(--fm-transition);
}

.fm-map[data-mode='offices'] .fm-layer-sales,
.fm-map[data-mode='sales'] .fm-layer-offices {
    opacity: 0;
    pointer-events: none;
}

.fm-marker {
    cursor: pointer;
    outline: none;
}

.fm-marker-shape {
    transition: transform var(--fm-transition);
    transform-origin: 0 0; /* marker anchor: pin tip / dot centre */
}

.fm-pin {
    fill: var(--fm-marker-fill);
}

/* invisible but painted -> hit-testable */
.fm-marker-hit {
    r: var(--fm-hit-radius);
    fill: rgb(255 255 255 / 0);
    stroke: none;
}

/* markers collapsed into a cluster bubble */
.fm-marker.fm-clustered {
    display: none;
}

.fm-marker[data-type='office'] .fm-marker-shape {
    transform: scale(var(--fm-pin-scale));
}

.fm-marker[data-type='office']:hover .fm-marker-shape,
.fm-marker[data-type='office'].fm-hover .fm-marker-shape,
.fm-marker[data-type='office'].fm-selected .fm-marker-shape,
.fm-marker[data-type='office']:focus-visible .fm-marker-shape {
    transform: scale(calc(var(--fm-pin-scale) * var(--fm-pin-scale-active)));
}

.fm-marker-dot {
    r: var(--fm-dot-radius);
    fill: var(--fm-marker-fill);
}

.fm-marker-ring {
    r: 0;
    fill: none;
    stroke: var(--fm-marker-fill);
    stroke-width: 1.5px;
    transition: r var(--fm-transition);
}

.fm-marker[data-type='sales']:hover .fm-marker-shape,
.fm-marker[data-type='sales'].fm-hover .fm-marker-shape,
.fm-marker[data-type='sales']:focus-visible .fm-marker-shape {
    transform: scale(var(--fm-dot-scale-active));
}

.fm-marker[data-type='sales'].fm-selected .fm-marker-ring {
    r: calc(var(--fm-dot-radius) + 5px);
}

.fm-marker:focus-visible .fm-marker-shape {
    filter: drop-shadow(0 0 4px var(--fm-focus-ring));
}

/* cluster bubbles (optional module) */
.fm-cluster-bubble {
    r: var(--fm-cluster-radius);
    fill: var(--fm-cluster-fill);
    stroke: var(--fm-cluster-stroke);
    stroke-width: 2px;
    transition: r var(--fm-transition);
}

.fm-cluster:hover .fm-cluster-bubble,
.fm-cluster:focus-visible .fm-cluster-bubble {
    r: calc(var(--fm-cluster-radius) * 1.15);
}

.fm-cluster:focus-visible {
    outline: none;
}

.fm-cluster:focus-visible .fm-marker-inner {
    filter: drop-shadow(0 0 4px var(--fm-focus-ring));
}

.fm-cluster-count {
    fill: var(--fm-cluster-text);
    font-family: var(--fm-font);
    font-size: var(--fm-cluster-font);
    font-weight: 700;
    pointer-events: none;
}

/* ── zoom gate ────────────────────────────────────────────────────────────── */
/* Compact toggle separating page scroll from map zoom (visual treatment
   intentionally different from Toscotec's blur overlay — pending design). */

.fm-zoom-gate {
    position: absolute;
    z-index: 5;
    top: var(--fm-title-top, clamp(20px, 2.5vw, 48px));
    right: var(--fm-card-inset);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--fm-on-surface);
    border-radius: var(--fm-radius-pill);
    background: transparent;
    color: var(--fm-on-surface);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    transition: color var(--fm-transition), background-color var(--fm-transition), transform 0.1s ease;
}

.fm-zoom-gate svg {
    flex-shrink: 0;
}

.fm-zoom-gate:hover {
    background: rgb(255 255 255 / 0.14);
}

.fm-zoom-gate:not(:disabled):active {
    transform: scale(0.97);
}

.fm-zoom-gate.fm-active {
    background: var(--fm-card-bg);
    color: var(--fm-accent-text);
}

.fm-zoom-gate:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-surface), 0 0 0 4px var(--fm-focus-ring);
}

/* fullscreen takeover — entered when the gate is activated below 900px */
.fm-map.fm-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 999;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
    animation: fm-pop 0.25s ease;
}

@keyframes fm-pop {
    from {
        opacity: 0.6;
        transform: scale(0.98);
    }
}

/* ── controls: tabs + pills ───────────────────────────────────────────────── */

.fm-controls {
    position: absolute;
    left: var(--fm-inset-x);
    right: var(--fm-inset-x);
    bottom: var(--fm-inset-bottom);
    display: flex;
    flex-direction: column;
    gap: 24px;
    pointer-events: none; /* let the map receive clicks between controls */
}

.fm-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
}

.fm-tab {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 20px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--fm-on-surface);
    text-underline-offset: 6px;
    transition: opacity var(--fm-transition);
}

.fm-tab:hover {
    opacity: 0.8;
}

.fm-tab.fm-active {
    font-weight: 700;
    text-decoration: underline;
    cursor: default;
    pointer-events: none;
}

.fm-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-focus-ring);
    border-radius: 4px;
}

.fm-tabs-divider {
    width: 1px;
    height: 24px;
    background: var(--fm-on-surface);
    opacity: 0.7;
}

.fm-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    pointer-events: auto;
}

.fm-pill {
    padding: 14px 36px;
    border: 1px solid var(--fm-on-surface);
    border-radius: var(--fm-radius-pill);
    background: transparent;
    color: var(--fm-on-surface);
    font-family: inherit;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    transition: color var(--fm-transition), background-color var(--fm-transition), transform 0.1s ease;
}

/* TODO: no hover state in Figma — using a soft fill as placeholder */
.fm-pill:hover,
.fm-pill.fm-hover {
    background: rgb(255 255 255 / 0.14);
}

.fm-pill:not(:disabled):active {
    transform: scale(0.97);
}

.fm-pill.fm-selected {
    background: var(--fm-card-bg);
    color: var(--fm-accent-text);
}

.fm-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-surface), 0 0 0 4px var(--fm-focus-ring);
}

/* ── mobile select (replaces the pills row under 900px) ───────────────────── */

.fm-select {
    position: relative;
    display: none; /* shown in the mobile media query */
    pointer-events: auto;
    width: min(320px, 100%);
}

.fm-select-handle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid var(--fm-on-surface);
    border-radius: var(--fm-radius-pill);
    background: transparent;
    color: var(--fm-on-surface);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    transition: background-color var(--fm-transition);
}

.fm-select-handle:hover {
    background: rgb(255 255 255 / 0.14);
}

.fm-select-handle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-surface), 0 0 0 4px var(--fm-focus-ring);
}

.fm-select-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-select-chevron {
    flex-shrink: 0;
    transition: transform var(--fm-transition);
}

.fm-select.fm-open .fm-select-chevron {
    transform: rotate(180deg);
}

/* opens upwards: the control sits at the bottom of the map */
.fm-select-list {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: var(--fm-card-bg);
    border-radius: var(--fm-radius-md);
    max-height: 40vh;
    overflow-y: auto;
    scrollbar-width: thin;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity var(--fm-transition), transform var(--fm-transition);
}

.fm-select.fm-open .fm-select-list {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fm-select-option {
    padding: 12px 20px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--fm-text-heading);
    cursor: pointer;
    transition: background-color var(--fm-transition);
}

.fm-select-option:hover {
    background: rgb(0 0 0 / 0.05);
}

.fm-select-option.fm-selected {
    color: var(--fm-accent-text);
}

/* ── tooltip (offices) ────────────────────────────────────────────────────── */

.fm-tooltip {
    --fm-tooltip-gap: 20px; /* distance between the pin edge and the balloon (arrow included) */
    position: absolute;
    z-index: 3;
    width: max-content;
    max-width: 280px;
    padding: 20px 24px;
    background: var(--fm-card-bg);
    border-radius: var(--fm-radius-lg);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--fm-transition), transform var(--fm-transition);
    pointer-events: none;
}

.fm-tooltip.fm-show {
    opacity: 1;
    transform: translateY(0);
}

/* arrow pointing back at the pin (left edge by default, right when flipped) */
.fm-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -12px;
    translate: 0 -50%;
    border-block: 10px solid transparent;
    border-right: 13px solid var(--fm-card-bg);
}

.fm-tooltip.fm-flip::before {
    left: auto;
    right: -12px;
    border-right: 0;
    border-left: 13px solid var(--fm-card-bg);
}

/* above the pin (narrow screens): arrow on the bottom edge, kept on the pin */
.fm-tooltip.fm-above::before {
    top: 100%;
    right: auto;
    left: var(--fm-tooltip-arrow-x, 50%);
    translate: -50% 0;
    border: 0;
    border-inline: 10px solid transparent;
    border-top: 13px solid var(--fm-card-bg);
}

.fm-tooltip-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--fm-accent-text);
}

.fm-tooltip-line {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fm-text-heading);
}

/* sales balloon variant: hosts a button, so it must receive events */
.fm-tooltip.fm-interactive {
    pointer-events: auto;
}

.fm-tooltip-cta {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 20px;
    border: 0;
    border-radius: var(--fm-radius-pill);
    background: var(--fm-surface);
    color: var(--fm-on-surface);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background-color var(--fm-transition), transform 0.1s ease;
}

.fm-tooltip-cta:hover {
    background: var(--fm-surface-hover);
}

.fm-tooltip-cta:not(:disabled):active {
    transform: scale(0.97);
}

.fm-tooltip-cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-card-bg), 0 0 0 4px var(--fm-focus-ring-dark);
}

/* ── contact card (sales) ─────────────────────────────────────────────────── */

/* modal backdrop — only takes part in the mobile presentation */
.fm-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgb(0 0 0 / 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--fm-transition);
}

/* close affordance for the mobile modal — hidden on desktop */
.fm-card-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--fm-border);
    border-radius: var(--fm-radius-pill);
    background: var(--fm-card-bg);
    color: var(--fm-text-body);
    transition: color var(--fm-transition), border-color var(--fm-transition), transform 0.1s ease;
}

.fm-card-close:hover {
    color: var(--fm-accent-text);
    border-color: var(--fm-accent-text);
}

.fm-card-close:not(:disabled):active {
    transform: scale(0.9);
}

.fm-card-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-focus-ring-dark);
}

.fm-card {
    position: absolute;
    z-index: 4;
    right: var(--fm-card-inset);
    bottom: var(--fm-inset-bottom);
    width: min(var(--fm-card-width), calc(100% - 2 * var(--fm-card-inset)));
    max-height: calc(100% - var(--fm-inset-bottom) - 16px);
    padding: 24px;
    background: var(--fm-card-bg);
    border-radius: var(--fm-radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--fm-transition), transform var(--fm-transition);
    overflow: hidden;
}

/* the hidden attribute must win over the display/pointer rules above:
   an invisible card would otherwise keep intercepting map clicks */
.fm-card[hidden],
.fm-backdrop[hidden] {
    display: none;
}

.fm-card:not(.fm-show) {
    pointer-events: none;
}

.fm-card.fm-show {
    opacity: 1;
    transform: translateY(0);
}

/* collapsed view: region title / divider / contact row (Figma 524:9738) */
.fm-card-view-collapsed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fm-card.fm-expanded .fm-card-view-collapsed {
    display: none;
}

.fm-card-region {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--fm-accent-text);
}

.fm-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--fm-border);
    padding-top: 16px;
}

.fm-card-contact {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fm-text-heading);
}

/* expanded header: intro label + big name (Figma 822:15013) */
.fm-card-view-expanded {
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.fm-card.fm-expanded .fm-card-view-expanded {
    display: flex;
}

.fm-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.fm-card-label {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--fm-accent-text);
}

.fm-card-name {
    margin: 0;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 900;
    color: var(--fm-text-heading);
}

.fm-card-send {
    flex-shrink: 0;
    width: 36px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--fm-border);
    border-radius: var(--fm-radius-pill);
    color: var(--fm-border);
    transition: color var(--fm-transition), border-color var(--fm-transition), transform 0.1s ease;
}

.fm-card-send svg {
    stroke-width: 1.5;
}

.fm-card-send:hover {
    color: var(--fm-accent-text);
    border-color: var(--fm-accent-text);
}

.fm-card-send:not(:disabled):active {
    transform: scale(0.9);
}

.fm-card-send:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-focus-ring-dark);
}

/* collapsed by default; expands to reveal the form. The negative margin
   cancels the card's flex gap while collapsed so the closed card matches the
   Figma height exactly. */
.fm-card-form-wrap {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: -16px;
    transition: grid-template-rows 0.3s ease, margin-top 0.3s ease, opacity var(--fm-transition);
    opacity: 0;
    min-height: 0;
}

.fm-card.fm-expanded {
    overflow-y: auto;
    scrollbar-width: thin;
}

.fm-card.fm-expanded .fm-card-form-wrap {
    grid-template-rows: 1fr;
    margin-top: 0;
    opacity: 1;
    /* don't let the flex column squash the form on short viewports —
       overflow scrolls the card instead of clipping fields */
    flex-shrink: 0;
}

.fm-card-form-wrap > .fm-form {
    overflow: hidden;
    min-height: 0;
}

/* ── form ─────────────────────────────────────────────────────────────────── */

.fm-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* divider + breathing room only when the form is actually revealed, or the
   collapsed 0fr row would still be padding+border tall */
.fm-card.fm-expanded .fm-form {
    border-top: 1px solid var(--fm-border);
    padding-top: 20px;
}

.fm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-field-label {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    color: var(--fm-text-heading);
}

.fm-input {
    width: 100%;
    padding: 12px 16px;
    height: 48px;
    border: 1px solid var(--fm-border-subtle);
    border-radius: var(--fm-radius-md);
    background: var(--fm-card-bg);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fm-text-heading);
    transition: border-color var(--fm-transition), box-shadow var(--fm-transition);
}

.fm-input::placeholder {
    color: var(--fm-text-muted);
}

.fm-textarea {
    height: 180px;
    resize: vertical;
}

.fm-input:focus-visible {
    outline: none;
    border-color: var(--fm-accent-text);
    box-shadow: 0 0 0 3px var(--fm-focus-ring-dark);
}

.fm-input.fm-invalid {
    border-color: var(--fm-error);
}

.fm-field-error {
    margin: 0;
    min-height: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--fm-error);
}

.fm-field-error:empty {
    display: none;
}

.fm-submit {
    width: 100%;
    padding: 20px 48px;
    border: 0;
    border-radius: var(--fm-radius-pill);
    background: var(--fm-surface);
    color: var(--fm-on-surface);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color var(--fm-transition), transform 0.1s ease;
}

.fm-submit:not(:disabled):hover {
    background: var(--fm-surface-hover);
}

.fm-submit:not(:disabled):active {
    transform: scale(0.97);
}

.fm-submit:disabled {
    background: var(--fm-disabled-bg);
    color: var(--fm-text-muted);
    cursor: not-allowed;
}

.fm-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--fm-card-bg), 0 0 0 4px var(--fm-focus-ring-dark);
}

.fm-submit.fm-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: fm-spin 0.7s linear infinite;
}

@keyframes fm-spin {
    to { transform: rotate(360deg); }
}

.fm-privacy {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.fm-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--fm-accent-text);
    cursor: pointer;
}

.fm-privacy-label {
    font-size: 12px;
    line-height: 1.6;
    color: var(--fm-text-body);
}

.fm-privacy.fm-invalid .fm-privacy-label {
    color: var(--fm-error);
}

.fm-form-feedback {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.fm-form-feedback:empty {
    display: none;
}

.fm-form-feedback.fm-success {
    color: var(--fm-text-body);
    font-weight: 700;
}

.fm-form-feedback.fm-error {
    color: var(--fm-error);
}

/* ── responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    /* full-viewport section (minus the host header via --fm-viewport-offset);
       controls stay overlaid on the map like on desktop */
    .fm-map {
        aspect-ratio: auto;
        height: calc(100dvh - var(--fm-viewport-offset));
        max-height: none;
        min-height: 480px;

        /* the map renders much smaller here: thinner country borders, larger
           markers/targets/bubbles (SVG-unit values compensate the draw scale) */
        --fm-country-stroke-width: 0.5px;
        --fm-pin-scale: 3;
        --fm-dot-radius: 20px;
        --fm-hit-radius: 70px;
        --fm-cluster-radius: 50px;
        --fm-cluster-font: 36px;
    }

    .fm-controls {
        left: 16px;
        right: 16px;
        bottom: max(20px, env(safe-area-inset-bottom));
        gap: 14px;
    }

    /* the pills row is replaced by the themed dropdown */
    .fm-pills {
        display: none;
    }

    .fm-select {
        display: block;
    }

    .fm-tooltip {
        max-width: min(280px, 72vw);
    }

    /* the contact card becomes a closable modal over the backdrop */
    .fm-backdrop {
        display: block;
    }

    .fm-backdrop.fm-show {
        opacity: 1;
        pointer-events: auto;
    }

    .fm-card {
        left: 16px;
        right: 16px;
        bottom: auto;
        top: 50%;
        translate: 0 -50%;
        width: auto;
        max-height: calc(100% - 32px);
        padding-top: 56px;
    }

    .fm-card-close {
        display: inline-flex;
    }

    .fm-zoom-gate {
        top: 16px;
        right: 16px;
        padding: 8px 14px;
        font-size: 13px;
    }

    /* legacy gate fullscreen takeover (currently unused: gate hidden) */
    .fm-map.fm-fullscreen .fm-stage {
        aspect-ratio: auto;
    }
}

/* ── reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .fm-map *,
    .fm-map *::before {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
