
:root {
    --navy: #101f39;
    --navy-deep: #0b172b;
    --navy-mid: #17385d;
    --ice: #a9c4e4;
    --ice-2: #dce9f7;
    --white: #ffffff;
    --text: #10203a;
    --muted: #7c8aa0;
    --line: #d2dbe7;
    --page: #eef2f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    overflow: auto;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 50% 34%, #ffffff 0%, #f6f8fa 42%, #e8edf2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

/* Centered floating ERP panel:
   approx. 15% blank at left/right, 10% blank at top/bottom */
.stage {
    width: 70vw;
    height: 80vh;
    min-width: 980px;
    min-height: 620px;
    position: relative;
    perspective: 1800px;
}

.stage::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    border-radius: 14px;
    background: rgba(16,31,57,.09);
    filter: blur(10px);
    opacity: .6;
}

.app-shell {
    width: 100%;
    height: 100%;
    position: relative;
    display: grid;
    grid-template-columns: 46% 54%;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(16,31,57,.08);
    background: #fff;
    box-shadow:
        0 46px 90px rgba(15,31,55,.17),
        0 18px 34px rgba(15,31,55,.10),
        0 3px 8px rgba(15,31,55,.06);
    transform: perspective(1800px) rotateX(.35deg) rotateY(-.28deg) translateZ(12px);
    transform-origin: center;
    animation: panelIn .9s cubic-bezier(.16,1,.3,1) both;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: perspective(1800px) translateY(24px) rotateX(1.5deg) rotateY(-.8deg) scale(.985);
    }
    to {
        opacity: 1;
        transform: perspective(1800px) translateY(0) rotateX(.35deg) rotateY(-.28deg) scale(1);
    }
}

.left-panel {
    position: relative;
    background:
        linear-gradient(145deg, #111f37 0%, #101d34 58%, #0b172b 100%);
    color: white;
    padding: clamp(44px, 4vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Actual SUNWIN logo in place of SW box */
.logo-box {
    position: absolute;
    top: 48px;
    left: 58px;
    width: 76px;
    height: 76px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(174,198,229,.4);
    box-shadow:
        0 8px 20px rgba(0,0,0,.14),
        inset 0 0 0 1px rgba(16,31,57,.04);
    display: grid;
    place-items: center;
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-small {
    margin-bottom: 42px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #adc4e1;
}

/* ===== Fixed SUNWIN word; only its outlines/fill animate ===== */

.sunwin-wrap {
    width: min(100%, 620px);
}

.sunwin-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.sunwin-text {
    font-family: "Arial Black", "Segoe UI", Arial, sans-serif;
    font-size: 170px;
    font-weight: 900;
    letter-spacing: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
    fill: none;
    stroke-linecap: square;
    stroke-linejoin: bevel;
}

.guide {
    stroke: rgba(255,255,255,.04);
    stroke-width: 5;
}

/* Repeat the original 4.8-second word sequence, then hold its finished state for 3 seconds. */
/* Keyframe percentages are scaled into a 7.8-second cycle; form controls are never reset. */
/* broken moving contour fragments */
.frag-a {
    stroke: #789ac4;
    stroke-width: 5;
    stroke-dasharray: 22 118 10 88 40 145;
    stroke-dashoffset: 640;
    opacity: 0;
    animation: fragA 7.8s linear infinite both;
}

.frag-b {
    stroke: #b3cbe7;
    stroke-width: 4.5;
    stroke-dasharray: 12 90 34 132 8 70;
    stroke-dashoffset: -580;
    opacity: 0;
    animation: fragB 7.8s linear infinite both;
}

.frag-c {
    stroke: #e2edf9;
    stroke-width: 4;
    stroke-dasharray: 7 70 16 110 9 58;
    stroke-dashoffset: 450;
    opacity: 0;
    animation: fragC 7.8s linear infinite both;
}

@keyframes fragA {
    0% { opacity: 0; stroke-dashoffset: 640; }
    3.077% { opacity: 1; }
    18.462% { opacity: 1; stroke-dashoffset: 120; }
    25.846% { opacity: .9; stroke-dashoffset: 0; }
    31.385%,61.538% { opacity: 0; stroke-dashoffset: 0; }
    100% { opacity: 0; stroke-dashoffset: 0; }
}

@keyframes fragB {
    0%,2.462% { opacity: 0; stroke-dashoffset: -580; }
    5.538% { opacity: 1; }
    19.692% { opacity: 1; stroke-dashoffset: -90; }
    27.077% { opacity: .9; stroke-dashoffset: 0; }
    32.615%,61.538% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes fragC {
    0%,4.923% { opacity: 0; stroke-dashoffset: 450; }
    8% { opacity: .95; }
    21.538% { opacity: .95; stroke-dashoffset: 70; }
    28.308% { opacity: .8; stroke-dashoffset: 0; }
    33.846%,61.538% { opacity: 0; }
    100% { opacity: 0; }
}

/* complete outline joins */
.full-outline {
    stroke: #dce9f7;
    stroke-width: 5;
    stroke-dasharray: 4200;
    stroke-dashoffset: 4200;
    opacity: 0;
    animation: fullOutline 7.8s cubic-bezier(.16,1,.3,1) infinite both;
}

@keyframes fullOutline {
    0%,16% { opacity: 0; stroke-dashoffset: 4200; }
    20.923% { opacity: 1; }
    34.462% { opacity: 1; stroke-dashoffset: 0; }
    42.462% { opacity: 1; stroke-dashoffset: 0; }
    50.462%,61.538% { opacity: 0; stroke-dashoffset: 0; }
    100% { opacity: 0; stroke-dashoffset: 0; }
}

/* navy-to-white fill */
.final-fill {
    fill: url(#finalFillGradient);
    stroke: none;
    opacity: 0;
    animation: finalFill 7.8s cubic-bezier(.16,1,.3,1) infinite both;
}

@keyframes finalFill {
    0%,33.231% { opacity: 0; }
    40.615% { opacity: .32; }
    48%,61.538% { opacity: 1; }
    100% { opacity: 1; }
}

/* one highlight sweep visible only inside the fixed letters */
.shine {
    fill: url(#shineGradient);
    mask: url(#sunwinMask);
    opacity: 0;
    animation: shineMove 7.8s ease-in-out infinite both;
}

@keyframes shineMove {
    0%,43.077% { opacity: 0; transform: translateX(-650px); }
    45.538% { opacity: .85; }
    54.154% { opacity: .85; }
    59.077%,61.538% { opacity: 0; transform: translateX(1150px); }
    100% { opacity: 0; transform: translateX(1150px); }
}

.small-divider {
    width: 64px;
    height: 2px;
    margin: 42px 0 30px;
    background: #a8bdd6;
}

.tagline {
    font-size: clamp(20px, 1.55vw, 29px);
    line-height: 1.55;
    font-weight: 300;
    color: #e4ebf4;
}

.left-footer {
    position: absolute;
    left: 58px;
    bottom: 42px;
    font-size: 11px;
    letter-spacing: 1px;
    color: #a7b7cb;
}

/* ===== Right panel ===== */

.right-panel {
    position: relative;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px clamp(65px, 6vw, 110px);
}

.login-area {
    width: min(430px, 100%);
}

.app-title {
    margin-bottom: 24px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--navy);
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(30px, 2vw, 38px);
    font-weight: 700;
    letter-spacing: -.8px;
    color: var(--text);
}

.sub-title {
    margin-bottom: 42px;
    font-size: 15px;
    color: var(--muted);
}

.field {
    margin-bottom: 23px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
}

/* 2-line border */
.field input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    outline: none;

    border: 4px double #cfd9e6;
    border-radius: 8px;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

/* simple focus highlight */
.field input:focus {
    border-color: #7c9fc9;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(92,132,181,.12);
}

.login-btn {
    width: 100%;
    height: 56px;
    margin-top: 28px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(100deg, #101f39, #162b4a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: .7px;
    box-shadow: 0 10px 22px rgba(16,31,57,.12);
    transition: transform .18s ease, box-shadow .18s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(16,31,57,.17);
}

.login-note {
    margin-top: 27px;
    text-align: center;
    font-size: 11px;
    color: #7e899a;
}

.bottom-left {
    position: absolute;
    left: 42px;
    bottom: 30px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #8290a3;
}

.bottom-right {
    position: absolute;
    right: 42px;
    bottom: 30px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #8290a3;
}

.app-shell::after {
    content: "";
    position: absolute;
    left: 46%;
    top: 0;
    width: 1px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,.08), transparent);
}

@media (max-width: 1200px) {
    .stage {
        width: 86vw;
        height: 84vh;
        min-width: 0;
    }
}

@media (max-width: 850px) {
    body { overflow: auto; }

    .stage {
        width: 92vw;
        height: auto;
        min-height: 0;
        margin: 5vh auto;
    }

    .app-shell {
        display: block;
        height: auto;
        transform: none;
    }

    .left-panel {
        min-height: 440px;
        padding: 120px 36px 55px;
    }

    .right-panel {
        min-height: 560px;
        padding: 60px 35px;
    }

    .logo-box {
        left: 35px;
        top: 30px;
        width: 68px;
        height: 68px;
    }

    .left-footer { left: 35px; }

    .app-shell::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell,
    .frag-a,
    .frag-b,
    .frag-c,
    .full-outline,
    .final-fill,
    .shine {
        animation: none;
    }

    .final-fill { opacity: 1; }
}


.message { min-height: 22px; font-size: 13px; line-height: 1.5; color: #9f2835; }
.login-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.login-btn:focus-visible { outline: 3px solid #7c9fc9; outline-offset: 3px; }
@media (max-width: 450px) {
    .brand-small { margin-bottom: 24px; }
    .left-panel { min-height: 360px; padding: 115px 26px 60px; }
    .right-panel { min-height: 520px; padding: 48px 26px 75px; }
    .small-divider { margin: 26px 0 20px; }
    .bottom-left { left: 26px; bottom: 25px; font-size: 8px; }
    .bottom-right { right: 26px; bottom: 25px; font-size: 8px; }
}

#duplicate-login { max-width:min(460px,90vw); padding:24px; border:1px solid #dce3ed; border-radius:8px; color:#111d33; font:inherit; }
#duplicate-login::backdrop { background:#111d3380; }
#duplicate-login h2 { margin:0 0 12px; font-size:20px; }
#duplicate-login p { font-size:14px; line-height:1.6; }
#duplicate-login form { display:flex; gap:10px; justify-content:flex-end; margin-top:18px; }
#duplicate-login button { padding:9px 14px; border:1px solid #111d33; border-radius:5px; background:#111d33; color:#fff; cursor:pointer; font:inherit; font-size:13px; }
#duplicate-login button[value="cancel"] { background:#fff; color:#111d33; border-color:#dce3ed; }
