/*
 * Pages built from the Sugarcoat.tech Design canvas.
 *
 * The canvas styles every element inline. Inside .dc-page, everything else the
 * older site stylesheets set (reset, base, readability, light theme) is rolled
 * back to the browser defaults, so each page renders exactly as on the canvas.
 * :not(#_) lifts specificity above the older stylesheets without !important.
 * SVG keeps its presentation attributes; the animated Book a Demo button and
 * the Gravity Stars canvas keep their own styles.
 */

/* The page root starts from browser defaults too (line height, size, weight),
   not what the site's body sets; its inline style adds the canvas font. */
.dc-page:not(#_) {
    all: initial;
    display: block;
}

.dc-page :not(#_):not(svg, svg *, canvas, .anti-metal-button, .anti-metal-button *) {
    all: revert;
}

/* Canvas page basics (the canvas's <helmet> rules). */
.dc-page a:not(#_) {
    color: #3f5ec2;
}

.dc-page a:not(#_):hover {
    color: #2c4699;
}

.dc-page input:not(#_),
.dc-page select:not(#_),
.dc-page textarea:not(#_),
.dc-page button:not(#_) {
    font-family: inherit;
}

.dc-page summary:not(#_) {
    cursor: pointer;
}

.dc-page img:not(#_) {
    max-width: 100%;
}

.dc-page :not(#_):focus-visible {
    outline: 2px solid #3f5ec2;
    outline-offset: 3px;
}

/* Indigo beam around the Sugarcoat OS cards. */
@property --sc-a {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: true;
}

@keyframes sc-spin {
    to {
        --sc-a: 360deg;
    }
}

.dc-page .sc-beam:not(#_) {
    position: relative;
    isolation: isolate;
    animation: sc-spin 3.3s linear infinite;
}

.dc-page .sc-beam:not(#_)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 2px;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from var(--sc-a), transparent 0deg 28deg, rgba(219, 230, 246, 0.2) 46deg, rgba(154, 176, 229, 0.9) 64deg, #3f5ec2 80deg, rgba(106, 124, 205, 0.92) 96deg, transparent 124deg 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

/* The older card styles share these class names; the canvas look wins. */
.dc-page .feature-card:not(#_)::after {
    content: none;
}

/* Hero: animated Gravity Stars in place of the canvas's static star dots. */
.dc-page .sc-hero__stars:not(#_) {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
    .dc-page .sc-beam:not(#_) {
        animation: none;
    }
}

/* Phones: the app mock-ups drop their sidebar; KPIs go two across. */
@media (max-width: 640px) {
    .dc-page .sc-app-side:not(#_) {
        display: none !important;
    }

    .dc-page .sc-app-kpis:not(#_) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .dc-page .sc-orbit:not(#_) {
        min-height: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dc-page .sc-orbit:not(#_) > * {
        position: static !important;
        transform: none !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .dc-page .sc-orbit:not(#_) > div {
        grid-column: 1 / -1;
        height: auto !important;
        padding: 28px 0;
    }
}

/* Contact form: the real Django fields, drawn like the canvas inputs. */
.dc-page .dc-field input:not(#_),
.dc-page .dc-field select:not(#_),
.dc-page .dc-field textarea:not(#_) {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    background: #ffffff;
    color: #000000;
    font-size: 15px;
}

.dc-page .dc-field textarea:not(#_) {
    padding: 12px 14px;
    resize: vertical;
}

.dc-page .dc-field input:not(#_):focus,
.dc-page .dc-field select:not(#_):focus,
.dc-page .dc-field textarea:not(#_):focus {
    border-color: #3f5ec2;
    outline: 3px solid rgba(63, 94, 194, 0.18);
    outline-offset: 0;
}

.dc-page .dc-field__error:not(#_) {
    color: #a62c26;
    font-size: 13px;
}

/* Site chrome around canvas pages: the header sits in the page flow like the
   canvas header (82px, light glass), so sections start right below it. */
html.light .navbar {
    position: sticky;
    top: 0;
}

/* Header to match the canvas: plain "Sign In" text link, canvas glass and border. */
html.light .navbar {
    border-bottom: 1px solid rgba(63, 94, 194, 0.24);
    background: rgba(250, 250, 250, 0.92);
}

html.light .navbar__actions .button--ghost {
    min-height: 0;
    padding: 12px 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #181818;
    font-size: 14px;
    font-weight: 400;
}

html.light .navbar__actions .button--ghost:hover {
    color: #3f5ec2;
}

/* FAQ: the whole row is the tap target (44px+), not just the 23px text line.
   The padding moves from <details> to <summary>, so it looks the same. */
.dc-page details:not(#_) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.dc-page details:not(#_) > summary:not(#_):not(#_) {
    padding: 22px 0;
}

.dc-page details:not(#_)[open] > :last-child:not(#_):not(#_) {
    padding-bottom: 22px;
}
