/* Publik webbplats – styrs av CSS-variabler från API */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }

.wrap {
    width: min(1100px, calc(100% - 2rem));
    margin-inline: auto;
}
.wrap.narrow { width: min(720px, calc(100% - 2rem)); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.brand-text strong {
    font-family: var(--font-heading);
    font-size: 1.15rem;
}
.brand-text small {
    color: var(--color-muted);
    font-size: 0.85rem;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}
.nav a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.nav a:hover { color: var(--color-accent); }

.hero {
    position: relative;
    min-height: min(72vh, 640px);
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--color-primary) 92%, #000) 0%, var(--color-secondary) 100%);
    color: #fff;
    overflow: hidden;
}
.hero.has-image {
    background-image:
        linear-gradient(180deg, rgba(10, 16, 28, 0.35) 0%, rgba(10, 16, 28, 0.78) 100%),
        var(--hero-image);
    background-size: cover;
    background-position: center;
}
.hero-inner {
    padding: 4rem 0 3.5rem;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.7s ease, opacity 0.7s ease;
}
.hero.is-ready .hero-inner {
    transform: none;
    opacity: 1;
}
.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.1;
    margin: 0 0 0.75rem;
    max-width: 14ch;
}
.hero-sub {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 36ch;
    opacity: 0.92;
    margin: 0 0 1.5rem;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.btn-hero-secondary {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.22); }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    border: none;
}
.btn-accent {
    background: var(--color-accent);
    color: #fff;
}
.btn-accent:hover { filter: brightness(1.05); }
.btn-block { width: 100%; text-align: center; }

.btn-offert-submit {
    cursor: pointer;
    transition: background-color 0.15s ease, filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 0 color-mix(in srgb, var(--color-accent) 55%, #000);
}
.btn-offert-submit:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.btn-offert-submit:active:not(:disabled) {
    filter: brightness(0.92);
    transform: translateY(1px);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--color-accent) 55%, #000);
}
.btn-offert-submit:disabled,
.btn-offert-submit.is-sending {
    cursor: not-allowed;
    opacity: 0.72;
    filter: none;
    transform: none;
    box-shadow: none;
    background: color-mix(in srgb, var(--color-accent) 70%, #64748b);
}

.flash-section { padding-top: 1.5rem; padding-bottom: 0; }
.flash {
    padding: 1rem 1.15rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.flash-success {
    background: color-mix(in srgb, #16a34a 12%, var(--color-surface));
    border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
    color: #14532d;
}
.flash-error {
    background: color-mix(in srgb, #dc2626 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, #dc2626 30%, transparent);
    color: #7f1d1d;
}
.flash-notice {
    background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
    margin: 1rem 0 1.25rem;
}
.flash-notice p { margin: 0 0 0.35rem; }
.flash-notice p:last-child { margin-bottom: 0; }

.offert-form { margin-top: 1.25rem; }
.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: 2fr 1fr 1fr; }
.form-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--color-text) 18%, transparent);
    border-radius: 8px;
    font: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}
.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
    border-color: transparent;
}
.form-field textarea { resize: vertical; min-height: 6rem; }
.field-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}
.span-2 { grid-column: span 2; }
.math-field input { max-width: 8rem; }
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.section {
    padding: 4rem 0;
}
.section-alt {
    background: color-mix(in srgb, var(--color-surface) 70%, var(--color-bg));
}
.section h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin: 0 0 1.25rem;
}
.prose { font-size: 1.05rem; color: var(--color-text); }
.muted { color: var(--color-muted); }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.card {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease;
}
.card:hover { transform: translateY(-3px); }
.card h3 {
    font-family: var(--font-heading);
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}
.card p { margin: 0; color: var(--color-muted); }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.gallery-item {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #111;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.hours-list { margin: 0; }
.hours-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
}
.hours-item dt { font-weight: 700; }
.hours-item dd { margin: 0; color: var(--color-muted); }

.section-contact {
    background: var(--color-primary);
    color: #fff;
}
.section-contact h2 { color: #fff; }
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.contact-pill {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.18);
}
.contact-pill.static { cursor: default; }
.section-contact .btn-accent { margin-top: 0.25rem; }

.site-footer {
    padding: 1.5rem 0 2rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}

body.modal-open { overflow: hidden; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}
.modal-panel {
    position: relative;
    width: min(440px, 100%);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 14px;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}
.modal.is-open .modal-panel {
    transform: none;
}
.modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.modal-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #166534;
    background: color-mix(in srgb, #16a34a 14%, var(--color-surface));
    border: 1px solid color-mix(in srgb, #16a34a 28%, transparent);
}
.modal-panel h2 {
    font-family: var(--font-heading);
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
}
.modal-lead {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    line-height: 1.55;
}
.modal-note {
    margin: 0 0 1.25rem;
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.modal-phone { margin: 0 0 1rem; }
.modal-ok { min-width: 8rem; }

@media (max-width: 720px) {
    .hero { min-height: 60vh; align-items: center; }
    .hero h1 { max-width: none; }
    .nav { width: 100%; }
    .form-grid.two,
    .form-grid.three { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
}

