/* /for-verksted form layout. Form on the left, live partner-card preview on the right.
   Stacks below ~900 px. */

/* Main + article keep the site-default 850px width (see layout.css).
   The benefits block and the form-grid (with its h2) break out to a wider
   canvas — they still need room for the live preview + two-column lists.
   The break-out rule lives below. */

/* Break-out: escape the 800px parent and re-center on the viewport, capped
   at 1250px with a 16px gutter on each side. Works because <main> is auto-
   centered, so `margin-left: 50% - elementWidth/2` lands on viewport center. */
.for-verksted__break-out {
    width: min(100vw - 32px, 1250px);
    margin-left: calc(50% - min(50vw - 16px, 625px));
    margin-right: calc(50% - min(50vw - 16px, 625px));
}

.for-verksted__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 48px;
    align-items: start;
    margin-top: 24px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .for-verksted__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* ── Form ────────────────────────────────────────────────────────── */
.for-verksted__form {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 40px 44px 44px 44px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 28px -12px rgba(0, 0, 0, 0.08);
}

/* Visual grouping: two sections with a heading + subtitle.
   First section sits flush with the form top, subsequent sections
   get a separator on top. */
.for-verksted__section + .for-verksted__section {
    margin-top: 16px;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.for-verksted__section-head {
    margin-bottom: 22px;
}

.for-verksted__section-title {
    margin: 0 !important;
    font-size: 18px;
    font-weight: 700;
    color: var(--foreground-primary);
    letter-spacing: -0.1px;
}

.for-verksted__section-desc {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--foreground-secondary);
}

@media (max-width: 540px) {
    .for-verksted__form {
        padding: 28px 22px;
    }
}

.for-verksted__errors {
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #b9342a;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 14px;
}

.for-verksted__errors ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.for-verksted__field {
    border: none;
    padding: 0;
    margin: 0 0 28px 0;
}

.for-verksted__field--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* On mobile every field stacks — paired fields go to single-column at the
   same breakpoint where the form leaves the desktop grid (900px above). */
@media (max-width: 768px) {
    .for-verksted__field--row {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

.for-verksted__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground-primary);
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.for-verksted__field input[type="text"],
.for-verksted__field input[type="email"],
.for-verksted__field input[type="tel"],
.for-verksted__field input[type="url"],
.for-verksted__field input[type="file"] {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background-color: #ffffff;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.for-verksted__field input[type="text"]:focus,
.for-verksted__field input[type="email"]:focus,
.for-verksted__field input[type="tel"]:focus,
.for-verksted__field input[type="url"]:focus,
.for-verksted__field input[type="file"]:focus {
    outline: none;
    border-color: var(--action-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--action-primary) 18%, transparent);
}

.for-verksted__hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--foreground-secondary);
}

.for-verksted__optional {
    font-weight: 400;
    color: var(--foreground-secondary);
    font-size: 12px;
}

.for-verksted__workshop-summary {
    margin-top: 14px;
    padding: 12px 16px;
    background-color: color-mix(in srgb, var(--action-primary) 6%, transparent);
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
}

/* `display: flex` above otherwise wins over the [hidden] attribute. */
.for-verksted__workshop-summary[hidden] {
    display: none;
}

.for-verksted__workshop-summary-label {
    font-weight: 600;
    color: var(--foreground-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.for-verksted__workshop-summary-value {
    color: var(--foreground-primary);
}

/* Number inputs (vanlig pris / tilbudspris) — match the text inputs. */
.for-verksted__field input[type="number"] {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background-color: #ffffff;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.for-verksted__field input[type="number"]:focus {
    outline: none;
    border-color: var(--action-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--action-primary) 18%, transparent);
}

/* ── Workshop combobox ──────────────────────────────────────────── */
.for-verksted__combobox {
    position: relative;
}

.for-verksted__suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    list-style: none;
    margin: 4px 0 0 0;
    padding: 4px;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
}

.for-verksted__suggestions li {
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.for-verksted__suggestions li:hover,
.for-verksted__suggestions li[aria-selected="true"] {
    background-color: color-mix(in srgb, var(--action-primary) 8%, transparent);
}

.for-verksted__suggestion-meta {
    font-size: 12px;
    color: var(--foreground-secondary);
}

/* ── Color picker ───────────────────────────────────────────────── */
.for-verksted__color {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.for-verksted__color-chip {
    position: relative;
    display: inline-flex;
    width: 64px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    flex: 0 0 auto;
}

.for-verksted__color-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.for-verksted__color-chip-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.for-verksted__color-chip-edit {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    color: var(--foreground-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.for-verksted__color-picker {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
}

.for-verksted__color-hex-wrap {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #ffffff;
    padding-left: 12px;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.for-verksted__color-hex-wrap:focus-within {
    border-color: var(--action-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--action-primary) 18%, transparent);
}

.for-verksted__color-hex-prefix {
    color: var(--foreground-secondary);
    font-family: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
}

.for-verksted__color-hex {
    border: 0 !important;
    background: transparent !important;
    font-family: ui-monospace, 'SFMono-Regular', 'Menlo', monospace !important;
    font-size: 15px !important;
    letter-spacing: 0.4px;
    text-transform: lowercase;
    padding: 13px 12px 13px 6px !important;
    outline: none;
    width: 100%;
    color: var(--foreground-primary);
}

.for-verksted__color-hex:focus {
    box-shadow: none !important;
}

.for-verksted__color-hex:invalid:not(:placeholder-shown) {
    color: #b9342a;
}

/* ── Terms checkbox ─────────────────────────────────────────────── */
/* The terms section sits between contact-info and the submit. Give it a
   subtle separator + extra space so it visually concludes the form. */
.for-verksted__terms {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.for-verksted__terms label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--foreground-primary);
    cursor: pointer;
}

.for-verksted__terms input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    accent-color: var(--action-primary);
    flex-shrink: 0;
}

/* ── Submit button ──────────────────────────────────────────────── */
.for-verksted__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--action-primary);
    color: white;
    border: none;
    padding: 16px 36px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--standard-box-shadow);
    transition: 0.15s ease-in-out;
    margin-top: 8px;
}

.for-verksted__submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.for-verksted__legal {
    font-size: 12px;
    line-height: 1.5;
    color: var(--foreground-secondary);
    margin-top: 16px;
    margin-bottom: 0;
}

/* ── Preview pane ───────────────────────────────────────────────── */
.for-verksted__preview {
    position: sticky;
    top: 24px;
}

.for-verksted__preview-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--foreground-secondary);
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .for-verksted__preview {
        position: static;
    }
}

/* ── Scarcity banner ───────────────────────────────────────────── */
/* Sits above the benefits block. Two-column on desktop (message + meter),
   stacks on mobile. Brand-tinted gradient with a filling bar to drive the
   "X of 20 slots taken" message home. */
.for-verksted__scarcity {
    /* margin-block only — left/right are owned by .for-verksted__break-out
       (same trick the .for-verksted__benefits block uses). */
    margin-top: 24px;
    margin-bottom: 0;
    padding: 22px 28px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--action-primary) 14%, #ffffff) 0%,
        color-mix(in srgb, var(--action-primary) 6%, #ffffff) 100%);
    border: 1px solid color-mix(in srgb, var(--action-primary) 28%, transparent);
    border-radius: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 24px;
    align-items: center;
}

@media (max-width: 720px) {
    .for-verksted__scarcity {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 20px;
    }
}

.for-verksted__scarcity-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--foreground-primary);
    font-size: 15px;
    line-height: 1.5;
}

.for-verksted__scarcity-text strong:first-child {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--action-primary);
    margin-bottom: 2px;
}

.for-verksted__scarcity-meter {
    position: relative;
    background-color: rgba(255, 255, 255, 0.65);
    border: 1px solid color-mix(in srgb, var(--action-primary) 20%, transparent);
    border-radius: 999px;
    height: 32px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.for-verksted__scarcity-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        var(--action-primary) 0%,
        color-mix(in srgb, var(--action-primary) 70%, #000) 100%);
    transition: width 0.4s ease;
    border-radius: 999px 0 0 999px;
}

/* When the bar is at 100% there shouldn't be a fillet on the right. */
.for-verksted__scarcity-bar[style*="100"] {
    border-radius: 999px;
}

.for-verksted__scarcity-count {
    position: relative;
    z-index: 1;
    font-weight: 800;
    font-size: 14px;
    color: var(--foreground-primary);
    letter-spacing: 0.5px;
    /* Half over the filled portion, half over the empty — mix-blend keeps it
       legible in both halves. */
    mix-blend-mode: difference;
    color: #ffffff;
}

/* ── SEO content sections ───────────────────────────────────────── */

.for-verksted__lead {
    font-size: 17px;
    line-height: 1.55;
    max-width: 850px;
}

.for-verksted__benefits {
    /* margin-block only — left/right are owned by .for-verksted__break-out. */
    margin-top: 28px;
    margin-bottom: 36px;
    padding: 50px;
    background-color: color-mix(in srgb, var(--action-primary) 4%, transparent);
    border-left: 3px solid var(--action-primary);
    border-radius: 6px;
}

@media (max-width: 768px) {
    .for-verksted__benefits {
        padding: 25px 15px;
    }

    .for-verksted__benefits h2 {
        padding: 0 30px !important;
    }
}

.for-verksted__benefits h2 {
    margin-top: 0 !important;
}

/* Two-column grid on wide screens, single column on mobile. Each li is a
   small block with its own breathing room. Uses .dot-list for the green
   marker — see layout.css. */
.for-verksted__benefits-list {
    margin: 35px 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px 36px;
}

.for-verksted__benefits-list > li {
    /* override .dot-list defaults: grid gap handles vertical rhythm now */
    margin-bottom: 0;
    line-height: 1.65;
    font-size: 15px;
    color: var(--foreground-primary);
}

.for-verksted__benefits-list > li strong {
    display: block;
    margin-bottom: 4px;
    color: var(--foreground-primary);
    font-weight: 700;
}

/* Nudge the green dot down to sit on the first line of text rather than
   on the bold lead-in (which is now on its own line). */
.for-verksted__benefits-list > li::before {
    top: 9px;
}

.for-verksted__how,
.for-verksted__audience,
.for-verksted__faq {
    margin-top: 40px;
    max-width: 850px;
}

.for-verksted__steps {
    padding-left: 22px;
    counter-reset: step;
}

.for-verksted__steps li {
    margin-bottom: 16px;
    line-height: 1.55;
    font-size: 15px;
}

.for-verksted__steps li::marker {
    color: var(--action-primary);
    font-weight: 700;
}

/* FAQ accordion: inherit the shared .faq-list styles from articlePage.css
   (rotating chevron, hover-border, focus-visible outline). No override needed. */

/* ── Thank-you page ─────────────────────────────────────────────── */
.for-verksted--takk {
    text-align: center;
    padding-top: 40px !important;
}

.for-verksted__takk-card {
    max-width: 560px;
    margin: 40px auto;
    padding: 40px 32px;
    background-color: color-mix(in srgb, var(--action-primary) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--action-primary) 20%, transparent);
    border-radius: 12px;
}

.for-verksted__takk-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--action-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.for-verksted__takk-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.for-verksted__takk-secondary {
    color: var(--foreground-secondary);
    text-decoration: underline;
    font-size: 14px;
    align-self: center;
}

/* ── Client-side validation ──────────────────────────────────────── */
/* Server-rendered error pills (ASP.NET tag helpers / model state) and the
   JS-injected siblings share the same look so the field UI is stable
   regardless of which layer caught the error. */
.field-validation-error,
.js-validation-error {
    display: block;
    margin-top: 8px;
    color: #c0392b;
    font-size: 12.5px;
    line-height: 1.4;
}

.for-verksted__field.is-invalid input:not([type=checkbox]):not([type=color]):not([type=file]),
.for-verksted__field.is-invalid select,
.for-verksted__field.is-invalid textarea,
.for-verksted__field.is-invalid .for-verksted__color-hex-wrap {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}

.for-verksted__field.is-invalid .for-verksted__combobox input {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}
