/* ==========================================================================
   WF SecurityCloud — kärnkomponenter
   Laddas efter skelettet. Innehåller allt under första skärmen.
   ========================================================================== */

/* --- Sektionshuvud ------------------------------------------------------ */
.section-head { max-width: 720px; margin-bottom: var(--sp-10); }
.section-head--center { margin-inline: auto; text-align: center; }

.section-head__lead {
    margin-top: var(--sp-4);
    font-size: var(--fs-lead);
    color: var(--text-muted);
}

/* --- Rutnät ------------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

@media (max-width: 960px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--split { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* --- Kort --------------------------------------------------------------- */
.card {
    display: flex;
    flex-direction: column;
    padding: var(--sp-6);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.card__icon {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    margin-bottom: var(--sp-5);
    border-radius: var(--r-md);
    background: var(--accent-wash-2);
    color: var(--wfs-yellow);
}
.card__icon svg { width: 20px; height: 20px; }

.card__title { margin-bottom: var(--sp-3); }
.card__text { font-size: var(--fs-sm); color: var(--text-muted); }

.card__foot {
    margin-top: auto;
    padding-top: var(--sp-5);
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
}
.card__link::after {
    content: "→";
    transition: transform 0.15s var(--ease);
}

a.card { text-decoration: none; color: inherit; }
a.card:hover,
.card--interactive:hover {
    border-color: var(--line-accent);
    background: var(--bg-raised);
}
a.card:hover .card__link::after { transform: translateX(3px); }

.card--accent {
    border-color: var(--line-accent);
    background: linear-gradient(180deg, var(--accent-wash), transparent 60%), var(--bg-surface);
}

/* --- Punktlistor -------------------------------------------------------- */
.checklist { display: grid; gap: var(--sp-3); }
.checklist li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: var(--sp-3);
    align-items: start;
    font-size: var(--fs-sm);
}
.checklist li::before {
    content: "";
    width: 18px; height: 18px;
    margin-top: 0.2em;
    border-radius: 50%;
    background: var(--ok-wash);
    border: 1px solid rgba(0, 204, 136, 0.4);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300cc88' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 11px;
    background-position: center;
    background-repeat: no-repeat;
}

.bulletlist { display: grid; gap: var(--sp-3); }
.bulletlist li {
    position: relative;
    padding-left: var(--sp-5);
    font-size: var(--fs-sm);
}
.bulletlist li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.65em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wfs-yellow);
}

/* --- Funktionsrad ------------------------------------------------------- */
.feature {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: var(--sp-4);
    align-items: start;
}
.feature__icon {
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: var(--accent-wash-2);
    color: var(--wfs-yellow);
}
.feature__icon svg { width: 19px; height: 19px; }
.feature h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.feature p { font-size: var(--fs-sm); }

/* --- Stegkedja ---------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: var(--sp-5); }
.steps--row { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .steps--row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps--row { grid-template-columns: 1fr; } }

.step {
    position: relative;
    padding: var(--sp-6);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 30px; height: 30px;
    margin-bottom: var(--sp-4);
    border-radius: 50%;
    background: var(--accent-wash-2);
    border: 1px solid var(--line-accent);
    color: var(--wfs-yellow);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.step h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-2); }
.step p { font-size: var(--fs-sm); }

/* --- Nyckeltal ---------------------------------------------------------- */
.factlist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.fact { padding: var(--sp-6); background: var(--bg-surface); }
.fact__value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--wfs-yellow);
    letter-spacing: -0.02em;
}
.fact__label {
    display: block;
    margin-top: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* --- Märken ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-dim);
}
.badge--accent {
    border-color: var(--line-accent);
    background: var(--accent-wash);
    color: var(--wfs-yellow);
}
.badge--ok {
    border-color: rgba(0, 204, 136, 0.35);
    background: var(--ok-wash);
    color: var(--wfs-ok);
}

/* --- Brödsmulor --------------------------------------------------------- */
.breadcrumbs {
    padding-block: var(--sp-4);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-xs);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.breadcrumbs li { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-dim); }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs a:hover { color: var(--wfs-yellow); }
.breadcrumbs [aria-current="page"] { color: var(--text-muted); }

/* --- Sidhuvud på undersidor --------------------------------------------- */
.page-head {
    padding-block: clamp(2.5rem, 5vw, 4rem);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-deep), var(--bg-base));
}
.page-head__inner { max-width: 760px; }
.page-head__lead {
    margin-top: var(--sp-5);
    font-size: var(--fs-lead);
    color: var(--text-muted);
}

/* --- Löpande text ------------------------------------------------------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--sp-5); }
.prose h2 { margin-top: var(--sp-12); }
.prose h3 { margin-top: var(--sp-8); }
.prose h2 + p, .prose h3 + p { margin-top: var(--sp-4); }
.prose ul, .prose ol { display: grid; gap: var(--sp-3); padding-left: var(--sp-5); }
.prose li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose li::marker { color: var(--wfs-yellow); }

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.prose th, .prose td {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.prose th { color: var(--text); font-weight: 600; }

/* --- Tabell ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 620px; }
.table th, .table td {
    padding: var(--sp-4) var(--sp-5);
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.table thead th {
    background: var(--bg-surface);
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child { color: var(--text); font-weight: 500; }
.table .yes { color: var(--wfs-ok); }
.table .no  { color: var(--text-dim); }

/* --- Frågor och svar ---------------------------------------------------- */
.faq { display: grid; gap: var(--sp-3); max-width: 800px; }
.faq__item {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.faq__item[open] { border-color: var(--line-accent); }
.faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
    color: var(--text);
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
    content: "+";
    flex: none;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--wfs-yellow);
    line-height: 1;
}
.faq__item[open] .faq__q::after { content: "−"; }
.faq__a { padding: 0 var(--sp-5) var(--sp-5); font-size: var(--fs-sm); }
.faq__a > * + * { margin-top: var(--sp-3); }

/* --- Uppmaning ---------------------------------------------------------- */
.cta {
    padding: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, var(--accent-wash), transparent 70%), var(--bg-surface);
    border: 1px solid var(--line-accent);
    border-radius: var(--r-lg);
}
.cta__inner { max-width: 620px; }
.cta h2 { font-size: var(--fs-h2); }
.cta p { margin-top: var(--sp-4); font-size: var(--fs-lead); color: var(--text-muted); }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }

/* --- Nästa steg --------------------------------------------------------- */
.next-step {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
    margin-top: var(--sp-12);
}
@media (max-width: 620px) { .next-step { grid-template-columns: 1fr; } }

.next-step__card {
    display: block;
    padding: var(--sp-5);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    text-decoration: none;
    transition: border-color 0.18s var(--ease);
}
.next-step__card:hover { border-color: var(--line-accent); }
.next-step__card small {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.next-step__card strong {
    display: block;
    margin-top: var(--sp-2);
    font-size: var(--fs-h4);
    color: var(--text);
}
.next-step__card span {
    display: block;
    margin-top: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* --- Skärmbild ------------------------------------------------------------ */
.screenshot { max-width: 800px; }
.screenshot img {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
}

/* --- Hotkarta ------------------------------------------------------------ */
.threatmap {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}
@media (max-width: 1000px) { .threatmap { grid-template-columns: 1fr; } }

.threatmap__figure {
    margin: 0;
    padding: var(--sp-4);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.threatmap__figure canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--r-md);
    background: var(--bg-deep);
}

.threatmap__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-5);
    margin-top: var(--sp-4);
    padding-inline: var(--sp-1);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}
.threatmap__key { display: inline-flex; align-items: center; gap: var(--sp-2); }
.threatmap__key::before {
    content: "";
    width: 9px; height: 9px;
    border-radius: 50%;
    flex: none;
}
.threatmap__key--sensor::before  { background: var(--wfs-yellow); }
.threatmap__key--special::before {
    border-radius: 1px;
    border: 1.5px solid var(--wfs-yellow);
    transform: rotate(45deg);
}
.threatmap__key--hit::before     { background: var(--wfs-danger); }
.threatmap__key--core::before {
    border-radius: 50%;
    border: 2px solid var(--wfs-yellow);
    background: var(--bg-base);
    width: 11px; height: 11px;
}

.threatmap__side h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-5); }
.threatmap__note {
    margin-top: var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--line);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* --- Prisruta ------------------------------------------------------------ */
.price-card {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    border: 1px solid var(--line-accent);
    border-radius: var(--r-lg);
    overflow: hidden;
}
@media (max-width: 760px) { .price-card { grid-template-columns: 1fr; } }

.price-card__figure {
    padding: clamp(1.75rem, 4vw, 2.5rem);
    background: linear-gradient(160deg, var(--accent-wash-2), transparent 70%), var(--bg-surface);
    border-right: 1px solid var(--line);
}
@media (max-width: 760px) {
    .price-card__figure { border-right: 0; border-bottom: 1px solid var(--line); }
}

.price-card__amount {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 6vw, 3.25rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--wfs-yellow);
}
.price-card__cur {
    font-family: var(--font-sans);
    font-size: 0.42em;
    font-weight: 500;
    letter-spacing: 0;
    margin-left: 0.25em;
}
.price-card__unit {
    display: block;
    margin-top: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--text);
}
.price-card__alt {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--line);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.price-card__note {
    margin-top: var(--sp-4);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

.price-card__body { padding: clamp(1.75rem, 4vw, 2.5rem); background: var(--bg-surface); }
.price-card__body h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-5); }
.price-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }

/* --- Notis -------------------------------------------------------------- */
.note {
    padding: var(--sp-5);
    border: 1px solid var(--line);
    border-left: 3px solid var(--wfs-yellow);
    border-radius: 0 var(--r-md) var(--r-md) 0;
    background: var(--bg-surface);
    font-size: var(--fs-sm);
}
.note strong { display: block; margin-bottom: var(--sp-2); }

/* --- Jämförelse --------------------------------------------------------- */
.compare { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare__col {
    padding: var(--sp-6);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
}
.compare__col h3 { font-size: var(--fs-h4); margin-bottom: var(--sp-5); }
.compare__col--ours { border-color: var(--line-accent); }
.compare__col--ours h3 { color: var(--wfs-yellow); }

/* --- Sidfot ------------------------------------------------------------- */
.site-footer {
    padding-block: var(--sp-16) var(--sp-8);
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
    font-size: var(--fs-sm);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: var(--sp-8);
}
@media (max-width: 1000px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }

.footer-brand { max-width: 280px; }
.footer-brand p {
    margin-top: var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--text-dim);
}

.footer-col h3 {
    margin-bottom: var(--sp-4);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.footer-col ul { display: grid; gap: var(--sp-3); }
.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
}
.footer-col a:hover { color: var(--wfs-yellow); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    margin-top: var(--sp-12);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--line);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.footer-bottom a { color: var(--text-dim); text-decoration: none; }
.footer-bottom a:hover { color: var(--text-muted); }

/* --- Formulär ----------------------------------------------------------- */
.field { display: grid; gap: var(--sp-2); }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.field .hint { font-size: var(--fs-xs); color: var(--text-dim); }

.input, .textarea, .select {
    width: 100%;
    padding: 0.7rem 0.875rem;
    background: var(--bg-base);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: var(--fs-sm);
    transition: border-color 0.15s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--wfs-yellow);
    outline: none;
}
.textarea { min-height: 140px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }

.form-grid { display: grid; gap: var(--sp-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* --- Illustrationer ----------------------------------------------------- */
.illustration {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-surface);
}

.figure { display: grid; gap: var(--sp-3); }
.figure figcaption {
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* --- Delad sektion ------------------------------------------------------- */
/* Kolumnerna är sällan lika höga i blocksektioner — då ser toppjustering
   bättre ut än centrering, som annars lämnar texten svävande. */
.section--split .grid--split { align-items: start; }

.split__text > .prose-p + .prose-p { margin-top: var(--sp-4); }
.split__aside > * + * { margin-top: var(--sp-6); }
.split__points { margin-top: var(--sp-6); }

.grid--split-flip .split__text  { order: 2; }
.grid--split-flip .split__aside { order: 1; }
@media (max-width: 960px) {
    .grid--split-flip .split__text  { order: 1; }
    .grid--split-flip .split__aside { order: 2; }
}

.prose-p { color: var(--text-muted); }

.section-more { margin-top: var(--sp-6); }

.next-step__heading { font-size: var(--fs-h3); }
.next-step__heading + .next-step { margin-top: var(--sp-6); }

/* Lista över det vi inte gör — samma form som checklistan, annan markör */
.crosslist { display: grid; gap: var(--sp-3); }
.crosslist li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: var(--sp-3);
    align-items: start;
    font-size: var(--fs-sm);
}
.crosslist li::before {
    content: "";
    width: 18px; height: 18px;
    margin-top: 0.2em;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
    background-size: 10px;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Småhjälpare --------------------------------------------------------- */
/* Inline style-attribut är blockerade av vår CSP, så varianter blir klasser. */
.hero__actions--center { justify-content: center; }
.text-center { text-align: center; }

/* --- 404 ---------------------------------------------------------------- */
.error-page {
    display: grid;
    place-items: center;
    min-height: 60vh;
    text-align: center;
    padding-block: var(--sp-16);
}
.error-page__code {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 600;
    color: var(--wfs-yellow);
    line-height: 1;
}
