/*==========================================
  Desiwood — legal document pages (privacy-policy.blade.php and
  terms-and-conditions.blade.php in resources/views/frontend/pages;
  behaviour in public/frontend/js/dw-legal.js).

  Every rule is scoped to .dw-legal and shares the visual language of the
  other redesigned pages: Inter, dark glass surfaces, orange-to-pink accents,
  and the header's container edges. The document is set for long-form
  reading: a comfortable line length, generous spacing, and a sticky
  "On this page" list that follows the reader.
==========================================*/

.dw-legal {
    --dl2-card: rgba(255, 255, 255, .035);
    --dl2-line: rgba(255, 255, 255, .1);
    --dl2-line-strong: rgba(255, 255, 255, .2);
    --dl2-text: #fff;
    --dl2-body: #cfc9d9;
    --dl2-muted: #a9a3b8;
    --dl2-accent: #ff8a00;
    --dl2-accent-2: #ff006e;
    --dl2-gradient: linear-gradient(90deg, var(--dl2-accent) 0%, var(--dl2-accent-2) 100%);
    --dl2-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dl2-fast: .2s;
    position: relative;
    isolation: isolate;
    font-family: "Inter", var(--default-font, "Poppins"), sans-serif;
    color: var(--dl2-text);
}

.dw-legal a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #0b0712, 0 0 0 4px rgba(255, 138, 0, .9);
}

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

.dw-legal__hero {
    position: relative;
    /* Clears the fixed site header (88px). */
    padding: 150px 0 48px;
    text-align: center;
}

.dw-legal__hero::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 50%;
    z-index: -1;
    width: min(1100px, 130vw);
    height: 520px;
    transform: translateX(-50%);
    background:
        radial-gradient(36% 44% at 50% 35%, rgba(170, 40, 220, .28), transparent 70%),
        radial-gradient(34% 44% at 30% 60%, rgba(255, 120, 0, .12), transparent 70%),
        radial-gradient(36% 46% at 72% 60%, rgba(255, 0, 110, .14), transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

.dw-legal__eyebrow {
    margin: 0 0 16px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2em;
    line-height: 1;
    text-transform: uppercase;
    color: #ff9d3d;
}

.dw-legal__title {
    margin: 0;
    font-family: inherit;
    font-size: clamp(40px, 5.6vw, 64px);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: 1.04;
    color: var(--dl2-text);
}

.dw-legal__title span {
    background: var(--dl2-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dw-legal__updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 0;
    padding: 8px 16px;
    border: 1px solid var(--dl2-line);
    border-radius: 99px;
    background: rgba(255, 255, 255, .04);
    font-size: 13.5px;
    font-weight: 500;
    color: #ddd8e6;
}

.dw-legal__updated i {
    color: #ffb36b;
}

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

.dw-legal__main {
    padding: 16px 0 110px;
}

.dw-legal__layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

/* ---------- Contents ---------- */

.dw-legal__aside {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 120px);
}

.dw-legal__toc {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.dw-legal__toc-label {
    margin: 0 0 10px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7f7890;
}

.dw-legal__toc ol {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dw-legal__toc a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 10px 10px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #a9a3b8;
    text-decoration: none;
    transition: color var(--dl2-fast) var(--dl2-ease), background-color var(--dl2-fast) var(--dl2-ease), border-color var(--dl2-fast) var(--dl2-ease);
}

.dw-legal__toc a:hover {
    background: rgba(255, 255, 255, .04);
    color: #fff;
}

.dw-legal__toc a.is-current {
    border-left-color: var(--dl2-accent);
    background: linear-gradient(90deg, rgba(255, 138, 0, .12), transparent);
    color: #fff;
}

.dw-legal__toc-num {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #6f6880;
}

.dw-legal__toc a.is-current .dw-legal__toc-num {
    color: #ffb36b;
}

.dw-legal__help {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 138, 0, .22);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 138, 0, .1), rgba(255, 0, 110, .08));
    color: #fff;
    text-decoration: none;
    transition: border-color var(--dl2-fast) var(--dl2-ease);
}

.dw-legal__help:hover {
    border-color: rgba(255, 138, 0, .5);
    color: #fff;
}

.dw-legal__help i {
    font-size: 22px;
    color: #ffb36b;
}

.dw-legal__help strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.dw-legal__help strong + span {
    display: block;
    font-size: 13px;
    color: var(--dl2-muted);
}

/* ---------- Document ---------- */

.dw-legal__doc {
    padding: clamp(28px, 4vw, 56px);
    border: 1px solid var(--dl2-line);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015) 30%), #120b1c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    font-size: 16px;
    line-height: 1.75;
    color: var(--dl2-body);
}

.dw-legal__doc p {
    margin: 0 0 14px;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.dw-legal__doc a {
    color: #ffb36b;
    text-decoration: underline;
    text-decoration-color: rgba(255, 179, 107, .4);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.dw-legal__doc a:hover {
    color: #fff;
}

.dw-legal__intro {
    max-width: 760px;
    margin-bottom: 8px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--dl2-line);
    font-size: 17.5px;
    color: #e6e1ee;
}

.dw-legal__section {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px 20px;
    padding: 36px 0;
    /* "On this page" links land below the fixed header. */
    scroll-margin-top: 100px;
}

.dw-legal__section + .dw-legal__section {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.dw-legal__section:last-child {
    padding-bottom: 0;
}

.dw-legal__num {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 138, 0, .3);
    border-radius: 13px;
    background: linear-gradient(160deg, rgba(255, 138, 0, .14), rgba(255, 0, 110, .12));
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #ffc58f;
}

.dw-legal__content {
    min-width: 0;
    max-width: 760px;
}

.dw-legal__content h2 {
    margin: 6px 0 16px;
    font-family: inherit;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.25;
    color: var(--dl2-text);
}

.dw-legal__content h2 span {
    background: var(--dl2-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dw-legal__content h3 {
    margin: 0 0 10px;
    font-family: inherit;
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--dl2-text);
}

.dw-legal__doc ul {
    margin: 0 0 14px;
    padding-left: 22px;
}

.dw-legal__doc li {
    margin-bottom: 6px;
    padding-left: 4px;
    font-size: inherit;
    line-height: 1.65;
    color: inherit;
    list-style: disc;
}

.dw-legal__doc li::marker {
    color: #ff9d3d;
}

.dw-legal__card {
    margin: 0 0 12px;
    padding: 20px 22px;
    border: 1px solid var(--dl2-line);
    border-radius: 16px;
    background: var(--dl2-card);
}

.dw-legal__card ul,
.dw-legal__card p:last-child {
    margin-bottom: 0;
}

.dw-legal__contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 138, 0, .25);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 138, 0, .1), rgba(255, 0, 110, .08));
}

.dw-legal__contact strong {
    font-size: 17px;
    color: #fff;
}

/* A short list of terms shown as chips (e.g. the metadata fields). */
.dw-legal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 16px;
}

.dw-legal__chips > div {
    padding: 6px 13px;
    border: 1px solid var(--dl2-line);
    border-radius: 99px;
    background: rgba(255, 255, 255, .04);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: #e6e1ee;
}

/* An important limitation, set apart from the running text. */
.dw-legal__highlight {
    margin: 4px 0 16px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 176, 32, .3);
    border-left: 3px solid #ffb020;
    border-radius: 14px;
    background: rgba(255, 176, 32, .06);
}

.dw-legal__highlight strong {
    display: block;
    margin-bottom: 10px;
    color: #ffd99a;
}

.dw-legal__highlight ul {
    margin-bottom: 0;
}

/* A policy callout with an icon (e.g. the AI-generated content policy). */
.dw-legal__callout {
    display: flex;
    gap: 18px;
    margin: 8px 0 16px;
    padding: 24px;
    border: 1px solid rgba(255, 138, 0, .25);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 138, 0, .08), rgba(255, 0, 110, .07));
}

.dw-legal__callout-icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--dl2-gradient);
    font-size: 24px;
    color: #fff;
}

.dw-legal__callout > div:last-child {
    min-width: 0;
}

.dw-legal__callout p:last-child,
.dw-legal__callout ul:last-child {
    margin-bottom: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .dw-legal__hero {
        padding: 124px 0 36px;
    }

    .dw-legal__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    /* Contents become a collapsed card above the document. */
    .dw-legal__aside {
        position: static;
        max-height: none;
    }

    .dw-legal__toc {
        padding: 16px 8px;
        border: 1px solid var(--dl2-line);
        border-radius: 18px;
        background: var(--dl2-card);
    }

    .dw-legal__toc ol {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .dw-legal__hero {
        padding: 112px 0 28px;
    }

    .dw-legal__toc ol {
        grid-template-columns: minmax(0, 1fr);
    }

    .dw-legal__doc {
        border-radius: 20px;
        font-size: 15.5px;
    }

    .dw-legal__intro {
        font-size: 16.5px;
    }

    .dw-legal__section {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 0;
    }

    .dw-legal__num {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .dw-legal__card {
        padding: 16px 18px;
    }

    .dw-legal__callout {
        flex-direction: column;
        padding: 20px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .dw-legal *,
    .dw-legal *::before,
    .dw-legal *::after {
        transition-duration: 0s !important;
    }
}
