/* =========================================================
   IDMS ENTERPRISE — PREMIUM ANIMATED LOGIN
   Complete replacement for static/css/login.css
   ========================================================= */

:root {
    --blue-950: #071a3b;
    --blue-900: #0a2a61;
    --blue-800: #0e3d8f;
    --blue-700: #1558bf;
    --blue-600: #2674e8;
    --cyan: #49c8ff;
    --cyan-soft: #a8ecff;
    --ink: #16233a;
    --muted: #748197;
    --line: #e4eaf2;
    --panel: #ffffff;
}

* { box-sizing: border-box; }

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

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at 14% 18%, rgba(38,116,232,.16), transparent 30%),
        radial-gradient(circle at 88% 85%, rgba(73,200,255,.12), transparent 30%),
        linear-gradient(135deg, #edf3fb 0%, #f7f9fc 48%, #edf4fc 100%);
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    isolation: isolate;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(35px);
    opacity: .28;
    pointer-events: none;
    animation: ambientFloat 9s ease-in-out infinite alternate;
}

.ambient-one {
    top: -100px;
    left: -90px;
    background: #77b9ff;
}

.ambient-two {
    right: -100px;
    bottom: -130px;
    background: #9ee8ff;
    animation-delay: -4s;
}

.login-shell {
    width: min(1180px, 100%);
    min-height: min(700px, calc(100vh - 60px));
    display: grid;
    grid-template-columns: 1.14fr .86fr;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 28px;
    background: #fff;
    box-shadow:
        0 35px 90px rgba(20, 47, 91, .20),
        0 6px 22px rgba(20, 47, 91, .08);
    animation: shellEnter .8s cubic-bezier(.16,1,.3,1) both;
}

/* =========================================================
   LEFT PANEL
   ========================================================= */

.welcome-panel {
    position: relative;
    min-height: 700px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 86% 14%, rgba(73,200,255,.28), transparent 24%),
        radial-gradient(circle at 16% 84%, rgba(69,118,255,.30), transparent 30%),
        linear-gradient(145deg, var(--blue-950) 0%, var(--blue-900) 44%, var(--blue-700) 100%);
}

.welcome-panel::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    right: -270px;
    top: -190px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow:
        0 0 0 52px rgba(255,255,255,.025),
        0 0 0 104px rgba(255,255,255,.018);
}

.welcome-panel::after {
    content: "";
    position: absolute;
    left: -130px;
    bottom: -170px;
    width: 420px;
    height: 420px;
    border: 58px solid rgba(72,201,255,.045);
    border-radius: 50%;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    opacity: .20;
    background-image:
        linear-gradient(rgba(255,255,255,.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.11) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.route {
    position: absolute;
    z-index: 1;
    width: 420px;
    height: 170px;
    border: 1px dashed rgba(117,220,255,.22);
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 160px 0 0;
    transform: rotate(-17deg);
    animation: routeDrift 8s ease-in-out infinite alternate;
}

.route-one { top: 190px; right: -150px; }
.route-two {
    width: 280px;
    height: 110px;
    bottom: 145px;
    left: -110px;
    transform: rotate(16deg);
    animation-delay: -3s;
}

.floating-dot {
    position: absolute;
    z-index: 2;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan-soft);
    box-shadow: 0 0 0 7px rgba(73,200,255,.08), 0 0 20px rgba(73,200,255,.8);
    animation: blink 2.8s ease-in-out infinite;
}

.dot-a { top: 160px; left: 68px; }
.dot-b { top: 310px; right: 105px; animation-delay: -1s; }
.dot-c { bottom: 120px; left: 44%; animation-delay: -2s; }

.welcome-top,
.welcome-content,
.welcome-bottom,
.logistics-scene {
    position: absolute;
    z-index: 4;
}

.welcome-top {
    top: 40px;
    left: 48px;
    right: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.welcome-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(73,200,255,.95), rgba(44,113,232,.95));
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    font-size: 22px;
}

.welcome-brand strong,
.welcome-brand span {
    display: block;
    line-height: 1;
}

.welcome-brand strong {
    font-size: 18px;
    letter-spacing: .06em;
}

.welcome-brand span {
    margin-top: 5px;
    color: rgba(255,255,255,.62);
    font-size: 8px;
    letter-spacing: .20em;
    font-weight: 700;
}

.secure-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
    color: rgba(255,255,255,.80);
    font-size: 11px;
}

.secure-chip i { color: var(--cyan-soft); }

.welcome-content {
    top: 155px;
    left: 58px;
    max-width: 500px;
    animation: contentEnter .9s .18s cubic-bezier(.16,1,.3,1) both;
}

.eyebrow,
.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: .13em;
    font-size: 10px;
    font-weight: 800;
}

.eyebrow {
    color: var(--cyan-soft);
    margin-bottom: 18px;
}

.welcome-content h1 {
    margin: 0;
    font-size: clamp(44px, 5vw, 67px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 750;
}

.welcome-content h1 span {
    color: var(--cyan-soft);
    text-shadow: 0 0 30px rgba(73,200,255,.20);
}

.welcome-content > p {
    max-width: 435px;
    margin: 24px 0 0;
    color: rgba(255,255,255,.70);
    font-size: 15px;
    line-height: 1.8;
}

.feature-list {
    display: flex;
    gap: 14px;
    margin-top: 32px;
}

.feature-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    min-width: 0;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(14px);
}

.feature-icon {
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--cyan-soft);
    background: rgba(73,200,255,.13);
}

.feature-item strong,
.feature-item small {
    display: block;
    white-space: nowrap;
}

.feature-item strong {
    font-size: 10px;
    color: rgba(255,255,255,.92);
}

.feature-item small {
    margin-top: 4px;
    color: rgba(255,255,255,.52);
    font-size: 8px;
}

/* Animated map */
.logistics-scene {
    right: 34px;
    bottom: 50px;
    left: 58px;
    height: 200px;
    animation: sceneEnter 1s .35s cubic-bezier(.16,1,.3,1) both;
}

.scene-glow {
    position: absolute;
    inset: 40px 40px 0;
    border-radius: 50%;
    background: rgba(47,160,255,.26);
    filter: blur(45px);
}

.map-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(151,221,255,.18);
    border-radius: 22px;
    background:
        linear-gradient(rgba(255,255,255,.035), rgba(255,255,255,.02)),
        rgba(3,20,56,.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 20px 40px rgba(0,0,0,.12);
    backdrop-filter: blur(12px);
}

.map-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image:
        linear-gradient(rgba(123,219,255,.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123,219,255,.22) 1px, transparent 1px);
    background-size: 32px 32px;
}

.map-header {
    position: absolute;
    z-index: 5;
    top: 17px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.72);
    font-size: 9px;
    letter-spacing: .12em;
    font-weight: 800;
}

.map-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #75f0bd;
    box-shadow: 0 0 0 0 rgba(117,240,189,.5);
    animation: statusPulse 1.8s infinite;
}

.map-lines {
    position: absolute;
    inset: 40px 12px 0;
}

.map-lines svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.route-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-shadow {
    stroke: rgba(73,200,255,.16);
    stroke-width: 9;
}

.line-main {
    stroke: var(--cyan-soft);
    stroke-width: 2.3;
    stroke-dasharray: 8 10;
    animation: dashMove 4s linear infinite;
}

.pin {
    position: absolute;
    z-index: 6;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.13);
    color: var(--cyan-soft);
    border: 1px solid rgba(168,236,255,.34);
    box-shadow: 0 0 20px rgba(73,200,255,.25);
    font-size: 12px;
}

.pin-start { left: 6%; bottom: 23px; }
.pin-mid { left: 56%; bottom: 48px; }
.pin-end { right: 6%; top: 34px; color: #fff3a7; }

.truck-wrap {
    position: absolute;
    z-index: 7;
    left: 16%;
    bottom: 45px;
    animation: truckDrive 7s ease-in-out infinite;
}

.truck {
    width: 43px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px 12px 10px 10px;
    background: linear-gradient(145deg, #7ddfff, #3986ff);
    color: white;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    font-size: 21px;
}

.truck-shadow {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -9px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,.25);
    filter: blur(4px);
}

.welcome-bottom {
    left: 58px;
    right: 48px;
    bottom: 20px;
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,.48);
    font-size: 10px;
}

.welcome-bottom i {
    color: #75f0bd;
    font-size: 7px;
    margin-right: 5px;
}

/* =========================================================
   RIGHT LOGIN PANEL
   ========================================================= */

.login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
    background:
        radial-gradient(circle at 100% 0, rgba(73,200,255,.07), transparent 28%),
        #fff;
}

.panel-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(transparent, rgba(20,86,191,.22), transparent);
}

.login-panel-inner {
    width: min(100%, 380px);
    animation: formEnter .8s .28s cubic-bezier(.16,1,.3,1) both;
}

.mobile-brand { display: none; }

.login-heading { margin-bottom: 35px; }

.login-kicker {
    color: #3975d7;
    margin-bottom: 11px;
}

.login-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(31px, 3vw, 40px);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.login-heading h2 span {
    color: var(--blue-600);
}

.login-heading p {
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #47576e;
    font-size: 12px;
    font-weight: 700;
}

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

.input-wrapper input {
    width: 100%;
    height: 55px;
    padding: 0 49px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    background: #f8fafc;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    transition: .25s ease;
}

.input-wrapper input::placeholder { color: #aab4c1; }

.input-wrapper input:hover {
    border-color: #cbd8ea;
    background: #fff;
}

.input-wrapper input:focus {
    border-color: #5b93ed;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(38,116,232,.10);
}

.input-icon {
    position: absolute;
    z-index: 2;
    left: 17px;
    color: #8290a4;
    font-size: 17px;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    z-index: 2;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8290a4;
    cursor: pointer;
    transition: .2s ease;
}

.password-toggle:hover {
    background: #edf4ff;
    color: var(--blue-600);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #ffd0d0;
    border-radius: 12px;
    background: #fff6f6;
    color: #bd4141;
    font-size: 12px;
}

.login-button {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 5px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    box-shadow: 0 15px 28px rgba(38,116,232,.22);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-button i { font-size: 17px; }

.login-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 20px 35px rgba(38,116,232,.28);
}

.login-button:active { transform: translateY(0); }

.login-footer {
    margin-top: 31px;
    padding-top: 20px;
    border-top: 1px solid #edf0f4;
    text-align: center;
}

.footer-secure {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: #6d7b90;
    font-size: 10px;
    font-weight: 700;
}

.footer-secure i { color: var(--blue-600); }

.login-footer small {
    display: block;
    margin-top: 10px;
    color: #a0aab7;
    font-size: 9px;
}

.login-footer small span { margin: 0 5px; }

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes shellEnter {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes contentEnter {
    from { opacity: 0; transform: translateX(-22px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes formEnter {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes ambientFloat {
    to { transform: translate(35px, 25px) scale(1.12); }
}

@keyframes routeDrift {
    to { transform: translate(15px, -8px) rotate(-14deg); }
}

.route-two { animation-name: routeDriftTwo; }

@keyframes routeDriftTwo {
    to { transform: translate(12px, 8px) rotate(20deg); }
}

@keyframes blink {
    0%, 100% { opacity: .35; transform: scale(.85); }
    50% { opacity: 1; transform: scale(1.25); }
}

@keyframes dashMove {
    to { stroke-dashoffset: -180; }
}

@keyframes truckDrive {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(90px, -28px) rotate(-2deg); }
    55% { transform: translate(175px, 13px) rotate(2deg); }
    78% { transform: translate(245px, -60px) rotate(-3deg); }
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(117,240,189,.5); }
    70% { box-shadow: 0 0 0 8px rgba(117,240,189,0); }
    100% { box-shadow: 0 0 0 0 rgba(117,240,189,0); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .login-page { padding: 20px; }

    .login-shell {
        width: min(680px, 100%);
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .welcome-panel {
        min-height: 315px;
    }

    .welcome-top { top: 28px; left: 32px; right: 32px; }

    .welcome-content {
        top: 108px;
        left: 34px;
        right: 34px;
        max-width: 520px;
    }

    .welcome-content h1 { font-size: 46px; }
    .welcome-content > p { margin-top: 14px; }
    .feature-list { margin-top: 20px; }

    .logistics-scene,
    .welcome-bottom { display: none; }

    .login-panel { padding: 46px 38px 42px; }
    .panel-accent { width: 100%; height: 1px; top: 0; left: 0; }
}

@media (max-width: 560px) {
    .login-page { padding: 0; }

    .login-shell {
        min-height: 100vh;
        border-radius: 0;
        border: 0;
    }

    .welcome-panel {
        min-height: 240px;
        border-radius: 0 0 28px 28px;
    }

    .welcome-top { display: none; }

    .welcome-content {
        top: 45px;
        left: 26px;
        right: 26px;
    }

    .eyebrow { margin-bottom: 12px; }

    .welcome-content h1 {
        font-size: 43px;
        line-height: 1;
    }

    .welcome-content > p {
        margin-top: 14px;
        font-size: 12px;
        line-height: 1.6;
        max-width: 360px;
    }

    .feature-list { display: none; }

    .login-panel {
        padding: 36px 24px 32px;
        align-items: flex-start;
    }

    .login-panel-inner { width: 100%; }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 26px;
        color: var(--blue-800);
        font-size: 13px;
    }

    .mobile-brand-mark {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        color: #fff;
        background: linear-gradient(135deg, var(--blue-700), var(--cyan));
    }

    .login-heading { margin-bottom: 28px; }
    .login-heading h2 { font-size: 33px; }

    .secure-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}


/* Customer / Visitor passwordless gateway */
.passwordless-access{margin-top:22px;padding:16px;border:1px solid rgba(105,45,180,.18);border-radius:16px;background:linear-gradient(135deg,rgba(105,45,180,.055),rgba(30,115,255,.035));}
.passwordless-heading{display:flex;align-items:center;gap:10px;margin-bottom:13px;color:#243f70;}
.passwordless-heading>i{font-size:20px;color:#6b2db4;}
.passwordless-heading strong{display:block;font-size:14px;}
.passwordless-heading small{display:block;margin-top:2px;color:#7b879d;font-size:11px;}
.public-login-grid{display:grid;grid-template-columns:1fr 1.35fr;gap:10px;}
.form-group.compact{margin-bottom:8px;}
.form-group.compact label{font-size:11px;}
.public-login-grid select{width:100%;height:42px;border:1px solid #dce2ef;border-radius:10px;padding:0 11px;background:#fff;color:#253b61;font-weight:600;}
.passwordless-button{width:100%;height:43px;border:0;border-radius:10px;background:linear-gradient(135deg,#6b2db4,#4f75d9);color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center;gap:9px;cursor:pointer;}
.passwordless-button:disabled{opacity:.45;cursor:not-allowed;}
@media(max-width:650px){.public-login-grid{grid-template-columns:1fr;gap:4px;}}


/* Authentication Gateway V2 */
.passwordless-access{margin-top:22px;padding:17px;border:1px solid rgba(92,57,175,.18);border-radius:18px;background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(242,246,255,.92));box-shadow:0 10px 28px rgba(40,64,110,.07)}
.passwordless-heading{display:flex;align-items:center;gap:11px;margin-bottom:14px;color:#233f70}.passwordless-heading>i{font-size:21px;color:#6b2db4}.passwordless-heading strong{display:block;font-size:14px}.passwordless-heading small{display:block;margin-top:3px;color:#7c879b;font-size:10.5px}
.public-role-cards{display:grid;grid-template-columns:1fr;gap:10px}.public-role-card{min-height:76px;display:flex;align-items:center;gap:10px;padding:11px 10px;border:1px solid #e2e6f0;border-radius:14px;background:#fff;transition:.18s}.public-role-card:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(39,66,116,.10);border-color:#c8c1e7}
.public-role-icon{width:39px;height:39px;flex:0 0 39px;border-radius:12px;display:grid;place-items:center;font-size:17px;color:#fff}.customer-icon{background:linear-gradient(135deg,#6b2db4,#8b55d5)}.visitor-icon{background:linear-gradient(135deg,#236bd4,#4b8cf0)}
.public-role-copy{min-width:0;flex:1}.public-role-copy strong{display:block;color:#263e69;font-size:13px;font-weight:800}.public-role-copy span{display:block;margin-top:3px;color:#8a95a8;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.public-role-login{height:36px;padding:0 11px;border:0;border-radius:9px;color:#fff;background:linear-gradient(135deg,#5f31b5,#276ed7);font-size:11px;font-weight:800;display:inline-flex;align-items:center;gap:6px;cursor:pointer;box-shadow:0 5px 12px rgba(65,73,170,.18);white-space:nowrap}.public-role-login:hover{transform:translateY(-1px);box-shadow:0 7px 15px rgba(65,73,170,.25)}
.public-account-chooser{margin-top:10px;padding:11px;border-radius:12px;background:#f7f8fc;border:1px solid #e1e5ef}.chooser-title{font-size:10px;font-weight:800;color:#63718a;margin-bottom:7px;text-transform:uppercase;letter-spacing:.5px}.public-account-options{display:grid;gap:6px}.public-account-option{width:100%;min-height:38px;padding:7px 9px;border:1px solid #dde2ec;border-radius:9px;background:#fff;color:#29436f;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:11px;font-weight:700}.public-account-option:hover{border-color:#9f8bd0;background:#faf8ff}.public-account-option span{display:flex;align-items:center;gap:7px}.public-account-option span i{font-size:16px;color:#6b2db4}.public-account-option small{color:#8791a4;font-size:9px}.chooser-loading,.chooser-empty{padding:6px;color:#7c879b;font-size:10px;text-align:center}
@media(max-width:720px){.public-role-cards{grid-template-columns:1fr}.public-role-card{min-height:70px}}
