:root { --mi7-blue:#0241b3; --mi7-cyan:#0ed6fe; --mi7-ink:#0c131c; --text:#152233; --muted:#617085; --safe-top:env(safe-area-inset-top, 0px); --safe-bottom:env(safe-area-inset-bottom, 0px); }
* { box-sizing:border-box; }
html { min-height:100%; font-family:"Segoe UI Variable","Segoe UI",Inter,system-ui,sans-serif; }
body.login-page { min-height:100vh; margin:0; }
.login-page {
    min-height: 100dvh;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 15%, rgba(14, 214, 254, 0.13), transparent 24rem),
        radial-gradient(circle at 88% 80%, rgba(2, 65, 179, 0.2), transparent 30rem),
        var(--mi7-ink);
}

.login-shell {
    width: min(100%, 940px);
}

.login-card {
    min-height: 570px;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(235, 235, 235, 0.12);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.36);
}

.login-brand-panel {
    padding: 44px 42px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 100% 0, rgba(14, 214, 254, 0.27), transparent 19rem),
        linear-gradient(145deg, #0c131c 0%, #10233b 58%, #0241b3 145%);
}

.login-brand-panel::after {
    content: "7";
    position: absolute;
    right: -14px;
    bottom: -82px;
    color: rgba(235, 235, 235, 0.045);
    font-size: 300px;
    font-weight: 900;
    line-height: 1;
}

.login-wordmark {
    width: 210px;
    position: relative;
    z-index: 1;
}

.login-product {
    margin: auto 0;
    position: relative;
    z-index: 1;
}

.product-kicker {
    color: var(--mi7-cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.login-product strong {
    margin: 9px 0 10px;
    display: block;
    color: #ffffff;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.login-product p {
    max-width: 290px;
    margin: 0;
    color: #aabed1;
    line-height: 1.55;
}

.brand-proof {
    display: grid;
    gap: 8px;
    position: relative;
    z-index: 1;
    color: #c7d4e1;
    font-size: 11px;
}

.brand-proof span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-proof i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mi7-cyan);
    box-shadow: 0 0 0 4px rgba(14, 214, 254, 0.1);
}

.login-form-panel {
    padding: 58px 56px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-heading h1 {
    margin: 8px 0 6px;
    color: var(--text);
    font-size: 37px;
    font-weight: 760;
    letter-spacing: -0.045em;
}

.login-heading p {
    margin: 0 0 25px;
    color: var(--muted);
}

.stack-form {
    gap: 8px;
}

.stack-form label {
    margin-top: 6px;
    color: var(--text);
    font-size: 12px;
}

.stack-form input {
    min-height: 54px;
    margin-bottom: 3px;
    border: 1px solid #cbd8e6;
    color: var(--text);
    background: #fbfdff;
}

.stack-form input::placeholder {
    color: #97a4b3;
}

.stack-form .button {
    min-height: 56px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    background: linear-gradient(135deg, #0241b3, #053486);
}

.login-help {
    margin: 20px 0 0;
    color: #7c8998;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.legal-footer {
    padding: 18px 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: #788b9e;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.legal-footer strong {
    color: #9db0c2;
}

.legal-footer .app-version {
    white-space: nowrap;
}

/* Compact sign-in flow for handhelds and phones with short viewports. */
@media (max-width: 760px) {
    .login-page {
        min-height: 100dvh;
        padding: max(10px, var(--safe-top)) 12px max(10px, var(--safe-bottom));
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-shell {
        width: min(100%, 420px);
    }

    .login-card {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        border-radius: 20px;
    }

    .login-brand-panel {
        min-height: 0;
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .login-brand-panel::after {
        right: -4px;
        bottom: -58px;
        font-size: 170px;
    }

    .login-wordmark {
        width: min(46vw, 170px);
        max-height: 42px;
        object-fit: contain;
        object-position: left center;
    }

    .login-product {
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .login-product strong {
        margin: 0;
        font-size: 18px;
        line-height: 1.2;
    }

    .login-product p,
    .brand-proof {
        display: none;
    }

    .login-form-panel {
        padding: 24px clamp(20px, 7vw, 32px) 20px;
    }

    .login-heading .eyebrow {
        font-size: 9px;
    }

    .login-heading h1 {
        margin: 4px 0 2px;
        font-size: 28px;
    }

    .login-heading p {
        margin-bottom: 14px;
        font-size: 13px;
    }

    .login-form-panel .alert {
        margin: 0 0 10px;
        padding: 9px 11px;
        font-size: 12px;
    }

    .stack-form {
        gap: 5px;
    }

    .stack-form label {
        margin-top: 3px;
        font-size: 12px;
    }

    .stack-form input {
        min-height: 48px;
        margin-bottom: 1px;
        padding: 9px 12px;
    }

    .stack-form .button {
        min-height: 50px;
        margin-top: 10px;
    }

    .login-help {
        margin-top: 12px;
    }

    .legal-footer {
        padding: 8px 2px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 4px 8px;
        font-size: 9px;
        text-align: center;
        white-space: normal;
    }

    .legal-footer strong::after {
        content: " ·";
    }

    .legal-footer .app-version::before {
        content: "· ";
    }
}

@media (max-width: 430px) and (max-height: 620px) {
    .login-page {
        padding: max(6px, var(--safe-top)) 10px max(6px, var(--safe-bottom));
        align-items: flex-start;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-brand-panel {
        padding: 12px 16px;
        gap: 6px;
    }

    .login-wordmark {
        width: min(40vw, 140px);
        max-height: 34px;
    }

    .login-product strong {
        font-size: 15px;
    }

    .login-form-panel {
        padding: 16px 18px 14px;
    }

    .login-heading h1 {
        margin-top: 2px;
        font-size: 24px;
    }

    .login-heading p {
        margin-bottom: 9px;
        font-size: 12px;
    }

    .login-form-panel .alert {
        margin-bottom: 7px;
        padding: 7px 9px;
        line-height: 1.25;
    }

    .stack-form {
        gap: 3px;
    }

    .stack-form label {
        margin-top: 2px;
        font-size: 11px;
    }

    .stack-form input {
        min-height: 46px;
        padding: 8px 11px;
    }

    .stack-form .button {
        min-height: 48px;
        margin-top: 7px;
    }

    .login-help {
        display: none;
    }

    .legal-footer {
        padding-top: 5px;
        font-size: 7px;
    }
}

@media (max-width: 360px) {
    .login-page {
        padding-right: 8px;
        padding-left: 8px;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-brand-panel {
        padding: 13px 16px;
    }

    .login-form-panel {
        padding-right: 17px;
        padding-left: 17px;
    }

    .legal-footer {
        font-size: 8px;
    }
}


.login-shell { margin:0 auto; }
.stack-form { display:grid; gap:8px; }
.stack-form label { color:var(--text); font-size:12px; font-weight:700; }
.stack-form input { width:100%; padding:11px 13px; border-radius:10px; font-size:16px; }
.stack-form input:focus { border-color:var(--mi7-blue); outline:0; box-shadow:0 0 0 4px rgba(2,65,179,.12); }
.stack-form .button { width:100%; padding:10px 16px; border:0; border-radius:12px; font-weight:750; cursor:pointer; }
.button-primary { color:#fff; background:linear-gradient(135deg,#0241b3,#053486); }
.alert { margin:12px 0; padding:11px 13px; border:1px solid transparent; border-radius:12px; font-size:13px; line-height:1.4; }
.alert-error { border-color:#f0a9b5; color:#8f1c31; background:#fff0f2; }
/* Animated hand-off between the native PWA splash and the MI7 application. */
html.splash-active {
    overflow: hidden;
}

html.splash-seen .app-splash {
    display: none;
}

.app-splash {
    min-height: 100vh;
    min-height: 100dvh;
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 44%, rgba(2, 65, 179, 0.34), transparent 32%),
        radial-gradient(circle at 82% 18%, rgba(14, 214, 254, 0.13), transparent 28%),
        linear-gradient(145deg, #070d14 0%, #0c1826 58%, #07111d 100%);
    animation: mi7-splash-fallback 0s 4s forwards;
}

.app-splash::before {
    content: "";
    width: min(82vw, 520px);
    aspect-ratio: 1;
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 214, 254, 0.12), transparent 67%);
    filter: blur(6px);
    animation: mi7-splash-breathe 1.8s ease-in-out infinite;
}

.app-splash-grid {
    position: absolute;
    z-index: -2;
    inset: -30%;
    opacity: 0.14;
    background-image:
        linear-gradient(rgba(14, 214, 254, 0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 214, 254, 0.25) 1px, transparent 1px);
    background-size: 42px 42px;
    transform: perspective(420px) rotateX(66deg) translateY(18%);
    transform-origin: 50% 58%;
    -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
    mask-image: radial-gradient(circle at center, #000 0%, transparent 68%);
    animation: mi7-splash-grid 2.2s linear infinite;
}

.app-splash-seven {
    position: absolute;
    z-index: -1;
    right: -0.04em;
    bottom: -0.24em;
    color: transparent;
    font-size: min(92vh, 700px);
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    -webkit-text-stroke: 2px rgba(14, 214, 254, 0.09);
    animation: mi7-splash-seven 1.4s 0.12s ease-out forwards;
}

.app-splash-content {
    width: min(84vw, 420px);
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    text-align: center;
}

.app-splash-emblem {
    width: 100%;
    min-height: 128px;
    display: grid;
    place-items: center;
    position: relative;
}

.app-splash-logo-mask {
    width: min(76vw, 330px);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.app-splash-logo-mask img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
    animation: mi7-splash-logo 0.82s 0.12s cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.app-splash-scan-line {
    width: 38%;
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(14, 214, 254, 0.6), transparent);
    filter: blur(1px);
    transform: translateX(-150%) skewX(-12deg);
    animation: mi7-splash-scan 0.92s 0.32s ease-out forwards;
}

.app-splash-ring {
    width: 116px;
    height: 116px;
    position: absolute;
    border: 1px solid rgba(14, 214, 254, 0.22);
    border-radius: 50%;
    opacity: 0;
    animation: mi7-splash-ring 1.35s ease-out infinite;
}

.app-splash-ring-two {
    animation-delay: 0.48s;
}

.app-splash-product {
    margin: 2px 0 0;
    color: #dce8f5;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
    opacity: 0;
    transform: translateY(10px);
    animation: mi7-splash-copy 0.55s 0.68s ease-out forwards;
}

.app-splash-product span {
    color: var(--mi7-cyan);
}

.app-splash-tagline {
    margin: 9px 0 0;
    color: #8094a8;
    font-size: 10px;
    letter-spacing: 0.045em;
    opacity: 0;
    transform: translateY(8px);
    animation: mi7-splash-copy 0.55s 0.82s ease-out forwards;
}

.app-splash-progress {
    width: min(58vw, 210px);
    height: 2px;
    margin-top: 24px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(235, 235, 235, 0.09);
    opacity: 0;
    animation: mi7-splash-copy 0.35s 0.76s ease-out forwards;
}

.app-splash-progress span {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mi7-blue), var(--mi7-cyan));
    box-shadow: 0 0 12px rgba(14, 214, 254, 0.48);
    transform: scaleX(0);
    transform-origin: left;
    animation: mi7-splash-progress 1.15s 0.42s cubic-bezier(0.2, 0.68, 0.22, 1) forwards;
}

.app-splash.is-leaving {
    pointer-events: none;
    animation: mi7-splash-exit 0.44s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes mi7-splash-logo {
    0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(5px) scale(0.98); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(0) scale(1); }
}

@keyframes mi7-splash-scan {
    0% { opacity: 0; transform: translateX(-150%) skewX(-12deg); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateX(340%) skewX(-12deg); }
}

@keyframes mi7-splash-ring {
    0% { opacity: 0; transform: scale(0.72); }
    24% { opacity: 0.45; }
    100% { opacity: 0; transform: scale(2.45); }
}

@keyframes mi7-splash-copy {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes mi7-splash-progress {
    to { transform: scaleX(1); }
}

@keyframes mi7-splash-breathe {
    50% { opacity: 0.65; transform: scale(1.08); }
}

@keyframes mi7-splash-grid {
    to { background-position: 0 42px, 42px 0; }
}

@keyframes mi7-splash-seven {
    from { opacity: 0; transform: translateX(5%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes mi7-splash-exit {
    to { opacity: 0; visibility: hidden; transform: scale(1.025); }
}

@keyframes mi7-splash-fallback {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (max-width: 430px) {
    .app-splash-content {
        width: 88vw;
    }

    .app-splash-emblem {
        min-height: 108px;
    }

    .app-splash-logo-mask {
        width: min(78vw, 280px);
        padding: 14px 18px;
    }

    .app-splash-product {
        font-size: 12px;
        letter-spacing: 0.27em;
        text-indent: 0.27em;
    }

    .app-splash-tagline {
        max-width: 260px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash {
        animation: mi7-splash-fallback 0s 2s forwards;
    }

    .app-splash::before,
    .app-splash-grid,
    .app-splash-seven,
    .app-splash-logo-mask img,
    .app-splash-scan-line,
    .app-splash-ring,
    .app-splash-product,
    .app-splash-tagline,
    .app-splash-progress,
    .app-splash-progress span {
        animation: none;
    }

    .app-splash-seven,
    .app-splash-logo-mask img,
    .app-splash-product,
    .app-splash-tagline,
    .app-splash-progress {
        opacity: 1;
        clip-path: none;
        transform: none;
    }

    .app-splash-progress span {
        transform: scaleX(1);
    }

    .app-splash.is-leaving {
        animation: mi7-splash-exit 0.12s linear forwards;
    }
}
