/**
 * SG corporate site — marketing pages + portal workspace.
 * Loaded after Astra's parent styles.
 */

:root {
    --sg-bg: #ffffff;
    --sg-ink: #0f172a;
    --sg-muted: #5b6b84;
    --sg-line: #e5eaf2;
    --sg-soft: #f6f8fc;
    --sg-brand: #2563eb;
    --sg-brand-2: #0ea5e9;
    --sg-dark: #0b1220;
    --sg-radius: 18px;
    --sg-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--sg-ink);
    background: var(--sg-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--sg-brand);
}

.sg-container {
    width: min(1160px, calc(100% - 3rem));
    margin-inline: auto;
}

.sg-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 0.6rem 1rem;
    background: var(--sg-ink);
    color: #fff;
    border-radius: 0 0 8px 0;
}

.sg-skip:focus {
    left: 0;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.sg-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sg-line);
}

body.admin-bar .sg-header {
    top: 32px;
}

.sg-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 72px;
}

.sg-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--sg-ink);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.sg-brand:hover {
    color: var(--sg-ink);
}

.sg-brand img {
    max-height: 40px;
    width: auto;
}

.sg-brand__mark {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
}

.sg-brand__text {
    font-size: 1.05rem;
}

.sg-nav {
    margin-left: auto;
}

.sg-nav__list {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sg-nav__list a {
    color: var(--sg-ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.sg-nav__list a:hover {
    color: var(--sg-brand);
}

.sg-header__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.sg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.sg-btn--primary {
    background: var(--sg-brand);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.sg-btn--primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.sg-btn--ghost {
    background: transparent;
    border-color: var(--sg-line);
    color: var(--sg-ink);
}

.sg-btn--ghost:hover {
    border-color: #cbd5e1;
    color: var(--sg-ink);
}

.sg-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--sg-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.sg-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--sg-ink);
    border-radius: 2px;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.sg-hero {
    padding: 5.5rem 0 4.5rem;
    background:
        radial-gradient(1100px 520px at 82% -12%, rgba(37, 99, 235, 0.18), transparent 62%),
        radial-gradient(700px 420px at 8% 110%, rgba(14, 165, 233, 0.10), transparent 60%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.sg-hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
}

.sg-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sg-brand);
}

.sg-hero h1 {
    margin: 0 0 1.2rem;
    font-size: clamp(2.4rem, 4.6vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.sg-lead {
    max-width: 34rem;
    margin: 0;
    font-size: 1.12rem;
    color: var(--sg-muted);
}

.sg-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1.8rem 0 1.4rem;
}

.sg-hero__points {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--sg-muted);
    font-size: 0.9rem;
}

.sg-hero__points li::before {
    content: "✓";
    margin-right: 0.4rem;
    color: var(--sg-brand);
    font-weight: 800;
}

.sg-hero__visual img {
    width: 100%;
    border: 1px solid var(--sg-line);
    border-radius: 22px;
    box-shadow: var(--sg-shadow);
}

/* ── Sections ───────────────────────────────────────────────────────── */

.sg-section {
    padding: 5rem 0;
}

.sg-section--alt {
    background: var(--sg-soft);
}

.sg-section__head {
    max-width: 720px;
    margin: 0 auto 2.6rem;
    text-align: center;
}

.sg-section__head h2 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    letter-spacing: -0.02em;
}

.sg-section__head p {
    margin: 0;
    color: var(--sg-muted);
}

.sg-cards {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 1.2rem;
}

.sg-card {
    padding: 1.6rem;
    background: #fff;
    border: 1px solid var(--sg-line);
    border-radius: var(--sg-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sg-card--feature {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.sg-card--feature img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.sg-card__body {
    padding: 1.4rem 1.5rem 1.6rem;
}

.sg-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.sg-card p {
    margin: 0 0 1rem;
    color: var(--sg-muted);
}

.sg-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.10);
    color: var(--sg-brand);
    font-size: 1.2rem;
}

.sg-link {
    color: var(--sg-brand);
    font-weight: 700;
    text-decoration: none;
}

.sg-link:hover {
    text-decoration: underline;
}

.sg-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.sg-feature {
    padding: 1.4rem;
    background: #fff;
    border: 1px solid var(--sg-line);
    border-radius: 14px;
}

.sg-feature h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.sg-feature p {
    margin: 0;
    color: var(--sg-muted);
    font-size: 0.92rem;
}

/* ── CTA ────────────────────────────────────────────────────────────── */

.sg-cta {
    background: linear-gradient(135deg, #0b1220 0%, #12224a 55%, #1d4ed8 100%);
    color: #fff;
}

.sg-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.sg-cta h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.sg-cta p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

.sg-cta .sg-btn--primary {
    background: #fff;
    color: #12224a;
    box-shadow: none;
}

.sg-cta .sg-btn--primary:hover {
    background: #eef4ff;
    color: #12224a;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.sg-footer {
    padding: 3.5rem 0 1.5rem;
    background: var(--sg-dark);
    color: #cbd5e1;
}

.sg-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 2rem;
}

.sg-footer h3 {
    margin: 0 0 0.8rem;
    color: #fff;
    font-size: 0.95rem;
}

.sg-footer a {
    display: block;
    margin: 0.35rem 0;
    color: #cbd5e1;
    font-size: 0.92rem;
    text-decoration: none;
}

.sg-footer a:hover {
    color: #fff;
}

.sg-footer p {
    margin: 0.35rem 0;
    font-size: 0.92rem;
}

.sg-footer__brand .sg-brand__text {
    margin-bottom: 0.6rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.sg-muted {
    color: #94a3b8;
}

.sg-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    font-size: 0.82rem;
}

.sg-footer__legal a {
    display: inline;
    margin: 0;
    color: #94a3b8;
}

/* ── Inner pages ────────────────────────────────────────────────────── */

.sg-page-hero {
    padding: 4rem 0 3rem;
    background: linear-gradient(180deg, #f6f9ff 0%, #fff 100%);
    border-bottom: 1px solid var(--sg-line);
}

.sg-page-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.sg-page-hero p {
    max-width: 720px;
    margin: 1rem 0 0;
    color: var(--sg-muted);
}

.sg-prose {
    max-width: 860px;
}

.sg-prose h2 {
    margin: 2.2rem 0 0.8rem;
    font-size: 1.6rem;
}

.sg-prose h3 {
    margin: 1.6rem 0 0.6rem;
    font-size: 1.2rem;
}

.sg-prose p,
.sg-prose li {
    color: #334155;
}

.sg-prose img {
    border-radius: 14px;
}

.sg-prose ul {
    padding-left: 1.2rem;
}

.sg-prose .sg-page-hero,
.sg-prose .sg-section {
    max-width: none;
}

/* ── Contact ────────────────────────────────────────────────────────── */

.sg-contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    align-items: start;
}

.sg-contact-list {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.sg-contact-list li {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: #fff;
    border: 1px solid var(--sg-line);
    border-radius: 12px;
}

.sg-contact-list__label {
    min-width: 3rem;
    color: var(--sg-muted);
    font-size: 0.9rem;
}

.sg-contact-list a {
    color: var(--sg-ink);
    font-weight: 600;
    text-decoration: none;
}

.sg-form {
    padding: 1.8rem;
    background: #fff;
    border: 1px solid var(--sg-line);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.sg-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sg-field {
    display: block;
    margin-bottom: 1rem;
}

.sg-field span {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.sg-field input,
.sg-field textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--sg-line);
    border-radius: 10px;
    background: #fff;
    color: var(--sg-ink);
    font: inherit;
}

.sg-field input:focus,
.sg-field textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: var(--sg-brand);
}

.sg-form__hint {
    margin: 0.8rem 0 0;
    color: var(--sg-muted);
    font-size: 0.8rem;
}

.sg-form__ok {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    background: #ecfdf5;
    color: #065f46;
}

/* ── Portal workspace ───────────────────────────────────────────────── */

.sg-portal-body {
    margin: 0;
    overflow: hidden;
    background: var(--sg-dark);
}

.sg-portal {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

body.admin-bar .sg-portal {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

.sg-portal__side {
    display: flex;
    flex: 0 0 76px;
    flex-direction: column;
    align-items: center;
    width: 76px;
    padding: 1rem 0.6rem;
    background: var(--sg-dark);
    border-right: 1px solid rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.sg-portal__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 0.9rem;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
}

.sg-portal__brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.sg-portal__brand .dashicons {
    width: 26px;
    height: 26px;
    font-size: 26px;
}

.sg-portal__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.3rem;
}

.sg-portal__nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
}

.sg-portal__nav a:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #fff;
}

.sg-portal__nav a.is-active {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.sg-portal__nav .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.sg-portal__ext {
    position: absolute;
    top: 3px;
    right: 4px;
    margin: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1;
}

.sg-portal__foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.3rem;
    margin-top: auto;
    padding: 0.8rem 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.sg-portal__foot a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
}

.sg-portal__foot a:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #fff;
}

.sg-portal__foot .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.sg-portal__main {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #0f172a;
}

.sg-portal__frame {
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
    background: #0f172a;
}

.sg-portal__frame.is-active {
    display: block;
}

.sg-portal__empty {
    padding: 2rem;
    color: #cbd5e1;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .sg-hero__inner {
        grid-template-columns: 1fr;
    }

    .sg-cards {
        grid-template-columns: 1fr 1fr;
    }

    .sg-card--feature {
        grid-column: 1 / -1;
    }

    .sg-features {
        grid-template-columns: 1fr 1fr;
    }

    .sg-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 820px) {
    .sg-header__inner {
        position: relative;
    }

    .sg-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        padding: 1rem 1.5rem;
        background: #fff;
        border-bottom: 1px solid var(--sg-line);
        box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
    }

    .sg-nav.is-open {
        display: block;
    }

    .sg-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .sg-nav-toggle {
        display: inline-flex;
    }

    .sg-hide-sm {
        display: none;
    }

    .sg-contact-grid {
        grid-template-columns: 1fr;
    }

    .sg-portal {
        flex-direction: column;
    }

    .sg-portal__side {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding: 0.4rem 0.6rem;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    }

    .sg-portal__brand {
        margin: 0 0.4rem 0 0;
    }

    .sg-portal__nav {
        flex-direction: row;
        width: auto;
        gap: 0.2rem;
    }

    .sg-portal__nav a {
        width: 40px;
        height: 40px;
    }

    .sg-portal__foot {
        flex-direction: row;
        width: auto;
        gap: 0.2rem;
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
    }

    .sg-portal__foot a {
        width: 40px;
        height: 40px;
    }

    .sg-portal__foot a:first-child {
        display: none;
    }

    .sg-portal__main {
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .sg-header {
        top: 46px;
    }

    body.admin-bar .sg-portal {
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

@media (max-width: 640px) {
    .sg-container {
        width: min(100% - 2rem, 1160px);
    }

    .sg-hero {
        padding: 3.5rem 0 3rem;
    }

    .sg-hero__points {
        flex-direction: column;
        gap: 0.4rem;
    }

    .sg-cards,
    .sg-features,
    .sg-footer__grid {
        grid-template-columns: 1fr;
    }

    .sg-form__row {
        grid-template-columns: 1fr;
    }

    .sg-cta__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .sg-page-hero {
        padding: 2.5rem 0 2rem;
    }

    .sg-prose {
        padding: 2rem 0 3rem;
    }
}
