/* CraftGrid One login — visual layer only. Authentication behaviour remains in Login.cshtml/AccountController. */
.cg-login-page {
    --cg-navy: #102d43;
    --cg-green: #18a873;
    --cg-green-dark: #087e5c;
    --cg-purple: #8758dd;
    --cg-blue: #3c9ee9;
    --cg-gold: #e8ae2e;
    --cg-muted: #d8e2e8;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 28px clamp(18px, 4vw, 64px);
    color: #17384d;
    background: #f7faf9;
}

.cg-login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 42%, rgba(24,168,115,.07), transparent 30%), linear-gradient(90deg, rgba(255,255,255,.98), rgba(247,250,249,.94));
    pointer-events: none;
}

.cg-login-shell {
    width: min(1440px, 100%);
    min-height: min(820px, calc(100vh - 40px));
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
    gap: clamp(28px, 4vw, 62px);
    align-items: center;
    position: relative;
    z-index: 1;
}

.cg-login-product {
    min-width: 0;
    min-height: min(760px, calc(100vh - 72px));
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(30px, 4vw, 54px);
    border: 1px solid rgba(11,61,46,.10);
    border-radius: 26px;
    isolation: isolate;
    background: #102a3b;
    box-shadow: 0 24px 55px rgba(16,45,67,.15);
}

.cg-workshop-visual {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: #102a3b;
}

.cg-workshop-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(4,21,33,.94) 0%, rgba(4,21,33,.70) 34%, rgba(4,21,33,.20) 72%, rgba(4,21,33,.48) 100%), linear-gradient(0deg, rgba(3,19,30,.84) 0%, rgba(3,19,30,.05) 58%, rgba(3,19,30,.28) 100%);
}

.cg-workshop-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 58% 50%;
    filter: saturate(.72) contrast(1.08) brightness(.88);
    transform: scale(1.035);
}

.cg-product-header,
.cg-product-intro,
.cg-product-support { position: relative; z-index: 1; }

.cg-product-header { margin-bottom: 20px; }

.cg-login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.cg-login-brand:hover { color: #fff; }

.cg-login-brand-mark {
    width: 39px;
    height: 39px;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 3px;
    padding: 2px;
}

.cg-login-brand-mark i { background: #e9b33a; border-radius: 3px; }

.cg-login-brand-copy { display: flex; flex-direction: column; line-height: 1; }
.cg-login-brand-copy strong { font-size: 30px; font-weight: 800; letter-spacing: -1.6px; }
.cg-login-brand-copy strong span { color: #fff; }
.cg-login-brand-copy strong em { color: var(--cg-green); font-style: normal; font-weight: 800; margin-left: 2px; }
.cg-login-brand-copy small { margin-top: 7px; color: rgba(255,255,255,.72); font-size: 7px; font-weight: 800; letter-spacing: 3px; }
.cg-login-brand-tagline { margin-top: 6px; color: rgba(255,255,255,.62); font-size: 8px; font-weight: 700; letter-spacing: .35px; }

.cg-product-intro { max-width: 620px; margin-top: clamp(22px, 6vh, 54px); }
.cg-eyebrow { margin-bottom: 16px; color: #7ce2b9; font-size: 10px; font-weight: 800; letter-spacing: 3px; }
.cg-product-intro h1 { margin: 0; color: #fff; font-size: clamp(48px, 5.1vw, 76px); line-height: .98; letter-spacing: -3.8px; font-weight: 800; text-shadow: 0 6px 28px rgba(0,0,0,.18); }
.cg-product-intro h1 span { color: #5bd6a1; }
.cg-product-intro p { margin: 22px 0 0; color: rgba(255,255,255,.86); font-size: 18px; line-height: 1.45; }

.cg-product-support { margin-top: auto; padding-top: 38px; }
.cg-module-strip { display: grid; grid-template-columns: repeat(4,1fr); }
.cg-module-item { min-width: 0; padding: 0 17px; display: flex; flex-direction: column; align-items: flex-start; border-right: 1px solid rgba(255,255,255,.18); }
.cg-module-item:first-child { padding-left: 0; }
.cg-module-item:last-child { border-right: 0; }
.cg-module-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 11px; background: rgba(20,168,116,.18); color: #4fe0a5; font-size: 17px; border: 1px solid rgba(91,214,161,.20); }
.cg-module-icon.purple { background: rgba(135,88,221,.18); color: #a77cff; }
.cg-module-icon.blue { background: rgba(60,158,233,.18); color: #6cbcff; }
.cg-module-icon.gold { background: rgba(232,174,46,.17); color: #ffc54f; }
.cg-module-item strong { color: #fff; font-size: 12px; white-space: nowrap; }
.cg-module-item small { margin-top: 4px; color: rgba(255,255,255,.68); font-size: 9px; white-space: nowrap; }

.cg-login-ai-strip { margin-top: 22px; padding: 12px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(85,222,168,.30); border-radius: 14px; background: rgba(2,32,35,.66); backdrop-filter: blur(8px); }
.cg-login-ai-badge { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: rgba(24,168,115,.18); color: #49dda4; font-size: 17px; }
.cg-login-ai-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cg-login-ai-copy strong { color: #fff; font-size: 12px; }
.cg-login-ai-copy strong b { color: #55d7a2; font-weight: 800; }
.cg-login-ai-copy small { color: rgba(255,255,255,.72); font-size: 9px; }
.cg-ai-built { margin-left: auto; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.68); font-size: 8px; line-height: 1.35; white-space: nowrap; }
.cg-ai-built strong { color: #fff; font-size: 10px; }
.cg-product-footer { margin-top: 14px; color: rgba(255,255,255,.58); font-size: 6.5px; letter-spacing: 1.1px; font-weight: 700; }

.cg-login-card {
    width: 100%;
    max-width: 440px;
    justify-self: end;
    padding: 34px 34px 25px;
    border: 1px solid rgba(210,224,229,.9);
    border-radius: 24px;
    background: #fff;
    color: #17384d;
    box-shadow: 0 20px 55px rgba(16,45,67,.16);
}

.cg-login-card-head { text-align: center; margin-bottom: 20px; }
.cg-card-brand { color: #102d43; font-size: 31px; line-height: 1; font-weight: 800; letter-spacing: -1.8px; }
.cg-card-brand span { color: #139b6d; }
.cg-card-brand sup { color: #102d43; font-size: 8px; vertical-align: top; margin-left: 3px; }
.cg-card-tagline { margin-top: 8px; color: #536b7d; font-size: 7px; font-weight: 800; letter-spacing: 3.3px; }
.cg-login-card-head p { margin: 9px 0 0; color: #8394a1; font-size: 11px; }

.cg-login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; margin-bottom: 18px; border-radius: 13px; background: #edf3f1; }
.cg-login-tab { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: #738695; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.cg-login-tab i { margin-right: 5px; }
.cg-login-tab.active { background: #fff; color: #087f5c; box-shadow: 0 3px 12px rgba(35,64,77,.08); }
.cg-login-panels { min-height: 0; }
.cg-login-panel { display: none; }
.cg-login-panel.active { display: block; }
.cg-login-field { margin-bottom: 13px; }
.cg-login-field label { display: block; margin-bottom: 6px; color: #304b5e; font-size: 10px; font-weight: 750; }
.cg-input-wrap { min-height: 48px; display: flex; align-items: center; padding: 0 12px; border: 1px solid #d6e2e5; border-radius: 11px; background: #f5f8fa; transition: .18s ease; }
.cg-input-wrap:focus-within { border-color: #31aa80; box-shadow: 0 0 0 3px rgba(49,170,128,.10); background: #fff; }
.cg-input-wrap > i { flex: 0 0 auto; margin-right: 9px; color: #15996d; font-size: 14px; }
.cg-login-input { min-height: 42px !important; padding: 0 !important; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; color: #173b53; font-size: 12px !important; }
.cg-login-input::placeholder { color: #91a0aa; }
.cg-password-toggle { border: 0; background: transparent; color: #5b7282; padding: 5px; cursor: pointer; }
.cg-login-action-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.cg-secure-hint { color: #7a8d9c; font-size: 9px; }
.cg-secure-hint i { color: #078a63; margin-right: 4px; }
.cg-login-forgot { color: #087f5c; font-size: 10px; font-weight: 650; text-decoration: none; }
.cg-login-forgot:hover { text-decoration: underline; }
.cg-login-submit { min-height: 50px; border: 0; border-radius: 11px; background: #079a6e; font-size: 13px; font-weight: 800; box-shadow: 0 9px 20px rgba(7,143,103,.15); }
.cg-login-submit:hover { background: #087f5c; }
.cg-login-field .form-text { color: #7f929f; font-size: 9px; }
.cg-login-field select.cg-login-input { padding: 0 10px !important; }

.cg-device-box { padding: 20px 15px 17px; border: 1px solid #dceee7; border-radius: 14px; background: linear-gradient(180deg,#f5fcf9,#fff); text-align: center; }
.cg-device-icon { width: 55px; height: 55px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: #e8f7f0; color: #078a63; font-size: 25px; }
.cg-device-box h2 { margin: 0; font-size: 16px; font-weight: 750; color: #173244; }
.cg-device-box p { margin: 6px 0 15px; color: #74879a; font-size: 11px; line-height: 1.5; }
.cg-device-btn { min-height: 45px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.cg-login-security { display: flex; gap: 9px; align-items: flex-start; margin-top: 13px; padding: 9px 11px; border-radius: 11px; background: #f1faf6; color: #647b70; font-size: 9px; line-height: 1.4; }
.cg-login-security > i { color: #078a63; font-size: 14px; }
.cg-login-security strong { display: block; color: #24614d; font-weight: 750; }
.cg-login-security span { display: block; }
.cg-login-footer { margin-top: 13px; text-align: center; color: #94a2ad; font-size: 7px; letter-spacing: 2px; font-weight: 800; }

@media (max-width: 1120px) {
    .cg-login-shell { grid-template-columns: minmax(0,1fr) 400px; gap: 34px; }
    .cg-login-product { min-height: 720px; padding: 34px; }
    .cg-product-intro h1 { font-size: 56px; }
}

@media (max-width: 860px) {
    .cg-login-page { display: block; padding: 0; overflow: visible; background: #f7faf9; }
    .cg-login-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; gap: 0; }
    .cg-login-product { width: 100%; min-height: auto; padding: 28px 20px 22px; border: 0; border-radius: 0; box-shadow: none; }
    .cg-workshop-visual { height: 100%; }
    .cg-workshop-visual img { object-position: 64% 43%; }
    .cg-workshop-visual::after { background: linear-gradient(90deg, rgba(4,21,33,.92), rgba(4,21,33,.46)), linear-gradient(0deg, rgba(3,19,30,.96), rgba(3,19,30,.08) 70%); }
    .cg-product-header { margin: 0; text-align: left; }
    .cg-login-brand-copy strong { font-size: 27px; }
    .cg-product-intro { margin-top: 50px; max-width: 430px; }
    .cg-eyebrow { margin-bottom: 10px; font-size: 9px; }
    .cg-product-intro h1 { font-size: 42px; letter-spacing: -2.5px; }
    .cg-product-intro p { margin-top: 13px; font-size: 13px; }
    .cg-product-support { padding-top: 34px; }
    .cg-module-strip { grid-template-columns: repeat(4,1fr); }
    .cg-module-item { padding: 0 5px; align-items: center; border-right: 0; text-align: center; }
    .cg-module-item:first-child { padding-left: 0; }
    .cg-module-icon { width: 34px; height: 34px; font-size: 14px; margin-bottom: 6px; }
    .cg-module-item strong { font-size: 9px; white-space: normal; }
    .cg-module-item small { display: none; }
    .cg-login-ai-strip { margin-top: 16px; }
    .cg-ai-built { display: none; }
    .cg-product-footer { display: none; }
    .cg-login-card { max-width: none; border-radius: 24px 24px 0 0; padding: 25px 20px 22px; box-shadow: 0 -12px 40px rgba(0,0,0,.18); }
    .cg-login-card-head { margin-bottom: 15px; }
    .cg-card-brand { font-size: 25px; }
    .cg-login-security { margin-top: 10px; }
}

@media (max-width: 430px) {
    .cg-login-product { padding: 22px 15px 18px; }
    .cg-product-intro { margin-top: 38px; }
    .cg-product-intro h1 { font-size: 36px; }
    .cg-product-intro p { font-size: 12px; }
    .cg-product-support { padding-top: 27px; }
    .cg-login-ai-strip { padding: 10px 11px; gap: 9px; }
    .cg-login-ai-badge { width: 34px; height: 34px; }
    .cg-login-ai-copy strong { font-size: 10px; }
    .cg-login-ai-copy small { font-size: 8px; }
    .cg-login-card { padding: 22px 15px 18px; }
    .cg-login-tabs { margin-bottom: 14px; }
    .cg-login-tab { min-height: 40px; font-size: 10px; }
    .cg-login-field { margin-bottom: 11px; }
    .cg-input-wrap { min-height: 45px; }
    .cg-login-submit { min-height: 47px; }
}


/* ============================================================
   Approved login composition — full-bleed desktop experience
   Visual-only refinement; authentication endpoints/validation are unchanged.
   ============================================================ */
@media (min-width: 861px) {
    .cg-login-page {
        min-height: 100vh;
        height: 100vh;
        padding: 0;
        overflow: hidden;
        background: #f7faf9;
        display: block;
    }

    .cg-login-page::before { display: none; }

    .cg-login-shell {
        width: 100%;
        max-width: none;
        height: 100vh;
        min-height: 0;
        margin: 0;
        display: grid;
        grid-template-columns: minmax(0, 64.5vw) minmax(520px, 35.5vw);
        gap: 0;
        align-items: stretch;
    }

    .cg-login-product {
        width: 100%;
        height: 100vh;
        min-height: 0;
        padding: 58px clamp(48px, 5vw, 88px) 34px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .cg-workshop-visual::after {
        background:
            linear-gradient(90deg, rgba(3,20,31,.90) 0%, rgba(3,20,31,.66) 36%, rgba(3,20,31,.18) 78%, rgba(3,20,31,.42) 100%),
            linear-gradient(0deg, rgba(3,19,30,.90) 0%, rgba(3,19,30,.08) 62%, rgba(3,19,30,.28) 100%);
    }

    .cg-workshop-visual img {
        object-position: center center;
        filter: saturate(.82) contrast(1.02) brightness(.88);
        transform: scale(1.01);
    }

    .cg-product-header { margin-bottom: 0; }
    .cg-login-brand-copy strong { font-size: clamp(29px, 2.25vw, 36px); }
    .cg-login-brand-mark { width: 40px; height: 40px; }

    .cg-product-intro {
        max-width: 650px;
        margin-top: clamp(45px, 8vh, 78px);
    }

    .cg-product-intro h1 {
        font-size: clamp(58px, 5.15vw, 84px);
        letter-spacing: -4.5px;
        line-height: .94;
    }

    .cg-product-intro p { margin-top: 24px; font-size: 19px; }
    .cg-product-support { padding-top: 28px; }

    .cg-module-item { padding-left: 20px; padding-right: 20px; }
    .cg-module-item:first-child { padding-left: 0; }
    .cg-module-item strong { font-size: 13px; }
    .cg-module-item small { font-size: 10px; }

    .cg-login-ai-strip { margin-top: 20px; padding: 13px 16px; }
    .cg-product-footer { margin-top: 9px; }

    .cg-login-card {
        width: min(510px, calc(100% - 64px));
        max-width: 510px;
        justify-self: center;
        align-self: center;
        padding: 42px 46px 31px;
        border-radius: 27px;
        box-shadow: 0 22px 65px rgba(16,45,67,.14);
    }

    .cg-login-card-head { margin-bottom: 22px; }
    .cg-card-brand { font-size: 35px; }
    .cg-card-tagline { margin-top: 9px; font-size: 7px; }
    .cg-login-card-head p { margin-top: 11px; font-size: 12px; }
    .cg-login-tabs { margin-bottom: 21px; }
    .cg-login-tab { min-height: 47px; font-size: 12px; }
    .cg-login-field { margin-bottom: 15px; }
    .cg-login-field label { font-size: 11px; }
    .cg-input-wrap { min-height: 51px; border-radius: 12px; }
    .cg-login-input { font-size: 13px !important; }
    .cg-login-action-row { margin-top: 3px; margin-bottom: 15px; }
    .cg-login-submit { min-height: 53px; font-size: 14px; }
    .cg-login-submit-arrow { margin-left: 10px; font-size: 19px; line-height: 0; vertical-align: -1px; }

    .cg-login-or {
        display: flex;
        align-items: center;
        gap: 11px;
        margin: 15px 0 14px;
        color: #93a2ad;
        font-size: 9px;
        letter-spacing: 1.8px;
        font-weight: 800;
    }
    .cg-login-or span { height: 1px; flex: 1; background: #e3eaed; }
    .cg-login-or b { font-weight: 800; }

    .cg-device-shortcut {
        min-height: 51px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border: 1px solid #d7e2e6;
        border-radius: 12px;
        color: #087f5c;
        background: #fff;
        text-decoration: none;
        font-size: 12px;
        font-weight: 750;
    }
    .cg-device-shortcut:hover { color: #087f5c; background: #f7fbf9; }
    .cg-device-shortcut i { font-size: 17px; }

    .cg-login-security { margin-top: 14px; padding: 10px 12px; }
    .cg-login-footer { margin-top: 14px; }
}

@media (max-width: 1200px) and (min-width: 861px) {
    .cg-login-shell { grid-template-columns: minmax(0, 62vw) minmax(440px, 38vw); }
    .cg-login-product { padding-left: 48px; padding-right: 48px; }
    .cg-login-card { width: min(440px, calc(100% - 38px)); padding-left: 34px; padding-right: 34px; }
    .cg-product-intro h1 { font-size: 58px; letter-spacing: -3.2px; }
}

@media (max-width: 860px) {
    .cg-login-or, .cg-device-shortcut { display: none; }
}


/* ============================================================
   Approved composition correction — shared full-bleed background
   The factory photo fills the complete login viewport. The right
   login card floats directly over it; there is no separate white
   page/column behind the card.
   ============================================================ */
@media (min-width: 861px) {
    .cg-login-page {
        background-color: #102a3b;
        background-image:
            linear-gradient(90deg, rgba(3,20,31,.91) 0%, rgba(3,20,31,.70) 36%, rgba(3,20,31,.24) 68%, rgba(3,20,31,.42) 100%),
            linear-gradient(0deg, rgba(3,19,30,.88) 0%, rgba(3,19,30,.08) 62%, rgba(3,19,30,.28) 100%),
            url('https://www.iespk.com/images/projects/food-processing.jpg');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }

    .cg-login-page::before {
        display: none;
    }

    .cg-login-shell {
        position: relative;
        z-index: 1;
        background: transparent;
    }

    .cg-login-product {
        background: transparent;
        overflow: visible;
        box-shadow: none;
    }

    .cg-workshop-visual {
        display: none;
    }

    .cg-login-card {
        width: min(510px, calc(100% - 64px));
        max-width: 510px;
        justify-self: center;
        align-self: center;
        margin: 0;
        padding: 42px 46px 31px;
        border-radius: 27px;
        background: #fff;
        box-shadow: 0 22px 65px rgba(16,45,67,.20);
    }

    /* The approved mockup has no photo-reference caption. */
    .cg-product-footer {
        display: none;
    }
}

/* ============================================================
   Final approved-login refinements
   - Larger CraftGrid One logo mark on desktop
   - CraftGrid Intelligence strip sits beneath the login card
     on desktop, rather than across the product panel
   - Authentication markup/logic unchanged
   ============================================================ */
@media (min-width: 861px) {
    .cg-login-brand-mark {
        width: 52px;
        height: 52px;
        gap: 4px;
        padding: 3px;
    }

    .cg-login-brand-mark i { border-radius: 4px; }

    .cg-login-ai-strip {
        position: fixed;
        z-index: 5;
        left: auto;
        right: 3.25vw;
        bottom: 28px;
        width: min(510px, calc(35.5vw - 64px));
        margin-top: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 1200px) and (min-width: 861px) {
    .cg-login-ai-strip {
        right: 19px;
        width: min(440px, calc(38vw - 38px));
    }
}

/* ============================================================
   Mobile approved composition
   Hero content first -> login card -> business areas/intelligence.
   The authentication markup and behaviour remain unchanged.
   ============================================================ */
.cg-mobile-support { display: none; }

@media (max-width: 860px) {
    .cg-login-page {
        min-height: 100vh;
        height: auto;
        overflow: visible;
        background: #f7faf9;
    }

    .cg-login-shell {
        min-height: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Only the branding + headline live in the hero on mobile. */
    .cg-login-product {
        order: 1;
        width: 100%;
        min-height: 0;
        padding: 24px 18px 30px;
        flex: 0 0 auto;
    }

    .cg-login-product .cg-product-support { display: none; }

    .cg-product-header { margin: 0; }
    .cg-login-brand { gap: 10px; }
    .cg-login-brand-mark { width: 44px; height: 44px; gap: 3px; padding: 2px; }
    .cg-login-brand-copy strong { font-size: 27px; }
    .cg-login-brand-copy small { font-size: 6px; letter-spacing: 2.4px; }
    .cg-login-brand-tagline { font-size: 7px; }

    .cg-product-intro {
        margin-top: 34px;
        max-width: 100%;
    }

    .cg-eyebrow { margin-bottom: 9px; font-size: 8px; letter-spacing: 2.5px; }
    .cg-product-intro h1 {
        font-size: clamp(38px, 10.5vw, 50px);
        line-height: .96;
        letter-spacing: -2.8px;
    }
    .cg-product-intro p { margin-top: 12px; font-size: 13px; }

    .cg-login-card {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 26px 18px 22px;
        border-radius: 24px;
        border: 1px solid #dbe5e8;
        box-shadow: 0 12px 34px rgba(16,45,67,.12);
        box-sizing: border-box;
    }

    .cg-login-card-head { margin-bottom: 16px; }
    .cg-card-brand { font-size: 27px; }
    .cg-card-tagline { margin-top: 7px; font-size: 6.5px; letter-spacing: 3px; }
    .cg-login-card-head p { margin-top: 8px; font-size: 11px; }

    .cg-login-tabs { margin-bottom: 16px; }
    .cg-login-tab { min-height: 44px; font-size: 11px; }
    .cg-login-field { margin-bottom: 12px; }
    .cg-input-wrap { min-height: 47px; }
    .cg-login-submit { min-height: 49px; }

    /* Keep the approved device alternative visible on mobile. */
    .cg-login-or,
    .cg-device-shortcut { display: flex; }
    .cg-login-or { margin: 14px 0 13px; }

    .cg-mobile-support {
        order: 3;
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 24px 18px 28px;
        background: #102a3b;
        position: relative;
        overflow: hidden;
    }

    .cg-mobile-support::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(3,20,31,.14), rgba(3,20,31,.42));
        pointer-events: none;
    }

    .cg-mobile-support > * { position: relative; z-index: 1; }
    .cg-mobile-support .cg-module-strip { grid-template-columns: repeat(4, 1fr); }
    .cg-mobile-support .cg-module-item {
        padding: 0 4px;
        align-items: center;
        text-align: center;
        border-right: 0;
    }
    .cg-mobile-support .cg-module-icon { width: 34px; height: 34px; margin-bottom: 6px; font-size: 14px; }
    .cg-mobile-support .cg-module-item strong { font-size: 9px; white-space: normal; }
    .cg-mobile-support .cg-module-item small { display: block; font-size: 8px; white-space: normal; text-align: center; }
    .cg-mobile-support .cg-login-ai-strip { margin-top: 18px; }
    .cg-mobile-support .cg-ai-built { display: none; }
}

@media (max-width: 430px) {
    .cg-login-product { padding: 20px 15px 26px; }
    .cg-login-brand-mark { width: 42px; height: 42px; }
    .cg-login-brand-copy strong { font-size: 25px; }
    .cg-product-intro { margin-top: 30px; }
    .cg-product-intro h1 { font-size: 38px; }
    .cg-login-card { padding: 23px 15px 20px; }
    .cg-mobile-support { padding: 22px 12px 26px; }
    .cg-mobile-support .cg-module-item strong { font-size: 8.5px; }
    .cg-mobile-support .cg-module-item small { font-size: 7.5px; }
}


/* ============================================================
   FINAL LOGIN LAYOUT — desktop + mobile cleanup
   Keep authentication markup/behaviour unchanged.
   ============================================================ */

@media (min-width: 861px) {
    .cg-login-page {
        height: 100vh;
        min-height: 100vh;
        padding: 0;
        overflow: hidden;
        background: #102a3b;
    }

    .cg-login-shell {
        width: 100%;
        height: 100vh;
        min-height: 0;
        display: grid;
        grid-template-columns: 64.5% 35.5%;
        gap: 0;
        margin: 0;
    }

    .cg-login-product {
        height: 100vh;
        min-height: 0;
        box-sizing: border-box;
        padding: 58px clamp(48px, 5vw, 88px) 34px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        overflow: hidden;
    }

    .cg-login-product .cg-workshop-visual { display: block; }
    .cg-login-product .cg-product-support { display: flex; flex-direction: column; }
    .cg-login-product .cg-login-ai-strip { position: static; width: auto; }

    /* The approved desktop composition keeps the Intelligence strip on the
       left hero, so it never collides with the login card. */
    .cg-login-card {
        width: min(510px, calc(100% - 64px));
        max-width: 510px;
        box-sizing: border-box;
        justify-self: center;
        align-self: center;
        margin: 0;
        padding: 34px 38px 25px;
        border-radius: 27px;
    }

    .cg-login-card-head { margin-bottom: 18px; }
    .cg-card-brand { font-size: 34px; }
    .cg-login-tabs { margin-bottom: 17px; }
    .cg-login-tab { min-height: 45px; }
    .cg-login-field { margin-bottom: 12px; }
    .cg-input-wrap { min-height: 48px; }
    .cg-login-action-row { margin-bottom: 12px; }
    .cg-login-submit { min-height: 50px; }
    .cg-login-or { margin: 12px 0 11px; }
    .cg-device-shortcut { min-height: 48px; }
    .cg-login-security { margin-top: 11px; padding: 9px 11px; }
    .cg-login-footer { margin-top: 10px; }
}

@media (max-width: 860px) {
    .cg-login-page {
        min-height: 100vh;
        height: auto;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        background: #102a3b;
    }

    .cg-login-shell {
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Compact hero: enough space for branding and message, but no huge
       desktop-style empty area before the login card. */
    .cg-login-product {
        order: 1;
        width: 100%;
        height: auto;
        min-height: 0;
        flex: none;
        box-sizing: border-box;
        padding: 24px 18px 28px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        background: transparent;
    }

    .cg-login-product .cg-workshop-visual {
        display: block;
        height: 100%;
    }

    .cg-workshop-visual img {
        object-position: 62% 40%;
    }

    .cg-product-header { margin: 0; }
    .cg-login-brand { gap: 10px; }
    .cg-login-brand-mark { width: 46px; height: 46px; gap: 3px; padding: 2px; }
    .cg-login-brand-copy strong { font-size: 27px; }

    .cg-product-intro {
        margin-top: 34px;
        max-width: 100%;
    }

    .cg-eyebrow { margin-bottom: 9px; }
    .cg-product-intro h1 {
        font-size: clamp(38px, 10vw, 48px);
        line-height: .96;
        letter-spacing: -2.6px;
    }
    .cg-product-intro p { margin-top: 12px; font-size: 13px; }

    /* Desktop support is hidden here; mobile gets a clean dedicated section
       after the complete login card. */
    .cg-login-product .cg-product-support { display: none; }

    .cg-login-card {
        order: 2;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        margin: 0;
        padding: 24px 18px 22px;
        border-radius: 24px 24px 0 0;
        border: 1px solid #dbe5e8;
        box-shadow: 0 -8px 28px rgba(0,0,0,.14);
        background: #fff;
    }

    .cg-login-card-head { margin-bottom: 15px; }
    .cg-card-brand { font-size: 27px; }
    .cg-login-tabs { margin-bottom: 15px; }
    .cg-login-field { margin-bottom: 11px; }
    .cg-input-wrap { min-height: 46px; }
    .cg-login-submit { min-height: 48px; }
    .cg-login-or, .cg-device-shortcut { display: flex; }
    .cg-login-or { margin: 13px 0 12px; }
    .cg-device-shortcut { min-height: 46px; }

    .cg-mobile-support {
        order: 3;
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 24px 16px 28px;
        background: #102a3b;
        position: relative;
    }

    .cg-mobile-support::before { display: none; }
    .cg-mobile-support .cg-module-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 18px 8px;
    }
    .cg-mobile-support .cg-module-item {
        padding: 0 4px;
        align-items: center;
        text-align: center;
        border-right: 0;
    }
    .cg-mobile-support .cg-module-icon { width: 36px; height: 36px; margin-bottom: 7px; }
    .cg-mobile-support .cg-module-item strong { font-size: 10px; white-space: normal; }
    .cg-mobile-support .cg-module-item small { display: block; font-size: 8px; white-space: normal; }
    .cg-mobile-support .cg-login-ai-strip {
        position: static;
        width: 100%;
        margin-top: 22px;
        box-sizing: border-box;
    }
    .cg-mobile-support .cg-ai-built { display: none; }
}

@media (max-width: 430px) {
    .cg-login-product { padding: 20px 15px 24px; }
    .cg-login-brand-mark { width: 43px; height: 43px; }
    .cg-login-brand-copy strong { font-size: 25px; }
    .cg-product-intro { margin-top: 30px; }
    .cg-product-intro h1 { font-size: 37px; }
    .cg-product-intro p { font-size: 12px; }
    .cg-login-card { padding: 22px 15px 20px; }
    .cg-mobile-support { padding: 22px 12px 26px; }
}


/* ============================================================
   AUTHORITATIVE FINAL LOGIN FIX
   1) Desktop: the factory photograph must cover the COMPLETE viewport,
      including behind the login card. No dark/empty right column.
   2) Mobile: keep the hero compact and do not carry the desktop support
      content into the hero. Login follows immediately; support follows login.
   ============================================================ */
@media (min-width: 861px) {
    .cg-login-page {
        position: relative;
        background-color: #102a3b;
        background-image:
            linear-gradient(90deg, rgba(3,20,31,.90) 0%, rgba(3,20,31,.68) 36%, rgba(3,20,31,.24) 70%, rgba(3,20,31,.42) 100%),
            linear-gradient(0deg, rgba(3,19,30,.86) 0%, rgba(3,19,30,.10) 64%, rgba(3,19,30,.28) 100%),
            url('https://www.iespk.com/images/projects/food-processing.jpg');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }

    .cg-login-page::before { display: none !important; }
    .cg-login-product { background: transparent !important; }
    .cg-login-product .cg-workshop-visual { display: none !important; }

    /* Keep the card floating over the photograph, with no dark column behind it. */
    .cg-login-card {
        z-index: 3;
        position: relative;
    }

    /* Intelligence remains in the approved left-hero footer position. */
    .cg-login-product .cg-login-ai-strip {
        position: static !important;
        width: auto !important;
        margin-top: 20px !important;
    }
}

@media (max-width: 860px) {
    /* Mobile hero is intentionally only the branding + message. */
    .cg-login-product {
        padding: 20px 15px 22px !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .cg-login-product .cg-product-support,
    .cg-login-product .cg-login-ai-strip,
    .cg-login-product .cg-module-strip,
    .cg-login-product .cg-product-footer {
        display: none !important;
    }

    .cg-product-intro {
        margin-top: 28px !important;
    }

    .cg-product-intro h1 {
        font-size: clamp(35px, 9.8vw, 44px) !important;
        line-height: .97 !important;
        letter-spacing: -2.3px !important;
    }

    .cg-product-intro p {
        margin-top: 11px !important;
        font-size: 12px !important;
    }

    .cg-login-card {
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -5px 22px rgba(0,0,0,.12) !important;
    }

    /* The lower business-area section is the only place for the modules and AI strip. */
    .cg-mobile-support {
        display: block !important;
    }
}

/* ============================================================
   MOBILE-ONLY FINAL POLISH
   Do not alter desktop composition or authentication behaviour.
   Fixes:
   - OR divider was missing on mobile because its shared styling was
     previously scoped to desktop.
   - Device shortcut inherited the browser's default blue link styling.
   - Tighten the mobile login card so the form feels like one deliberate
     card instead of a desktop card squeezed into a phone.
   ============================================================ */
@media (max-width: 860px) {
    .cg-login-card {
        width: 100%;
        max-width: none;
        padding: 22px 16px 20px !important;
        border-radius: 22px 22px 0 0 !important;
        box-sizing: border-box;
        overflow: hidden;
    }

    .cg-login-card-head {
        margin-bottom: 14px !important;
    }

    .cg-card-brand {
        font-size: 26px !important;
        letter-spacing: -1.4px;
    }

    .cg-card-tagline {
        margin-top: 6px !important;
        font-size: 6px !important;
        letter-spacing: 2.8px !important;
    }

    .cg-login-card-head p {
        margin-top: 7px !important;
        font-size: 10px !important;
    }

    .cg-login-tabs {
        gap: 3px;
        padding: 4px;
        margin-bottom: 14px !important;
        border-radius: 13px;
    }

    .cg-login-tab {
        min-height: 42px !important;
        border-radius: 10px;
        font-size: 10.5px !important;
    }

    .cg-login-field {
        margin-bottom: 10px !important;
    }

    .cg-login-field label {
        margin-bottom: 5px;
        font-size: 10px;
    }

    .cg-input-wrap {
        min-height: 45px !important;
        padding: 0 10px;
        border-radius: 11px;
    }

    .cg-login-input {
        min-height: 40px !important;
        font-size: 12px !important;
    }

    .cg-login-action-row {
        margin: 1px 0 11px !important;
    }

    .cg-secure-hint,
    .cg-login-forgot {
        font-size: 9px !important;
    }

    .cg-login-submit {
        min-height: 47px !important;
        border-radius: 10px;
        font-size: 12.5px !important;
    }

    /* Shared mobile OR divider — keep the horizontal rules visible. */
    .cg-login-or {
        display: flex !important;
        align-items: center;
        gap: 9px;
        width: 100%;
        margin: 12px 0 10px !important;
        color: #8d9da8;
        font-size: 9px;
        line-height: 1;
        letter-spacing: 1.5px;
        font-weight: 800;
    }

    .cg-login-or span {
        display: block;
        height: 1px;
        flex: 1 1 auto;
        background: #e2e9ec;
    }

    .cg-login-or b {
        display: block;
        font-weight: 800;
    }

    /* The device alternative is a proper secondary button on mobile,
       not an unstyled hyperlink. */
    .cg-device-shortcut {
        min-height: 46px;
        width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 9px;
        box-sizing: border-box;
        padding: 0 12px;
        border: 1px solid #d7e2e6;
        border-radius: 11px;
        background: #fff;
        color: #087f5c !important;
        text-decoration: none !important;
        font-size: 11px;
        font-weight: 750;
    }

    .cg-device-shortcut:hover,
    .cg-device-shortcut:focus {
        color: #087f5c !important;
        background: #f7fbf9;
        text-decoration: none !important;
    }

    .cg-device-shortcut i {
        font-size: 16px;
        flex: 0 0 auto;
    }

    .cg-login-security {
        margin-top: 10px !important;
        padding: 8px 10px !important;
        border-radius: 10px;
        font-size: 8px;
    }

    .cg-login-security > i {
        font-size: 13px;
    }

    .cg-login-footer {
        margin-top: 10px !important;
        font-size: 6.5px;
        letter-spacing: 1.7px;
    }

    /* Keep the post-login marketing section visually separate from the
       white login card. */
    .cg-mobile-support {
        border-top: 0;
        padding: 22px 14px 26px !important;
    }

    .cg-mobile-support .cg-module-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 8px;
    }

    .cg-mobile-support .cg-module-item strong {
        font-size: 9.5px;
    }

    .cg-mobile-support .cg-module-item small {
        margin-top: 3px;
        font-size: 7.5px;
    }

    .cg-mobile-support .cg-login-ai-strip {
        margin-top: 20px !important;
        min-height: 55px;
        padding: 10px 12px;
        border-radius: 12px;
        box-sizing: border-box;
    }
}

/* ============================================================
   MOBILE COMPACT FINAL PASS
   Mobile-only. Desktop composition and authentication are untouched.
   Goal: keep the complete sign-in card compact and readable on small
   320-430px viewports, then continue naturally to business areas.
   ============================================================ */
@media (max-width: 860px) {
    .cg-login-page {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .cg-login-product {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 18px 15px 20px !important;
    }

    .cg-login-brand {
        gap: 8px;
    }

    .cg-login-brand-mark {
        width: 40px !important;
        height: 40px !important;
        gap: 3px;
        padding: 2px;
    }

    .cg-login-brand-copy strong {
        font-size: 24px !important;
        letter-spacing: -1.2px;
    }

    .cg-login-brand-copy small {
        margin-top: 5px;
        font-size: 5.5px;
        letter-spacing: 2.1px;
    }

    .cg-login-brand-tagline {
        margin-top: 4px;
        font-size: 6.5px;
    }

    .cg-product-intro {
        margin-top: 24px !important;
    }

    .cg-eyebrow {
        margin-bottom: 7px !important;
        font-size: 7.5px !important;
        letter-spacing: 2.2px !important;
    }

    .cg-product-intro h1 {
        font-size: clamp(34px, 10vw, 43px) !important;
        line-height: .94 !important;
        letter-spacing: -2.2px !important;
    }

    .cg-product-intro p {
        margin-top: 9px !important;
        font-size: 11.5px !important;
    }

    .cg-login-card {
        flex: 0 0 auto !important;
        padding: 18px 14px 16px !important;
        border-radius: 21px 21px 0 0 !important;
        overflow: visible !important;
    }

    .cg-login-card-head {
        margin-bottom: 11px !important;
    }

    .cg-card-brand {
        font-size: 24px !important;
        letter-spacing: -1.3px !important;
    }

    .cg-card-brand sup {
        font-size: 6px;
    }

    .cg-card-tagline {
        margin-top: 5px !important;
        font-size: 5.5px !important;
        letter-spacing: 2.5px !important;
    }

    .cg-login-card-head p {
        margin-top: 6px !important;
        font-size: 9.5px !important;
    }

    .cg-login-tabs {
        margin-bottom: 11px !important;
        padding: 3px !important;
        border-radius: 11px !important;
    }

    .cg-login-tab {
        min-height: 38px !important;
        border-radius: 9px !important;
        font-size: 10px !important;
    }

    .cg-login-field {
        margin-bottom: 8px !important;
    }

    .cg-login-field label {
        margin-bottom: 4px !important;
        font-size: 9px !important;
    }

    .cg-input-wrap {
        min-height: 42px !important;
        padding: 0 9px !important;
        border-radius: 10px !important;
    }

    .cg-input-wrap > i {
        margin-right: 7px;
        font-size: 13px;
    }

    .cg-login-input {
        min-height: 38px !important;
        font-size: 11.5px !important;
    }

    .cg-password-toggle {
        padding: 3px;
    }

    .cg-login-action-row {
        margin: 0 0 9px !important;
    }

    .cg-secure-hint,
    .cg-login-forgot {
        font-size: 8.5px !important;
    }

    .cg-login-submit {
        min-height: 43px !important;
        border-radius: 9px !important;
        font-size: 12px !important;
    }

    .cg-login-or {
        margin: 8px 0 8px !important;
        gap: 7px !important;
        font-size: 8px !important;
        letter-spacing: 1.2px !important;
    }

    .cg-device-shortcut {
        min-height: 41px !important;
        padding: 0 9px !important;
        border-radius: 9px !important;
        gap: 7px !important;
        font-size: 10px !important;
        color: #087f5c !important;
        text-decoration: none !important;
    }

    .cg-device-shortcut i {
        font-size: 14px !important;
    }

    .cg-login-security {
        margin-top: 8px !important;
        padding: 7px 8px !important;
        border-radius: 9px !important;
        gap: 7px;
        font-size: 7.5px !important;
        line-height: 1.3 !important;
    }

    .cg-login-security > i {
        font-size: 12px !important;
    }

    .cg-login-footer {
        margin-top: 8px !important;
        font-size: 6px !important;
        letter-spacing: 1.5px !important;
    }

    .cg-mobile-support {
        padding: 20px 12px 24px !important;
    }
}

@media (max-width: 350px) {
    .cg-login-product {
        padding: 15px 12px 17px !important;
    }

    .cg-login-brand-mark {
        width: 38px !important;
        height: 38px !important;
    }

    .cg-login-brand-copy strong {
        font-size: 22px !important;
    }

    .cg-product-intro {
        margin-top: 20px !important;
    }

    .cg-product-intro h1 {
        font-size: 33px !important;
    }

    .cg-product-intro p {
        font-size: 10.5px !important;
    }

    .cg-login-card {
        padding: 16px 12px 14px !important;
    }

    .cg-card-brand {
        font-size: 22px !important;
    }

    .cg-login-tabs {
        margin-bottom: 9px !important;
    }

    .cg-login-tab {
        min-height: 36px !important;
        font-size: 9.5px !important;
    }

    .cg-input-wrap {
        min-height: 40px !important;
    }

    .cg-login-submit {
        min-height: 41px !important;
    }

    .cg-device-shortcut {
        min-height: 39px !important;
    }
}
