/*
 * Self-contained styling for the public supplier pages. No CDN, no build step:
 * the plugin serves this through its own asset route.
 *
 * Colours are bound to the platform's own brand tokens where they exist, with a
 * hard fallback so the page never depends on the active homepage template.
 */

.dsup-hero,
.dsup-section,
.dsup-cta {
    /* Adopts whichever homepage template is active: salla exposes
       --salla-primary, the v2 landing exposes --brand-700. */
    --dsup-brand: var(--salla-primary, var(--brand-700, #5c1399));
    --dsup-brand-soft: var(--salla-bg, var(--brand-50, #f5eefc));
    --dsup-ink: #0f172a;
    --dsup-muted: #64748b;
    --dsup-line: #e2e8f0;
    --dsup-surface: #ffffff;
    --dsup-alt: #f8fafc;
}

@media (prefers-color-scheme: dark) {
    .dsup-hero,
    .dsup-section,
    .dsup-cta {
        --dsup-ink: #f1f5f9;
        --dsup-muted: #94a3b8;
        --dsup-line: #27303f;
        --dsup-surface: #111827;
        --dsup-alt: #0b1220;
    }
}

.dsup-hero {
    background:
        radial-gradient(1000px 420px at 85% -10%, color-mix(in srgb, var(--dsup-brand) 16%, transparent), transparent 70%),
        var(--dsup-alt);
    color: var(--dsup-ink);
}

.dsup-eyebrow {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--dsup-brand) 12%, transparent);
    color: var(--dsup-brand);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dsup-h1 {
    margin-top: 1.25rem;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--dsup-ink);
    letter-spacing: -0.02em;
}

.dsup-lead {
    margin-top: 1.25rem;
    max-width: 34rem;
    font-size: 1.075rem;
    line-height: 1.7;
    color: var(--dsup-muted);
}

.dsup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: 0.9rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dsup-btn:hover { transform: translateY(-1px); }

.dsup-btn-primary {
    background: var(--dsup-brand);
    color: #fff;
    box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--dsup-brand) 80%, transparent);
}

.dsup-btn-ghost {
    background: transparent;
    color: var(--dsup-brand);
    border: 1px solid color-mix(in srgb, var(--dsup-brand) 35%, transparent);
}

.dsup-btn-light { background: #fff; color: var(--dsup-brand); }

.dsup-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--dsup-line);
}

.dsup-stats dt { font-size: 0.8rem; color: var(--dsup-muted); }
.dsup-stats dd { margin: 0.2rem 0 0; font-size: 1.6rem; font-weight: 800; color: var(--dsup-ink); }

.dsup-card {
    background: var(--dsup-surface);
    border: 1px solid var(--dsup-line);
    border-radius: 1.5rem;
    padding: 1.75rem;
    box-shadow: 0 24px 60px -40px rgba(15, 23, 42, 0.45);
}

.dsup-card-title { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--dsup-ink); }
.dsup-card-sub { margin: 0.4rem 0 1.5rem; font-size: 0.9rem; color: var(--dsup-muted); }

.dsup-field { margin-bottom: 1.15rem; }

.dsup-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dsup-muted);
    margin-bottom: 0.45rem;
}

.dsup-field input[type="number"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--dsup-line);
    border-radius: 0.75rem;
    background: var(--dsup-alt);
    color: var(--dsup-ink);
    font-size: 1rem;
    font-weight: 600;
}

.dsup-field input[type="range"] { width: 100%; accent-color: var(--dsup-brand); }

.dsup-field output {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dsup-brand);
}

.dsup-breakdown {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 1.25rem 0 0;
    border-top: 1px dashed var(--dsup-line);
}

.dsup-breakdown li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 0.92rem;
    color: var(--dsup-muted);
}

.dsup-breakdown li b { color: var(--dsup-ink); font-weight: 700; }

.dsup-breakdown-total {
    margin-top: 0.5rem;
    padding-top: 0.9rem !important;
    border-top: 1px solid var(--dsup-line);
    font-size: 1rem !important;
}

.dsup-breakdown-total b { color: var(--dsup-brand) !important; font-size: 1.35rem; }

.dsup-fineprint { margin: 1rem 0 0; font-size: 0.75rem; color: var(--dsup-muted); }

.dsup-section { padding: 4.5rem 0; background: var(--dsup-surface); color: var(--dsup-ink); }
.dsup-section-alt { background: var(--dsup-alt); }

.dsup-h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--dsup-ink);
    margin: 0;
}

.dsup-section-sub { margin: 0.75rem 0 0; color: var(--dsup-muted); max-width: 42rem; }

.dsup-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: dsup;
}

.dsup-steps li {
    position: relative;
    padding: 1.5rem;
    border: 1px solid var(--dsup-line);
    border-radius: 1.25rem;
    background: var(--dsup-alt);
}

.dsup-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.75rem;
    background: var(--dsup-brand);
    color: #fff;
    font-weight: 800;
}

.dsup-steps h3 { margin: 0.9rem 0 0.4rem; font-size: 1.05rem; font-weight: 700; }
.dsup-steps p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: var(--dsup-muted); }

/* Problem → solution cards: the pain the reader already knows, then the fix. */
.dsup-problems {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.dsup-problem {
    padding: 1.5rem;
    border: 1px solid var(--dsup-line);
    border-radius: 1.25rem;
    background: var(--dsup-alt);
}

.dsup-problem h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dsup-ink);
}

.dsup-problem p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    padding-inline-start: 0.9rem;
    border-inline-start: 3px solid transparent;
}

.dsup-problem p + p { margin-top: 0.9rem; }

.dsup-problem p span {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.dsup-pain {
    border-inline-start-color: #f43f5e !important;
    color: var(--dsup-muted);
}

.dsup-pain span { color: #f43f5e; }

.dsup-fix {
    border-inline-start-color: #10b981 !important;
    color: var(--dsup-ink);
    font-weight: 500;
}

.dsup-fix span { color: #10b981; }

.dsup-terms { margin-top: 2rem; }
.dsup-terms dl { margin: 0; display: grid; gap: 0; }

.dsup-terms dl > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--dsup-line);
}

.dsup-terms dl > div:last-child { border-bottom: 0; }
.dsup-terms dt { color: var(--dsup-muted); font-size: 0.92rem; }
.dsup-terms dd { margin: 0; font-weight: 700; color: var(--dsup-ink); text-align: end; }
.dsup-note { display: block; font-weight: 500; font-size: 0.8rem; color: var(--dsup-muted); }

.dsup-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.dsup-cat {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--dsup-line);
    border-radius: 1.25rem;
    background: var(--dsup-alt);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.dsup-cat:hover { border-color: var(--dsup-brand); transform: translateY(-2px); }
.dsup-cat h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--dsup-ink); }
.dsup-cat p { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--dsup-muted); line-height: 1.6; }
.dsup-cat span { display: block; margin-top: 0.9rem; font-size: 0.8rem; font-weight: 700; color: var(--dsup-brand); }

.dsup-suppliers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 2.5rem;
}

.dsup-supplier {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--dsup-line);
    border-radius: 1rem;
    background: var(--dsup-surface);
}

.dsup-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    flex: none;
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--dsup-brand) 14%, transparent);
    color: var(--dsup-brand);
    font-weight: 800;
    text-transform: uppercase;
}

.dsup-supplier b { display: block; color: var(--dsup-ink); font-size: 0.95rem; }
.dsup-supplier span { font-size: 0.8rem; color: var(--dsup-muted); }

.dsup-faq { margin-top: 2rem; }

.dsup-faq details {
    border-bottom: 1px solid var(--dsup-line);
    padding: 1.1rem 0;
}

.dsup-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--dsup-ink);
    list-style: none;
}

.dsup-faq summary::-webkit-details-marker { display: none; }
.dsup-faq summary::after { content: '+'; float: inline-end; color: var(--dsup-brand); font-size: 1.25rem; line-height: 1; }
.dsup-faq details[open] summary::after { content: '−'; }
.dsup-faq p { margin: 0.75rem 0 0; color: var(--dsup-muted); line-height: 1.7; }

.dsup-cta {
    padding: 4rem 0;
    background: var(--dsup-brand);
    color: #fff;
}

.dsup-cta h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.dsup-cta p { margin: 0.75rem 0 1.75rem; opacity: 0.85; }

.dsup-join {
    display: grid;
    gap: 1.75rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .dsup-join { grid-template-columns: minmax(0, 1fr) 20rem; }
    .dsup-join aside { position: sticky; top: 6rem; }
}
