:root {
    --ink: #0c1614;
    --ink-soft: #1a2e29;
    --mist: #e7f0ed;
    --mist-deep: #d3e4df;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #f4faf8;
    --teal: #0f766e;
    --teal-bright: #14b8a6;
    --teal-glow: rgba(20, 184, 166, 0.35);
    --line: rgba(12, 22, 20, 0.12);
    --muted: #5a726c;
    --danger: #c2410c;
    --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.sgr-shell {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--mist);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.sgr-atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(20, 184, 166, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 15%, rgba(15, 118, 110, 0.14), transparent 50%),
        radial-gradient(ellipse 60% 40% at 70% 80%, rgba(26, 46, 41, 0.08), transparent 55%),
        linear-gradient(165deg, #f2f8f6 0%, #ddeae6 45%, #c9ddd7 100%);
    animation: atmosphereShift 18s ease-in-out infinite alternate;
}

.sgr-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(12, 22, 20, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 22, 20, 0.04) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
    opacity: 0.55;
}

@keyframes atmosphereShift {
    from {
        filter: hue-rotate(0deg) saturate(1);
    }
    to {
        filter: hue-rotate(-8deg) saturate(1.08);
    }
}

.sgr-nav {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}

.sgr-nav-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.sgr-nav-mark span {
    color: var(--teal);
}

.sgr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 0.85rem 1.35rem;
    transition: transform 0.35s var(--ease-out), background 0.25s ease, box-shadow 0.35s var(--ease-out);
}

.sgr-btn-primary {
    background: var(--ink);
    color: #f4faf8;
}

.sgr-btn-primary:hover {
    background: var(--ink-soft);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(12, 22, 20, 0.18);
    color: #f4faf8;
}

.sgr-btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.sgr-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
}

.sgr-btn-block {
    width: 100%;
}

.sgr-hero {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 4.5rem);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) 3rem;
}

@media (min-width: 960px) {
    .sgr-hero {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        padding-top: 0;
        padding-bottom: 2rem;
    }
}

.sgr-hero-copy {
    max-width: 34rem;
    animation: riseIn 0.9s var(--ease-out) both;
}

.sgr-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.75rem, 7vw, 4.75rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
    color: var(--ink);
}

.sgr-brand em {
    font-style: normal;
    color: var(--teal);
}

.sgr-headline {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin: 0 0 0.85rem;
    color: var(--ink-soft);
}

.sgr-lede {
    margin: 0 0 1.75rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--muted);
    max-width: 32rem;
}

.sgr-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: riseIn 1.05s var(--ease-out) 0.12s both;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3D scene — dominant visual */
.sgr-stage-wrap {
    position: relative;
    height: min(62vh, 520px);
    perspective: 1200px;
    animation: riseIn 1.1s var(--ease-out) 0.18s both;
}

.sgr-stage {
    position: absolute;
    inset: 8% 5% 5%;
    transform-style: preserve-3d;
    transform: rotateX(18deg) rotateY(-28deg);
    animation: stageFloat 9s ease-in-out infinite;
}

@keyframes stageFloat {
    0%,
    100% {
        transform: rotateX(18deg) rotateY(-28deg) translateY(0);
    }
    50% {
        transform: rotateX(14deg) rotateY(-22deg) translateY(-12px);
    }
}

.sgr-panel {
    position: absolute;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(231, 240, 237, 0.55));
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(12, 22, 20, 0.12);
    transform-style: preserve-3d;
}

.sgr-panel-advoware {
    width: 42%;
    height: 58%;
    left: 4%;
    top: 18%;
    transform: translateZ(40px);
    padding: 1rem 1.1rem;
}

.sgr-panel-ai {
    width: 38%;
    height: 48%;
    right: 6%;
    top: 8%;
    transform: translateZ(90px);
    background: linear-gradient(150deg, rgba(15, 118, 110, 0.92), rgba(20, 184, 166, 0.75));
    border-color: rgba(255, 255, 255, 0.25);
    color: #ecfdf9;
    padding: 1rem 1.1rem;
    animation: panelPulse 5.5s ease-in-out infinite;
}

.sgr-panel-out {
    width: 46%;
    height: 36%;
    right: 10%;
    bottom: 6%;
    transform: translateZ(20px);
    padding: 0.9rem 1rem;
}

@keyframes panelPulse {
    0%,
    100% {
        transform: translateZ(90px) translateY(0);
    }
    50% {
        transform: translateZ(105px) translateY(-8px);
    }
}

.sgr-panel-label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.55rem;
}

.sgr-panel-ai .sgr-panel-label {
    opacity: 0.85;
    color: #ccfbf1;
}

.sgr-panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem;
}

.sgr-panel-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--muted);
}

.sgr-panel-ai .sgr-panel-text {
    color: rgba(236, 253, 249, 0.88);
}

.sgr-beam {
    position: absolute;
    height: 2px;
    width: 28%;
    left: 36%;
    top: 42%;
    background: linear-gradient(90deg, transparent, var(--teal-bright), transparent);
    transform: translateZ(60px) rotateZ(-8deg);
    opacity: 0.85;
    animation: beamFlow 2.8s linear infinite;
}

.sgr-beam::before,
.sgr-beam::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal-bright);
    top: -3px;
    box-shadow: 0 0 12px var(--teal-glow);
    animation: beamDot 2.8s linear infinite;
}

.sgr-beam::after {
    animation-delay: 1.4s;
}

@keyframes beamFlow {
    from {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 0.35;
    }
}

@keyframes beamDot {
    from {
        left: 0%;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    to {
        left: 100%;
        opacity: 0;
    }
}

.sgr-lines {
    position: absolute;
    inset: 0;
    opacity: 0.35;
}

.sgr-lines span {
    display: block;
    height: 1px;
    background: rgba(12, 22, 20, 0.15);
    margin: 0.55rem 0;
    width: 70%;
}

.sgr-lines span:nth-child(2) {
    width: 55%;
}
.sgr-lines span:nth-child(3) {
    width: 80%;
}
.sgr-lines span:nth-child(4) {
    width: 40%;
}

.sgr-footer-strip {
    position: relative;
    z-index: 1;
    padding: 1rem clamp(1.25rem, 4vw, 3rem) 1.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Login page — centered card */
.sgr-login-body {
    min-height: 100vh;
}

.sgr-login-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.sgr-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.55;
    animation: loginOrbFloat 14s ease-in-out infinite alternate;
}

.sgr-login-orb-a {
    width: min(42vw, 380px);
    height: min(42vw, 380px);
    background: rgba(20, 184, 166, 0.28);
    top: -8%;
    left: -6%;
}

.sgr-login-orb-b {
    width: min(36vw, 320px);
    height: min(36vw, 320px);
    background: rgba(15, 118, 110, 0.22);
    bottom: -10%;
    right: -4%;
    animation-delay: -4s;
}

.sgr-login-orb-c {
    width: min(28vw, 240px);
    height: min(28vw, 240px);
    background: rgba(12, 22, 20, 0.08);
    top: 42%;
    left: 58%;
    animation-delay: -8s;
}

@keyframes loginOrbFloat {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(18px, -22px) scale(1.06);
    }
}

.sgr-login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.5rem) 1.25rem;
}

.sgr-login-stack {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
    animation: riseIn 0.75s var(--ease-out) both;
}

.sgr-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--ink);
    padding: 0.35rem 0.5rem;
    border-radius: 12px;
    transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}

.sgr-login-logo:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.sgr-login-logo:focus-visible {
    outline: 2px solid var(--teal-bright);
    outline-offset: 4px;
}

.sgr-login-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--ink) 0%, var(--ink-soft) 100%);
    color: #ecfdf9;
    box-shadow: 0 10px 24px rgba(12, 22, 20, 0.18);
}

.sgr-login-logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.sgr-login-logo-text em {
    font-style: normal;
    color: var(--teal);
}

.sgr-login-card {
    width: 100%;
    padding: clamp(1.65rem, 4vw, 2.15rem);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.88) 0%, rgba(244, 250, 248, 0.78) 100%);
    backdrop-filter: blur(18px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 24px 48px rgba(12, 22, 20, 0.1),
        0 8px 16px rgba(12, 22, 20, 0.04);
}

.sgr-login-card-head {
    margin-bottom: 1.4rem;
    text-align: center;
}

.sgr-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 auto 0.9rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--teal);
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.22);
}

.sgr-login-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal-bright);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
    animation: loginPulse 2s ease-in-out infinite;
}

@keyframes loginPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.85);
        opacity: 0.7;
    }
}

.sgr-login-title {
    margin: 0 0 0.45rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.55rem, 3.5vw, 1.85rem);
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.15;
}

.sgr-login-sub {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--muted);
}

.sgr-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sgr-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink-soft);
}

.sgr-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sgr-input-icon {
    position: absolute;
    left: 0.9rem;
    display: flex;
    color: var(--muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.sgr-input-wrap input {
    width: 100%;
    padding: 0.85rem 2.75rem 0.85rem 2.75rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.25s var(--ease-out), background 0.2s ease;
}

.sgr-input-wrap input::placeholder {
    color: #8aa39c;
}

.sgr-input-wrap input:hover {
    border-color: rgba(15, 118, 110, 0.35);
}

.sgr-input-wrap input:focus {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}

.sgr-input-wrap:focus-within .sgr-input-icon {
    color: var(--teal);
}

.sgr-input-wrap input.is-invalid {
    border-color: rgba(194, 65, 12, 0.55);
    box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.12);
}

.sgr-input-toggle {
    position: absolute;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.sgr-input-toggle:hover {
    color: var(--ink);
    background: rgba(12, 22, 20, 0.05);
}

.sgr-input-toggle .sgr-eye-closed {
    display: none;
}

.sgr-input-toggle.is-showing .sgr-eye-open {
    display: none;
}

.sgr-input-toggle.is-showing .sgr-eye-closed {
    display: block;
}

/* Avoid Edge/Chrome native duplicate eye */
.sgr-input-wrap input[type="password"]::-ms-reveal,
.sgr-input-wrap input[type="password"]::-ms-clear {
    display: none;
}

.sgr-field-error {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--danger);
}

.sgr-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -0.15rem;
}

.sgr-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.sgr-remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sgr-check {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sgr-check::after {
    content: "";
    width: 0.35rem;
    height: 0.6rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.18s var(--ease-out);
    margin-top: -1px;
}

.sgr-remember input:checked + .sgr-check {
    background: var(--teal);
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.sgr-remember input:checked + .sgr-check::after {
    transform: rotate(45deg) scale(1);
}

.sgr-remember input:focus-visible + .sgr-check {
    outline: 2px solid var(--teal-bright);
    outline-offset: 2px;
}

.sgr-btn-login {
    margin-top: 0.25rem;
    min-height: 3rem;
    position: relative;
    overflow: hidden;
    gap: 0.55rem;
}

.sgr-btn-login::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: none;
}

.sgr-btn-login:hover::before {
    animation: loginShine 0.85s var(--ease-out);
}

@keyframes loginShine {
    to {
        transform: translateX(120%);
    }
}

.sgr-btn-login.is-loading .sgr-btn-label {
    opacity: 0.7;
}

.sgr-btn-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(244, 250, 248, 0.35);
    border-top-color: #f4faf8;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

.sgr-login-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(12, 22, 20, 0.08);
    font-size: 0.75rem;
    color: var(--muted);
}

.sgr-login-secure svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.sgr-login-footer {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.sgr-user-block {
    text-align: center;
}

.sgr-avatar {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    color: #ecfdf9;
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-bright) 100%);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.sgr-user-block h2 {
    margin: 0 0 0.25rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sgr-user-block p {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.sgr-login-secondary-action {
    margin-top: 0.65rem;
}

.sgr-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    animation: riseIn 0.45s var(--ease-out) both;
}

.sgr-alert svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.sgr-alert-danger {
    color: #9a3412;
    background: rgba(254, 215, 170, 0.45);
    border: 1px solid rgba(194, 65, 12, 0.22);
}

.sgr-alert-success {
    color: #0f766e;
    background: rgba(204, 251, 241, 0.55);
    border: 1px solid rgba(20, 184, 166, 0.28);
}

.sgr-reveal {
    animation: riseIn 0.65s var(--ease-out) both;
    animation-delay: var(--delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
    .sgr-atmosphere,
    .sgr-stage,
    .sgr-panel-ai,
    .sgr-beam,
    .sgr-beam::before,
    .sgr-beam::after,
    .sgr-hero-copy,
    .sgr-cta-row,
    .sgr-stage-wrap,
    .sgr-login-orb,
    .sgr-login-badge-dot,
    .sgr-reveal,
    .sgr-btn-spinner,
    .sgr-alert {
        animation: none !important;
    }

    .sgr-btn-login::before {
        display: none;
    }
}
