/* ==========================================================================
   Vitalgelenk — Stylesheet
   Portale divulgativo sull'apparato locomotore
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
    /* Ink scale — deep blue-black, used for chrome and dark panels */
    --ink-900: #0d141a;
    --ink-800: #16202a;
    --ink-700: #223140;
    --ink-600: #35485a;
    --ink-400: #64798a;
    --ink-300: #8ea1b0;

    /* Paper scale */
    --paper: #f2f5f7;
    --paper-2: #e8eef1;
    --surface: #ffffff;
    --line: #dae3e8;
    --line-strong: #bfcdd6;
    --line-dark: #2b3a49;

    /* Accents */
    --petrol: #0e7a85;
    --petrol-dark: #095a63;
    --petrol-soft: #e0f0f1;
    --ochre: #c98a12;
    --ochre-soft: #fbf1d9;
    --alert: #b4432c;
    --alert-soft: #fbeae6;

    /* Type */
    --font-ui: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
    --font-prose: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

    /* Metrics */
    --gutter: clamp(1.15rem, 4.5vw, 2.5rem);
    --wide: 1180px;
    --narrow: 720px;
    --radius: 4px;
    --radius-lg: 8px;
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-800);
    background: var(--paper);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow-x: hidden;
}

img,
svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--petrol-dark);
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink-900);
}

p {
    margin: 0 0 1.05em;
}

p:last-child {
    margin-bottom: 0;
}

ul,
ol {
    margin: 0 0 1.05em;
    padding-left: 1.15em;
}

li {
    margin-bottom: 0.4em;
}

:focus-visible {
    outline: 3px solid var(--ochre);
    outline-offset: 2px;
}

::selection {
    background: var(--petrol);
    color: #fff;
}

/* --- Layout helpers ------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.wrap-narrow {
    width: 100%;
    max-width: var(--narrow);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.band {
    padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.band-tight {
    padding: clamp(2rem, 4vw, 3rem) 0;
}

.band-overlap {
    padding-top: 0;
}

.band-dark {
    background: var(--ink-900);
    color: #dfe8ee;
}

.band-dark h2,
.band-dark h3 {
    color: #fff;
}

.band-paper2 {
    background: var(--paper-2);
}

.band-white {
    background: var(--surface);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ochre);
    color: var(--ink-900);
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    z-index: 200;
}

.skip-link:focus {
    left: 0;
}

/* --- Eyebrow / section head ---------------------------------------------- */

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--petrol);
    margin: 0 0 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--ochre);
    flex: none;
}

.band-dark .eyebrow {
    color: #6fc2c9;
}

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-head h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.35rem);
}

.section-head p {
    margin-top: 0.9rem;
    color: var(--ink-600);
    font-size: 1.02rem;
}

.band-dark .section-head p {
    color: var(--ink-300);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ink-900);
    border-bottom: 1px solid var(--line-dark);
}

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: -0.02em;
    flex: none;
}

.brand svg {
    width: 26px;
    height: 26px;
    flex: none;
}

.brand span i {
    font-style: normal;
    color: #6fc2c9;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav a {
    color: #c3d2dc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius);
    transition: color 0.15s ease, background 0.15s ease;
}

.nav a:hover {
    color: #fff;
    background: var(--ink-700);
}

.nav a[aria-current='page'] {
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--ochre);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    color: #fff;
    padding: 0.45rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.progress-rail {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 100%;
    background: transparent;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--ochre);
    transition: width 0.1s linear;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: block;
    }

    .nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--ink-800);
        border-bottom: 1px solid var(--line-dark);
        padding: 0.5rem var(--gutter) 1rem;
        display: none;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 0.75rem 0.4rem;
        border-bottom: 1px solid var(--line-dark);
        border-radius: 0;
    }

    .nav a:last-child {
        border-bottom: 0;
    }
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
    background: var(--ink-900);
    color: #dfe8ee;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(46rem 26rem at 78% 12%, rgba(14, 122, 133, 0.34), transparent 62%),
        radial-gradient(30rem 22rem at 8% 92%, rgba(201, 138, 18, 0.14), transparent 65%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    padding: clamp(2.75rem, 6vw, 5rem) 0 clamp(2.25rem, 5vw, 4rem);
}

.hero h1 {
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.15rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
}

.hero h1 em {
    font-style: normal;
    color: #6fc2c9;
}

.hero-lead {
    margin-top: 1.15rem;
    font-size: clamp(1.02rem, 2vw, 1.14rem);
    color: #b9cad6;
    max-width: 34rem;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.chip {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9fb4c2;
    border: 1px solid var(--line-dark);
    border-radius: 100px;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* --- Anatomy figure (signature element) ----------------------------------- */

.anatomy {
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    padding: 1.25rem;
}

.anatomy > svg {
    width: 100%;
    height: auto;
}

.anatomy figcaption {
    margin-top: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.5;
    letter-spacing: 0.05em;
    color: #8ba1b0;
    text-transform: uppercase;
}

.anatomy .a-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    fill: #c3d2dc;
}

.anatomy .a-lead {
    stroke: #4d6473;
    stroke-width: 1;
    stroke-dasharray: 2 3;
    fill: none;
}

.anatomy .a-bone {
    fill: #e7edf1;
}

.anatomy .a-bone-2 {
    fill: #cdd9e0;
}

.anatomy .a-cart-line {
    stroke: #6fc2c9;
    stroke-width: 9;
    fill: none;
    stroke-linecap: round;
}

.anatomy .a-fluid {
    fill: rgba(224, 162, 39, 0.5);
}

.anatomy .a-lig {
    stroke: #e0a227;
    stroke-width: 4;
    fill: none;
    stroke-linecap: round;
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    padding: 0.75rem 1.3rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: var(--petrol);
    color: #fff;
}

.btn-primary:hover {
    background: #12909d;
}

.btn-ghost {
    background: transparent;
    color: #dfe8ee;
    border-color: var(--line-dark);
}

.btn-ghost:hover {
    border-color: #6fc2c9;
    color: #fff;
}

.btn-line {
    background: transparent;
    color: var(--ink-900);
    border-color: var(--line-strong);
}

.btn-line:hover {
    border-color: var(--petrol);
    color: var(--petrol-dark);
}

/* --- Notice blocks -------------------------------------------------------- */

.notice {
    border: 1px solid var(--line);
    border-left: 4px solid var(--ochre);
    background: var(--ochre-soft);
    border-radius: var(--radius);
    padding: clamp(1.15rem, 3vw, 1.75rem);
}

.notice h2,
.notice h3 {
    font-size: 1.12rem;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.notice p {
    font-size: 0.95rem;
    color: #55452a;
}

.notice-alert {
    border-left-color: var(--alert);
    background: var(--alert-soft);
}

.notice-alert p {
    color: #6b3325;
}

.notice-flat {
    background: var(--surface);
    border-left-color: var(--petrol);
}

.notice-flat p {
    color: var(--ink-600);
}

/* --- Cards ---------------------------------------------------------------- */

.grid {
    display: grid;
    gap: 1.15rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.card h3 {
    font-size: 1.05rem;
}

.card p {
    font-size: 0.93rem;
    color: var(--ink-600);
    margin: 0;
}

.card-icon {
    width: 34px;
    height: 34px;
    stroke: var(--petrol);
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.card-link:hover {
    border-color: var(--petrol);
    transform: translateY(-2px);
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-400);
}

.card-more {
    margin-top: auto;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--petrol-dark);
}

/* --- Anatomy parts list --------------------------------------------------- */

.parts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.part {
    padding: 1.5rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.part:last-child {
    border-right: 0;
}

.part-key {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ochre);
    display: block;
    margin-bottom: 0.55rem;
}

.part h3 {
    font-size: 1.02rem;
    margin-bottom: 0.5rem;
}

.part p {
    font-size: 0.9rem;
    color: var(--ink-600);
    margin: 0;
}

/* --- Steps (genuine sequence) --------------------------------------------- */

.steps {
    counter-reset: step;
    display: grid;
    gap: 0;
}

.step {
    counter-increment: step;
    display: grid;
    grid-template-columns: 3.75rem 1fr;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
}

.step:last-child {
    border-bottom: 1px solid var(--line);
}

.step::before {
    content: counter(step, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--petrol);
    padding-top: 0.15rem;
}

.step h3 {
    font-size: 1.08rem;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--ink-600);
    font-size: 0.96rem;
    margin: 0;
}

@media (max-width: 560px) {
    .step {
        grid-template-columns: 2.5rem 1fr;
        gap: 0.9rem;
    }
}

/* --- Data strip ----------------------------------------------------------- */

.figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.15rem;
}

.figure-cell {
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.03);
}

.figure-value {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 3.5vw, 1.95rem);
    color: #e0a227;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.figure-cell p {
    margin: 0.7rem 0 0;
    font-size: 0.88rem;
    color: #a8bcc9;
}

.figure-source {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #7d94a3;
}

.figure-source a {
    color: #6fc2c9;
}

/* --- Standards list ------------------------------------------------------- */

.standards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.15rem;
}

.standard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
}

.standard h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--line);
}

.standard p {
    font-size: 0.91rem;
    color: var(--ink-600);
    margin: 0;
}

/* --- Source list ---------------------------------------------------------- */

.source-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--line);
}

.source-list li {
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.source-list a {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 1rem 0.2rem;
    text-decoration: none;
    color: var(--ink-900);
    font-weight: 600;
    transition: color 0.15s ease;
}

.source-list a:hover {
    color: var(--petrol-dark);
}

.source-list .src-org {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    flex: none;
    width: 5.5rem;
    text-transform: uppercase;
}

.source-list .src-desc {
    display: block;
    font-weight: 400;
    font-size: 0.88rem;
    color: var(--ink-600);
    margin-top: 0.2rem;
}

/* --- Prose (articles + legal) --------------------------------------------- */

.page-head {
    background: var(--ink-900);
    color: #dfe8ee;
    padding: clamp(2.25rem, 5vw, 3.5rem) 0;
}

.page-head h1 {
    color: #fff;
    font-size: clamp(1.7rem, 4.2vw, 2.6rem);
    max-width: 30ch;
}

.page-head p {
    margin: 1rem 0 0;
    color: #a8bcc9;
    max-width: 46rem;
    font-size: 1rem;
}

.page-meta {
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #7d94a3;
}

.prose {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 3rem);
    margin: clamp(-3.5rem, -5vw, -2rem) auto 0;
    position: relative;
}

.prose-body {
    font-family: var(--font-prose);
    font-size: 1.09rem;
    line-height: 1.72;
    color: #26333d;
}

.prose-body h2 {
    font-family: var(--font-ui);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin: 2.25rem 0 0.9rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.prose-body h2:first-child,
.takeaway + h2 {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.prose-body h3 {
    font-family: var(--font-ui);
    font-size: 1.08rem;
    margin: 1.65rem 0 0.6rem;
}

.prose-body ul,
.prose-body ol {
    padding-left: 1.3em;
}

.prose-body strong {
    color: var(--ink-900);
}

.prose-body a {
    color: var(--petrol-dark);
}

.takeaway {
    background: var(--petrol-soft);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin: 0 0 2rem;
    font-family: var(--font-ui);
    font-size: 0.96rem;
    line-height: 1.6;
}

.takeaway h2 {
    font-size: 0.72rem !important;
    font-family: var(--font-mono) !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--petrol-dark);
    margin: 0 0 0.7rem !important;
    padding: 0 !important;
    border: 0 !important;
}

.takeaway ul {
    margin: 0;
    padding-left: 1.15em;
    color: var(--ink-700);
}

.takeaway li:last-child {
    margin-bottom: 0;
}

.article-foot {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--ink-600);
}

.article-foot h2 {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    margin: 0 0 0.6rem;
    padding: 0;
    border: 0;
}

.article-foot ul {
    padding-left: 1.15em;
    margin-bottom: 1.25rem;
}

.backlink {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--petrol-dark);
    text-decoration: none;
}

.backlink:hover {
    text-decoration: underline;
}

/* --- Definition rows (legal pages) ---------------------------------------- */

.deflist {
    margin: 0 0 1.5rem;
}

.deflist dt {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-400);
    margin-top: 1.1rem;
}

.deflist dd {
    margin: 0.3rem 0 0;
    font-family: var(--font-ui);
    font-size: 0.98rem;
}

.placeholder {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--ochre-soft);
    border: 1px dashed var(--ochre);
    border-radius: 3px;
    padding: 0.05rem 0.4rem;
    color: #85600c;
}

/* --- Contact form --------------------------------------------------------- */

.form-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

@media (max-width: 860px) {
    .form-shell {
        grid-template-columns: 1fr;
    }
}

.form-centered {
    max-width: 62rem;
    margin: 0 auto;
    text-align: center;
}

.form-centered .eyebrow {
    justify-content: center;
}

.form-centered h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.35rem);
}

.form-intro {
    margin: 0.9rem auto 0;
    max-width: 46rem;
    color: var(--ink-600);
    font-size: 1.02rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.6rem 0 2rem;
}

.chip-light {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-600);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 0.45rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.chip-light svg {
    width: 13px;
    height: 13px;
    stroke: var(--petrol);
    stroke-width: 1.9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.form-centered .form-card {
    text-align: left;
}

.form-centered .submit-btn {
    display: flex;
    width: auto;
    min-width: 16rem;
    margin: 1.75rem auto 0;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(1.35rem, 3.5vw, 2.25rem);
}

.field {
    margin-bottom: 1.15rem;
}

.field label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--ink-700);
}

.field input,
.field textarea {
    width: 100%;
    font-family: var(--font-ui);
    font-size: 0.98rem;
    color: var(--ink-900);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--petrol);
    background: var(--surface);
    outline: none;
    box-shadow: 0 0 0 3px var(--petrol-soft);
}

.field textarea {
    min-height: 8rem;
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
}

@media (max-width: 560px) {
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.consent {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    font-size: 0.86rem;
    color: var(--ink-600);
    line-height: 1.5;
}

.consent input {
    width: auto;
    margin-top: 0.2rem;
    flex: none;
    accent-color: var(--petrol);
}

.error-message {
    display: none;
    color: var(--alert);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.form-alert {
    display: none;
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    font-size: 0.92rem;
    margin-bottom: 1.15rem;
}

.form-alert.visible {
    display: block;
}

.form-alert-error {
    background: var(--alert-soft);
    color: #6b3325;
    border: 1px solid #e6bcb0;
}

.form-success {
    display: none;
    background: var(--petrol-soft);
    border: 1px solid #a8d5d9;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.form-success.visible {
    display: block;
}

.submit-btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
}

.submit-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-aside .eyebrow {
    margin-bottom: 0.75rem;
}

.form-aside h2 {
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    margin-bottom: 0.9rem;
}

.form-aside p {
    color: var(--ink-600);
    font-size: 0.97rem;
}

.aside-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    border-top: 1px solid var(--line);
}

.aside-list li {
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    color: var(--ink-600);
    text-transform: uppercase;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
    background: var(--ink-900);
    color: #93a8b6;
    padding: clamp(2.5rem, 5vw, 3.75rem) 0 2rem;
    font-size: 0.9rem;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line-dark);
}

@media (max-width: 820px) {
    .footer-top {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    }
}

.footer-brand svg {
    width: 30px;
    height: 30px;
    margin-bottom: 0.75rem;
}

.footer-brand strong {
    color: #fff;
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.86rem;
    max-width: 24rem;
    color: #7d94a3;
}

.footer-col h3 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #6fc2c9;
    margin-bottom: 0.9rem;
    font-weight: 500;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 0.55rem;
}

.footer-col a,
.footer-col button {
    color: #93a8b6;
    text-decoration: none;
    font-size: 0.88rem;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.footer-col a:hover,
.footer-col button:hover {
    color: #fff;
}

.footer-legal {
    padding-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6d8393;
}

.footer-disclaimer {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line-dark);
    border-left: 3px solid var(--ochre);
    border-radius: var(--radius);
    font-size: 0.83rem;
    color: #9fb4c2;
}

.entity-pending {
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: #7d94a3;
}

/* --- Cookie consent ------------------------------------------------------- */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: var(--ink-800);
    border-top: 1px solid var(--line-dark);
    transform: translateY(110%);
    transition: transform 0.25s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 1.15rem var(--gutter);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    align-items: center;
    justify-content: space-between;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.86rem;
    color: #b9cad6;
    max-width: 44rem;
}

.cookie-banner a {
    color: #6fc2c9;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cookie-actions button {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid var(--line-dark);
    background: transparent;
    color: #dfe8ee;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cookie-actions button:hover {
    border-color: #6fc2c9;
}

.cookie-actions .btn-consent-primary,
.cookie-actions .btn-consent-secondary {
    background: var(--petrol);
    border-color: var(--petrol);
    color: #fff;
    min-width: 9.5rem;
    justify-content: center;
}

.cookie-actions .btn-consent-primary:hover,
.cookie-actions .btn-consent-secondary:hover {
    background: #12909d;
    border-color: #12909d;
}

.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(13, 20, 26, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
}

.cookie-modal-overlay.visible {
    display: flex;
}

.cookie-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 34rem;
    width: 100%;
    padding: clamp(1.35rem, 4vw, 2rem);
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-modal h2 {
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
}

.cookie-modal > p {
    font-size: 0.92rem;
    color: var(--ink-600);
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}

.cookie-option h3 {
    font-size: 0.98rem;
    margin-bottom: 0.25rem;
}

.cookie-option p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-600);
}

.cookie-option label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-700);
    flex: none;
    cursor: pointer;
}

.cookie-option input {
    accent-color: var(--petrol);
    width: 1.1rem;
    height: 1.1rem;
}

.cookie-locked {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-400);
    flex: none;
}

.cookie-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

/* --- Scroll to top -------------------------------------------------------- */

.to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line-dark);
    background: var(--ink-800);
    color: #dfe8ee;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.to-top:hover {
    border-color: #6fc2c9;
}

/* --- Reveal on scroll ----------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.shown {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
