@media (max-width: 767px) {
    html, body {
        width: 100%;
        min-height: 100%;
        overflow: hidden;
        background: #081522;
    }

    .sg-login-mobile {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(28px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
        overflow-y: auto;
        background:
            radial-gradient(circle at 50% 23%, rgba(0,110,255,.18), transparent 28%),
            linear-gradient(160deg, #081522 0%, #10263a 55%, #081522 100%);
    }

    .sg-login-mobile::before {
        content: "";
        position: absolute;
        top: -35%;
        left: -65%;
        width: 70%;
        height: 170%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent);
        transform: rotate(18deg);
        animation: sgLoginLightPass 900ms cubic-bezier(.2,.7,.2,1) 120ms both;
        pointer-events: none;
    }

    .sg-login-mobile .sg-login-logo {
        position: relative;
        z-index: 1;
        flex: 0 0 auto;
        width: 100%;
        margin: 0 0 34px;
        opacity: 0;
        transform: translateY(8px) scale(.985);
        animation: sgLoginReveal 480ms cubic-bezier(.2,.75,.25,1) 70ms forwards;
    }

    .sg-login-mobile .sg-login-logo > div {
        width: 100%;
        padding: 0 28px;
    }

    .sg-login-mobile .sg-login-logo .loginbrand {
        width: 100%;
        max-width: 340px;
        padding-bottom: 0;
        filter: drop-shadow(0 7px 16px rgba(0,110,255,.18));
    }

    .sg-login-mobile .sg-login-panel {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        width: 100%;
        margin: 0;
        padding: 24px 20px 20px;
        overflow: hidden;
        background: rgba(12,31,49,.78);
        border: 1px solid rgba(255,255,255,.11);
        border-radius: 20px;
        box-shadow: 0 22px 55px rgba(0,0,0,.28);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        opacity: 0;
        transform: translateY(16px);
        animation: sgLoginReveal 500ms cubic-bezier(.2,.75,.25,1) 170ms forwards;
    }

    .sg-login-mobile .sg-login-panel > .col-xs-12 {
        width: 100%;
        padding: 0;
    }

    .sg-login-mobile .sg-login-panel .error {
        min-height: 18px;
        margin: 0 0 8px;
        color: #ff6b74;
        font-size: 13px;
    }

    .sg-login-mobile .input-group {
        width: 100%;
        margin: 0 0 13px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        background: rgba(255,255,255,.06);
        transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    }

    .sg-login-mobile .input-group:focus-within {
        border-color: rgba(0,110,255,.85);
        background: rgba(255,255,255,.09);
        box-shadow: 0 0 0 3px rgba(0,110,255,.14);
    }

    .sg-login-mobile .input-group-addon,
    .sg-login-mobile .form-control {
        height: 50px !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .sg-login-mobile .input-group-addon {
        width: 48px;
        padding: 0;
        color: #4594ff;
        font-size: 17px;
        text-align: center;
    }

    .sg-login-mobile .form-control {
        padding-left: 4px;
        color: #fff;
        font-size: 16px;
    }

    .sg-login-mobile .form-control::placeholder {
        color: rgba(255,255,255,.48);
        opacity: 1;
    }

    .sg-login-mobile .sg-login-actions {
        display: grid;
        grid-template-areas: "primary" "apps";
        grid-template-columns: 1fr;
        gap: 18px;
        margin: 4px 0 0 !important;
    }

    .sg-login-mobile .sg-login-primary-actions {
        grid-area: primary;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 !important;
    }

    .sg-login-mobile .sg-login-primary-actions > a {
        order: 2;
        align-self: center;
        margin-top: 13px;
        color: rgba(255,255,255,.72) !important;
        font-size: 13px;
        text-decoration: none;
    }

    .sg-login-mobile .sg-login-primary-actions > br { display: none; }

    .sg-login-mobile .sg-login-submit {
        order: 1;
        position: relative;
        float: none !important;
        display: block !important;
        width: 100%;
        min-height: 48px;
        margin: 0 !important;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        background: linear-gradient(135deg, #0878ff, #005bd7);
        box-shadow: 0 12px 26px rgba(0,98,220,.28);
        font-size: 16px;
        font-weight: 600;
        letter-spacing: .01em;
        line-height: normal;
        transition: transform 150ms ease, box-shadow 180ms ease, opacity 180ms ease;
    }

    .sg-login-mobile .sg-login-submit:active:not(:disabled) {
        transform: scale(.985);
        box-shadow: 0 7px 18px rgba(0,98,220,.25);
    }

    .sg-login-mobile .sg-login-apps {
        grid-area: apps;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 0;
        padding: 15px 0 0;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    .sg-login-mobile .sg-login-apps:empty {
        display: none;
    }

    .sg-login-mobile .sg-login-apps a {
        display: inline-flex;
        margin: 0 5px;
        opacity: .58;
        transition: opacity 160ms ease;
    }

    .sg-login-mobile .sg-login-apps a:active { opacity: 1; }
    .sg-login-mobile .sg-login-apps img {
        width: 82px !important;
        height: auto !important;
        margin: 0 !important;
        filter: grayscale(.15);
    }

    .sg-login-mobile .sg-login-spinner {
        display: none;
        width: 20px;
        height: 20px;
        margin: 0 auto;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: sgLoginSpin 650ms linear infinite;
    }

    .sg-login-mobile.sg-login-submitting .sg-login-submit-label { display: none; }
    .sg-login-mobile.sg-login-submitting .sg-login-spinner { display: block; }
    .sg-login-mobile.sg-login-submitting .sg-login-submit { opacity: .82; }

    .sg-login-mobile.sg-login-has-error .sg-login-panel {
        animation: sgLoginReveal 360ms ease-out forwards, sgLoginError 320ms ease-out 390ms;
    }

    @keyframes sgLoginLightPass {
        from { left: -65%; }
        to { left: 115%; }
    }

    @keyframes sgLoginReveal {
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

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

    @keyframes sgLoginError {
        0%, 100% { transform: translateX(0); }
        30% { transform: translateX(-5px); }
        65% { transform: translateX(5px); }
    }
}

@media (max-width: 767px) and (max-height: 620px) {
    .sg-login-mobile { justify-content: flex-start; }
    .sg-login-mobile .sg-login-logo { margin-bottom: 20px; }
    .sg-login-mobile .sg-login-logo .loginbrand { max-width: 280px; }
    .sg-login-mobile .sg-login-panel { padding-top: 18px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .sg-login-mobile::before,
    .sg-login-mobile .sg-login-logo,
    .sg-login-mobile .sg-login-panel,
    .sg-login-mobile.sg-login-has-error .sg-login-panel {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
@media (min-width: 768px) {
    html, body {
        width: 100%;
        min-height: 100%;
        overflow: hidden;
        background: #081522;
    }

    .sg-login-mobile {
        position: fixed;
        inset: 0;
        width: 100%;
        min-height: 100vh;
        padding: 0;
        overflow: hidden;
        background:
            radial-gradient(circle at 27% 48%, rgba(0,110,255,.16), transparent 27%),
            linear-gradient(120deg, #081522 0%, #10263a 54.8%, #091725 55%, #07121d 100%);
    }

    .sg-login-mobile::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 55%;
        width: 1px;
        background: linear-gradient(to bottom, transparent 8%, rgba(255,255,255,.09) 50%, transparent 92%);
        pointer-events: none;
    }

    .sg-login-mobile::after {
        content: "";
        position: absolute;
        top: -55%;
        left: -30%;
        width: 22%;
        height: 210%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent);
        transform: rotate(18deg);
        animation: sgLoginDesktopLight 1100ms cubic-bezier(.2,.7,.2,1) 100ms both;
        pointer-events: none;
    }

    .sg-login-mobile .sg-login-logo {
        position: absolute;
        z-index: 1;
        top: 42%;
        left: 0;
        width: 55%;
        margin: 0;
        opacity: 0;
        transform: translateY(calc(-50% + 10px)) scale(.985);
        animation: sgLoginDesktopLogo 520ms cubic-bezier(.2,.75,.25,1) 80ms forwards;
    }

    .sg-login-mobile .sg-login-logo > div {
        width: 100%;
        padding: 0 9vw;
    }

    .sg-login-mobile .sg-login-logo .loginbrand {
        width: 100%;
        max-width: 610px;
        margin: auto !important;
        padding: 0;
        filter: drop-shadow(0 12px 25px rgba(0,110,255,.2));
    }

    .sg-login-mobile .sg-login-brand-signature {
        display: block;
        margin-top: 17px;
        color: rgba(196,210,224,.48);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .3em;
        text-align: center;
        text-transform: uppercase;
    }

    .sg-login-mobile #footer {
        position: absolute;
        z-index: 2;
        top: calc(42% + 295px);
        left: 0;
        width: 55%;
        margin: 0;
        opacity: 0;
        transform: translateY(7px);
        animation: sgLoginDesktopFooter 420ms ease-out 280ms forwards;
    }

    .sg-login-mobile #footer div {
        width: auto;
        margin: 0 auto;
        padding: 0;
        color: rgba(255,255,255,.68);
        text-align: center;
    }

    .sg-login-mobile .sg-login-panel {
        position: absolute;
        z-index: 2;
        top: 50%;
        right: 0;
        width: 45%;
        margin: 0;
        opacity: 0;
        transform: translate(22px, -50%);
        animation: sgLoginDesktopPanel 520ms cubic-bezier(.2,.75,.25,1) 170ms forwards;
    }

    .sg-login-mobile .sg-login-panel > .hidden-sm,
    .sg-login-mobile .sg-login-panel > .hidden-xs {
        display: none !important;
    }

    .sg-login-mobile .sg-login-panel > .col-xs-12 {
        position: relative;
        float: none;
        width: calc(100% - 80px);
        max-width: 430px;
        margin: 0 auto;
        padding: 32px 34px 28px;
        background: rgba(12,31,49,.72);
        border: 1px solid rgba(255,255,255,.11);
        border-radius: 20px;
        box-shadow: 0 25px 70px rgba(0,0,0,.3);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    .sg-login-mobile .sg-login-panel > .col-xs-12::before {
        content: "";
        position: absolute;
        top: 0;
        right: 28px;
        left: 28px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(0,119,255,.78), transparent);
    }

    .sg-login-mobile .sg-login-card-heading {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 20px;
    }

    .sg-login-mobile .sg-login-security-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(69,148,255,.28);
        border-radius: 10px;
        background: rgba(0,110,255,.1);
        color: #4594ff;
        font-size: 16px;
        line-height: 1 !important;
    }

    .sg-login-mobile .sg-login-security-icon svg {
        width: 19px;
        height: 19px;
        fill: currentColor;
    }

    .sg-login-mobile .sg-login-card-heading > div {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .sg-login-mobile .sg-login-card-heading small {
        margin-bottom: 3px;
        color: rgba(255,255,255,.48);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .16em;
        text-transform: uppercase;
    }

    .sg-login-mobile .sg-login-card-heading strong {
        overflow: hidden;
        color: rgba(255,255,255,.94);
        font-size: 15px;
        font-weight: 600;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sg-login-mobile .sg-login-panel .error {
        min-height: 18px;
        margin: 0 0 10px;
        color: #ff6b74;
        font-size: 13px;
    }

    .sg-login-mobile .input-group {
        width: 100%;
        margin: 0 0 14px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        background: rgba(255,255,255,.06);
        transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    }

    .sg-login-mobile .input-group:hover { background: rgba(255,255,255,.08); }

    .sg-login-mobile .input-group:focus-within {
        border-color: rgba(0,110,255,.85);
        background: rgba(255,255,255,.09);
        box-shadow: 0 0 0 3px rgba(0,110,255,.14);
    }

    .sg-login-mobile .input-group-addon,
    .sg-login-mobile .form-control {
        height: 50px;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .sg-login-mobile .input-group-addon {
        width: 48px;
        padding: 0;
        color: #4594ff;
        text-align: center;
    }

    .sg-login-mobile .form-control {
        padding-left: 4px;
        color: #fff;
        font-size: 15px;
    }

    .sg-login-mobile .form-control::placeholder {
        color: rgba(255,255,255,.46);
        opacity: 1;
    }

    .sg-login-mobile .sg-login-actions {
        display: block;
        margin: 5px 0 0 !important;
    }

    .sg-login-mobile .sg-login-apps { display: none !important; }

    .sg-login-mobile .sg-login-primary-actions {
        float: none;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 !important;
    }

    .sg-login-mobile .sg-login-primary-actions > br { display: none; }

    .sg-login-mobile .sg-login-primary-actions > a {
        order: 2;
        align-self: center;
        margin-top: 14px;
        color: rgba(255,255,255,.68) !important;
        font-size: 13px;
        text-decoration: none;
        transition: color 160ms ease;
    }

    .sg-login-mobile .sg-login-primary-actions > a:hover { color: #fff !important; }

    .sg-login-mobile .sg-login-submit {
        order: 1;
        position: relative;
        float: none !important;
        display: block !important;
        width: 100%;
        min-height: 48px;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        background: linear-gradient(135deg, #0878ff, #005bd7);
        box-shadow: 0 12px 28px rgba(0,98,220,.26);
        font-size: 16px;
        font-weight: 600;
        line-height: normal;
        transition: transform 150ms ease, box-shadow 180ms ease, opacity 180ms ease;
    }

    .sg-login-mobile .sg-login-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 15px 34px rgba(0,98,220,.34);
    }

    .sg-login-mobile .sg-login-submit:active { transform: translateY(0) scale(.99); }

    .sg-login-mobile .sg-login-spinner {
        display: none;
        width: 20px;
        height: 20px;
        margin: 0 auto;
        border: 2px solid rgba(255,255,255,.4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: sgLoginSpin 650ms linear infinite;
    }

    .sg-login-mobile.sg-login-submitting .sg-login-submit-label { display: none; }
    .sg-login-mobile.sg-login-submitting .sg-login-spinner { display: block; }
    .sg-login-mobile.sg-login-submitting .sg-login-submit { opacity: .82; }

    .sg-login-mobile.sg-login-has-error .sg-login-panel {
        animation: sgLoginDesktopPanel 360ms ease-out forwards, sgLoginDesktopError 300ms ease-out 390ms;
    }

    .sg-login-mobile .sg-login-workspace-icons {
        position: absolute;
        z-index: 1;
        right: 4vw;
        bottom: 25px;
        left: 4vw;
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1420px;
        margin: 0 auto;
        color: #c7d0d9;
        font-size: clamp(17px, 1.35vw, 25px);
        opacity: .09;
        filter: grayscale(1);
        pointer-events: none;
        user-select: none;
    }

    .sg-login-mobile .sg-login-workspace-icons > .glyphicon {
        display: inline-block;
        line-height: 1 !important;
    }

    .sg-login-mobile .sg-login-qr-card {
        position: absolute;
        z-index: 3;
        top: calc(42% + 152px);
        bottom: auto;
        left: 27.5%;
        display: flex;
        align-items: center;
        width: min(320px, calc(55vw - 80px));
        padding: 10px;
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 16px;
        background: rgba(8,24,39,.62);
        box-shadow: 0 18px 45px rgba(0,0,0,.18);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        opacity: 0;
        transform: translate(-50%, 10px);
        animation: sgLoginQRReveal 460ms cubic-bezier(.2,.75,.25,1) 380ms forwards;
    }

    .sg-login-mobile .sg-login-qr-card.sg-login-qr-unavailable { display: none; }

    .sg-login-mobile .sg-login-qr-code {
        flex: 0 0 auto;
        padding: 5px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 0 0 1px rgba(69,148,255,.2), 0 8px 20px rgba(0,0,0,.18);
    }

    .sg-login-mobile .sg-login-qr-image {
        display: block;
        width: 94px;
        height: 94px;
        border-radius: 7px;
    }

    .sg-login-mobile .sg-login-qr-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
        padding: 0 14px;
    }

    .sg-login-mobile .sg-login-qr-eyebrow {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 7px;
        color: #68a8ff;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .13em;
        text-transform: uppercase;
    }

    .sg-login-mobile .sg-login-qr-eyebrow .glyphicon {
        font-size: 13px;
        line-height: 1 !important;
    }

    .sg-login-mobile .sg-login-qr-copy strong {
        overflow: hidden;
        margin-bottom: 4px;
        color: rgba(255,255,255,.94);
        font-size: 15px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sg-login-mobile .sg-login-qr-copy small {
        overflow: hidden;
        color: rgba(255,255,255,.48);
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    @keyframes sgLoginDesktopLight {
        from { left: -30%; }
        to { left: 72%; }
    }

    @keyframes sgLoginDesktopLogo {
        to { opacity: 1; transform: translateY(-50%) scale(1); }
    }

    @keyframes sgLoginDesktopPanel {
        to { opacity: 1; transform: translate(0, -50%); }
    }

    @keyframes sgLoginDesktopFooter {
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes sgLoginQRReveal {
        to { opacity: 1; transform: translate(-50%, 0); }
    }

    @keyframes sgLoginDesktopError {
        0%, 100% { margin-left: 0; }
        35% { margin-left: -4px; }
        70% { margin-left: 4px; }
    }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
    .sg-login-mobile::after,
    .sg-login-mobile .sg-login-logo,
    .sg-login-mobile .sg-login-panel,
    .sg-login-mobile #footer,
    .sg-login-mobile .sg-login-qr-card,
    .sg-login-mobile.sg-login-has-error .sg-login-panel {
        opacity: 1;
        animation: none;
    }

    .sg-login-mobile .sg-login-logo { transform: translateY(-50%); }
    .sg-login-mobile .sg-login-panel { transform: translate(0, -50%); }
    .sg-login-mobile .sg-login-qr-card { transform: translate(-50%, 0); }
}

@media (min-width: 768px) and (max-height: 800px) {
    .sg-login-mobile .sg-login-qr-card {
        width: min(320px, calc(55vw - 70px));
        padding: 8px;
    }

    .sg-login-mobile .sg-login-qr-image { width: 76px; height: 76px; }
    .sg-login-mobile .sg-login-qr-copy { padding: 0 11px; }
}
