/* =====================================================================
   PCAMS - Login page (pcams.aspx) look & feel. Presentation only.
   Targets existing markup by tag / id / src; responsive for laptop + desktop.
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: #eef3f9 !important;
    font-family: "Segoe UI", Calibri, Arial, sans-serif;
    color: #1f2d3d;
}
form#form1 > table { border-collapse: collapse; border-spacing: 0; }

/* ---------- Header banner ---------- */
table.page {
    background: #0f4c8a !important;
    background: linear-gradient(100deg, #071f3d 0%, #0f4c8a 60%, #1a72b8 100%) !important;
    border-bottom: 4px solid #f2a900;
    box-shadow: 0 3px 10px rgba(7, 31, 61, .30);
}
table.page td { white-space: normal !important; height: auto !important; padding: 16px clamp(14px, 3vw, 40px) !important; }
table.page h1 {
    margin: 0;
    color: #ffffff !important;
    font: 600 clamp(15px, 1.9vw, 26px)/1.35 "Segoe UI", Calibri, Arial, sans-serif;
    letter-spacing: .6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* ---------- Three refinery pictures: fluid, equal height ---------- */
td:has(> img[src*="refinery" i]) {
    display: flex !important;
    gap: 4px;
    width: 100% !important;
    padding: 0 !important;
    overflow: hidden;
    background: #071f3d;
    border-bottom: 4px solid #f2a900;
}
td:has(> img[src*="refinery" i]) > img {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    height: clamp(120px, 20vw, 260px) !important;
    object-fit: cover;
    display: block;
    transition: transform .5s ease, filter .3s ease;
    filter: saturate(1.05);
}
td:has(> img[src*="refinery-1" i]) > img[src*="refinery-1" i] { flex-grow: 1.5; }
td:has(> img[src*="refinery" i]) > img:hover { transform: scale(1.04); filter: saturate(1.2) brightness(1.05); }

/* ---------- Content row: intro text + sign-in card ---------- */
tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: clamp(16px, 3vw, 44px);
    width: 100% !important;
    box-sizing: border-box;
    padding: clamp(16px, 3vw, 36px) clamp(14px, 4vw, 56px);
}
tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) > td {
    display: block !important;
    height: auto !important;
}
tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) > td[style*="width: 3px"] { display: none !important; }
tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) > td:nth-child(2) { flex: 1 1 380px; min-width: 0; }
tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) > td:last-child { flex: 0 0 auto; }

/* intro text */
td:has(> span > font) {
    background: #fff;
    border: 1px solid #d5e1f0;
    border-left: 5px solid #f2a900;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(10, 47, 92, .10);
    padding: clamp(14px, 2vw, 26px) !important;
    box-sizing: border-box;
}
td:has(> span > font) font {
    font-family: "Segoe UI", Calibri, Arial, sans-serif !important;
    font-size: clamp(13px, 1.05vw, 16px) !important;
    line-height: 1.75;
    color: #2b3a4d;
    text-align: left;
}
td:has(> span > font) b { color: #0a2f5c !important; font-family: inherit !important; font-size: 1.25em; display: inline-block; border-bottom: 3px solid #f2a900; padding-bottom: 4px; }

/* ---------- Sign-in card ---------- */
table:has(> tbody > tr > td > strong > [id$="lblHead"]) {
    display: block !important;
    width: clamp(290px, 26vw, 380px) !important;
    max-width: 100%;
    position: static !important;
    top: auto !important; left: auto !important;
    background: #fff;
    border: 1px solid #d5e1f0;
    border-top: 5px solid #0f4c8a;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(10, 47, 92, .20);
    padding: 0 0 18px;
    box-sizing: border-box;
    overflow: hidden;
}
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody,
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr,
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
    background: transparent !important;
    text-align: left;
}
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr > td { padding: 6px 22px !important; }
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr:first-child > td {
    padding: 14px 22px !important;
    margin-bottom: 8px;
    background: linear-gradient(100deg, #0a2f5c, #0f4c8a) !important;
}
span[id$="lblHead"] {
    color: #fff !important;
    font: 700 17px "Segoe UI", Calibri, Arial, sans-serif !important;
    letter-spacing: 1.2px; height: auto !important;
}
span[id$="lblUserid"], span[id$="lblPwd"] {
    display: block; width: auto !important;
    color: #0a3d75 !important;
    font: 600 12.5px "Segoe UI", Calibri, Arial, sans-serif !important;
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px;
}
input[id$="txtEmpno"], input[id$="txtPwd"], input[id$="txtVerificationCode"] {
    width: 100% !important;
    box-sizing: border-box;
    height: 40px;
    padding: 8px 12px;
    font: 500 14px "Segoe UI", Calibri, Arial, sans-serif !important;
    color: #1f2d3d;
    background: #f7faff;
    border: 1px solid #b9c9dd;
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input[id$="txtEmpno"]:focus, input[id$="txtPwd"]:focus, input[id$="txtVerificationCode"]:focus {
    outline: none; background: #fff; border-color: #0f4c8a; box-shadow: 0 0 0 3px rgba(26, 111, 181, .25);
}
/* captcha */
table[id$="tbl_captcha"] { width: 100%; }
table[id$="tbl_captcha"] td { background: transparent !important; padding: 4px 0 !important; font-size: 12.5px; font-weight: 600; color: #0a3d75; }
img[id$="img_captcha"] {
    width: calc(100% - 38px) !important; max-width: 220px; height: auto !important;
    border: 1px solid #cfdbeb; border-radius: 6px; vertical-align: middle; background: #fff;
}
img[id$="img_refresh"] {
    width: 26px !important; height: 26px !important; vertical-align: middle;
    border-radius: 50% !important; padding: 3px; background: #e7f0fb; cursor: pointer; transition: transform .3s;
}
img[id$="img_refresh"]:hover { transform: rotate(180deg); background: #d3e6fa; }
/* messages */
span[id$="lblError"] {
    display: block; width: auto !important;
    font: 600 12.5px "Segoe UI", Calibri, Arial, sans-serif !important;
    color: #b3261e !important;
}
span[id$="lblError"]:empty { display: none; }
/* login button */
input[id$="btnLogin"] {
    width: 100% !important; height: 42px;
    margin: 6px 0 10px;
    font: 700 15px "Segoe UI", Calibri, Arial, sans-serif !important;
    letter-spacing: .8px; text-transform: uppercase;
    color: #fff !important;
    background: linear-gradient(#1a6fb5, #0f4c8a) !important;
    border: 1px solid #0a2f5c; border-radius: 8px;
    box-shadow: 0 3px 8px rgba(15, 76, 138, .35);
    cursor: pointer; transition: all .15s;
}
input[id$="btnLogin"]:hover { background: linear-gradient(#0f4c8a, #0a2f5c) !important; box-shadow: 0 5px 12px rgba(10, 47, 92, .45); }
input[id$="btnLogin"]:active { transform: translateY(1px); }
span[id$="Label1"] {
    display: block; width: auto !important; text-align: center;
    font: 600 11.5px "Segoe UI", Calibri, Arial, sans-serif !important;
    color: #8a4b00 !important; background: #fff6df; border-radius: 6px; padding: 6px 8px;
}

/* ---------- Footer ---------- */
table#TABLE2 { background: #fff; border-top: 1px solid #d5e1f0; margin-top: 8px; }
table#TABLE2 td { padding: 10px clamp(14px, 3vw, 40px) !important; height: auto !important; }
table#TABLE2 img[src*="eil_logo" i] { width: auto !important; height: clamp(26px, 3vw, 38px) !important; max-width: 100%; }
table#TABLE2 .myLoginInfo, table#TABLE2 div[style*="text-align"] {
    font: 500 12px "Segoe UI", Calibri, Arial, sans-serif !important; color: #5a6b80 !important;
}

/* ---------- Small laptop / narrow windows ---------- */
@media (max-width: 1100px) {
    tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) > td:nth-child(2) { flex-basis: 320px; }
}
@media (max-width: 860px) {
    tr:has(> td > table > tbody > tr > td > strong > [id$="lblHead"]) { flex-direction: column; align-items: stretch; }
    table:has(> tbody > tr > td > strong > [id$="lblHead"]) { width: 100% !important; max-width: 420px; margin: 0 auto; }
    td:has(> img[src*="refinery" i]) > img:nth-child(3) { display: none; }
}
@media (max-height: 720px) and (min-width: 861px) {
    td:has(> img[src*="refinery" i]) > img { height: clamp(100px, 16vw, 180px) !important; }
}

/* =====================================================================
   FIT-TO-SCREEN: whole login page fits one laptop / desktop screen,
   sign-in card visible without scrolling.
   ===================================================================== */
html, body { height: 100%; }
body { overflow-x: hidden; }
form#form1 { display: flex; flex-direction: column; min-height: 100vh; }
form#form1 > table { flex: 0 0 auto; }
/* content (intro + sign-in) takes the remaining height, centred */
form#form1 > table:has(input[id$="txtEmpno"]) { flex: 1 1 auto; }
form#form1 > table:has(input[id$="txtEmpno"]) > tbody > tr {
    align-items: center;
    padding-top: clamp(8px, 2vh, 28px);
    padding-bottom: clamp(8px, 2vh, 28px);
}

/* slimmer header and picture strip, sized by screen HEIGHT */
table.page td { padding: clamp(8px, 1.6vh, 16px) clamp(14px, 3vw, 40px) !important; }
table.page h1 { font-size: clamp(14px, min(1.9vw, 3.2vh), 26px); }
td:has(> img[src*="refinery" i]) > img { height: clamp(56px, 13vh, 200px) !important; }

/* compact sign-in card */
table:has(> tbody > tr > td > strong > [id$="lblHead"]) { width: clamp(290px, 25vw, 360px) !important; padding-bottom: clamp(8px, 1.6vh, 16px); }
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr > td { padding: clamp(2px, .5vh, 6px) 20px !important; }
table:has(> tbody > tr > td > strong > [id$="lblHead"]) > tbody > tr:first-child > td { padding: clamp(8px, 1.4vh, 14px) 20px !important; margin-bottom: 4px; }
span[id$="lblHead"] { font-size: 16px !important; }
span[id$="lblUserid"], span[id$="lblPwd"] { font-size: 11.5px !important; margin-bottom: 1px; }
input[id$="txtEmpno"], input[id$="txtPwd"], input[id$="txtVerificationCode"] { height: clamp(32px, 5vh, 40px); padding: 4px 12px; }
img[id$="img_captcha"] { max-width: clamp(140px, 20vh, 200px); }
table[id$="tbl_captcha"] td { padding: 2px 0 !important; }
table[id$="tbl_captcha"] p { margin: 2px 0; }
input[id$="btnLogin"] { height: clamp(34px, 5.4vh, 42px); margin: 4px 0 6px; }
span[id$="Label1"] { font-size: 11px !important; padding: 4px 8px; }
span[id$="lblError"] { font-size: 12px !important; }

/* intro card: tighter on short screens */
td:has(> span > font) { padding: clamp(10px, 2vh, 24px) clamp(14px, 1.6vw, 26px) !important; }
td:has(> span > font) font { font-size: clamp(12px, min(1.05vw, 2.2vh), 15px) !important; line-height: 1.55; }

/* slim footer */
table#TABLE2 { margin-top: 0; }
table#TABLE2 td { padding: clamp(4px, 1vh, 10px) clamp(14px, 3vw, 40px) !important; }
table#TABLE2 br { display: none; }
table#TABLE2 img[src*="eil_logo" i] { height: clamp(22px, 4vh, 36px) !important; }

@media (max-height: 640px) and (min-width: 861px) {
    td:has(> img[src*="refinery" i]) > img { height: clamp(44px, 9vh, 90px) !important; }
    table.page h1 { font-size: 15px; }
}

/* Version tag - right corner of the header banner */
table.page td:has(> .pc-login-version) { text-align: right; vertical-align: middle; white-space: nowrap; width: 1%; }
.pc-login-version {
    display: inline-block; padding: 3px 14px;
    color: #ffffff; background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .40); border-radius: 14px;
    font: 600 12px "Segoe UI", Calibri, Arial, sans-serif; letter-spacing: .3px;
}
