﻿/* =========================================================
   IRRS Login CSS
   機關端 / 公司管理端共用
   ========================================================= */

:root {
    --bg-main: #0b2233;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --input-radius: 14px;
}

/* =========================================================
   Base
   ========================================================= */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
    background: radial-gradient(900px 460px at -10% -20%, rgba(0,151,167,.18), transparent 60%), radial-gradient(900px 460px at 110% 120%, rgba(0,131,176,.18), transparent 60%), linear-gradient(180deg, #050b10, var(--bg-main));
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* =========================================================
   Frame
   ========================================================= */

.frame {
    position: relative;
    width: min(1180px, calc(100vw - 48px));
    min-height: 560px;
    padding: 24px 36px;
    border-radius: 32px;
    overflow: hidden;
    background: linear-gradient( 90deg, rgba(3, 10, 22, .74) 0%, rgba(3, 10, 22, .54) 22%, rgba(3, 10, 22, .28) 46%, rgba(3, 10, 22, .08) 70%, rgba(3, 10, 22, .02) 100% ), url('/Images/irrs-countryside-4k.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 34px 90px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.05);
}

    /* 公司管理端背景 */
    .frame.irrs-admin-login-frame {
        background: linear-gradient( 90deg, rgba(2, 6, 18, .82) 0%, rgba(2, 6, 18, .66) 24%, rgba(2, 6, 18, .42) 48%, rgba(2, 6, 18, .18) 72%, rgba(2, 6, 18, .08) 100% ), url('/Images/irrs-city-4k.png');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }

.irrs-login-frame,
.irrs-admin-login-frame {
    max-width: 960px !important;
    min-height: 560px !important;
    background-size: cover !important;
    background-position: center center !important;
}

/* =========================================================
   Header / Brand
   ========================================================= */

.frame-header {
    position: absolute;
    top: 28px;
    left: 520px;
    right: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    color: #fff;
    z-index: 20;
}

.logo-shield {
    width: 82px;
    height: 94px;
    flex: 0 0 auto;
}

    .logo-shield svg {
        width: 100%;
        height: 100%;
        display: block;
    }

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.brand-zh,
.brand-en {
    font-family: "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: .04em;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
}

.brand-en {
    font-size: 2rem;
    letter-spacing: .15em;
}

.brand-agency {
    margin-top: 2px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: .03em;
    line-height: 1.2;
    color: #F3F4F6;
    white-space: nowrap;
}

/* =========================================================
   Layout
   ========================================================= */

.frame-body {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    column-gap: 30px;
    align-items: center;
    min-height: 520px;
    margin-top: 6px;
}

.hero-area {
    min-height: 240px;
}

/* =========================================================
   Login Card - Glass Style
   ========================================================= */

.login-card {
    position: relative;
    max-width: 400px;
    padding: 30px 30px 24px;
    border-radius: 28px;
    background: linear-gradient( 135deg, rgba(10, 24, 44, .68), rgba(10, 24, 44, .52) ) !important;
    backdrop-filter: blur(18px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(120%) !important;
    border: 1px solid rgba(255,255,255,.05) !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08) !important;
    color: #F8FAFC !important;
}

.login-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.login-title {
    margin: 0 0 10px;
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: .12em;
    color: #F8FAFC !important;
    text-shadow: 0 2px 12px rgba(0,0,0,.28);
}

.login-subtitle {
    margin: 0;
    font-size: .9rem;
    color: rgba(226,232,240,.72) !important;
}

.login-help {
    margin-top: 2px;
    font-size: .84rem;
    color: rgba(203,213,225,.62) !important;
}

.login-msg {
    margin-top: 6px;
    min-height: 1.1em;
    font-size: .88rem;
    color: #FCA5A5 !important;
}

/* =========================================================
   Public Link
   ========================================================= */

.public-link {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    color: #7DD3FC !important;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

    .public-link:hover {
        background: rgba(14,165,233,.18) !important;
        color: #E0F2FE !important;
    }

/* =========================================================
   Form
   ========================================================= */

.form-row {
    margin-top: 14px;
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: .9rem;
    font-weight: 700;
    color: rgba(248,250,252,.92) !important;
}

/* 原生 TextBox */
.login-card input.base-input,
.login-card .base-input {
    width: 100%;
    height: 58px;
    box-sizing: border-box;
    border: 1px solid rgba(203,213,225,.24) !important;
    border-radius: var(--input-radius) !important;
    padding: 0 14px;
    background: rgba(15, 23, 42, .46) !important;
    color: #F8FAFC !important;
    font-size: 18px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

    .login-card input.base-input::placeholder,
    .login-card .base-input::placeholder {
        color: rgba(226,232,240,.58) !important;
    }

    .login-card input.base-input:focus {
        border-color: rgba(96,165,250,.78) !important;
        box-shadow: 0 0 0 3px rgba(59,130,246,.18), inset 0 1px 0 rgba(255,255,255,.05) !important;
    }

/* DevExpress TextBox 外框清理 */
.base-input.dxeTextBox,
.base-input.dxeTextBoxSys {
    border-radius: var(--input-radius) !important;
    border: 1px solid rgba(203,213,225,.24) !important;
    background: rgba(15, 23, 42, .46) !important;
}

    .base-input.dxeTextBoxSys td.dxic,
    .base-input.dxeTextBox td.dxic {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

.base-input .dxeEditArea,
.base-input input.dxeEditAreaSys {
    padding: 11px 14px !important;
    font-size: 1.02rem !important;
    background: transparent !important;
    color: #F8FAFC !important;
}

/* =========================================================
   Password Toggle
   ========================================================= */

.password-box,
.password-wrap {
    position: relative;
}

    .password-box .password-input {
        padding-right: 48px !important;
    }

.toggle-pwd-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.06) !important;
    color: rgba(226,232,240,.82) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
}

    .toggle-pwd-btn:hover {
        background: rgba(255,255,255,.12) !important;
    }

.password-wrap input[type="password"]::-ms-reveal,
.password-wrap input[type="password"]::-ms-clear {
    display: none !important;
}

/* =========================================================
   Captcha
   ========================================================= */

.dxICB {
    border-radius: 12px !important;
    overflow: hidden;
}

/* 驗證碼圖片：維持清楚 */
.dxCaptchaImage .dxca-imageDiv {
    background: rgba(255,255,255,.78) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,.28) !important;
}

    .dxCaptchaImage .dxca-imageDiv img {
        background: rgba(255,255,255,.92) !important;
        border-radius: 12px !important;
    }

/* Captcha 整體容器 */
.captcha-wrap {
    position: relative;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 14px;
}


    .captcha-wrap table,
    .captcha-wrap td,
    .captcha-wrap .dxeFocused,
    .captcha-wrap .dxeFocused_Metropolis,
    .captcha-wrap .dxeFocused_Office365,
    .captcha-wrap .dxeFocused_Moderno,
    .captcha-wrap .dxeFocused_iOS {
        outline: none !important;
        box-shadow: none !important;
    }

    /* 右側驗證碼輸入框：與帳號 / 密碼同色 */
    .captcha-wrap .dxeTextBoxSys,
    .captcha-wrap .dxeTextBox {
        width: 150px !important;
        max-width: 150px !important;
        background: rgba(15, 23, 42, .46) !important;
        border: 1px solid rgba(203,213,225,.24) !important;
        border-radius: 14px !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
        overflow: hidden !important;
        margin-left: 14px !important;
    }

    /* 內層清乾淨 */
    .captcha-wrap .dxic,
    .captcha-wrap td {
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
    }

    .captcha-wrap input[type="text"],
    .captcha-wrap .dxeEditArea,
    .captcha-wrap input.captcha-input,
    .captcha-wrap .captcha-input input {
        width: 100% !important;
        height: 58px !important;
        line-height: 58px !important;
        box-sizing: border-box !important;
        border: 0 !important;
        outline: none !important;
        box-shadow: none !important;
        padding: 0 14px !important;
        background: transparent !important;
        color: #F8FAFC !important;
        /* 驗證碼輸入數字放大 */
        font-size: 18px !important;
        font-weight: 700 !important;
        letter-spacing: .03em;
    }

        .captcha-wrap input[type="text"]::placeholder,
        .captcha-wrap .dxeEditArea::placeholder {
            color: rgba(226,232,240,.58) !important;
        }

    /* focus 與帳號 / 密碼一致 */
    .captcha-wrap .dxeTextBoxSys:focus-within,
    .captcha-wrap .dxeTextBox:focus-within {
        border-color: rgba(96,165,250,.78) !important;
        box-shadow: 0 0 0 3px rgba(59,130,246,.18), inset 0 1px 0 rgba(255,255,255,.05) !important;
    }

@media (max-width: 820px) {
    .captcha-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 220px;
    }
}

/* =========================================================
   Remember / Button
   ========================================================= */

.login-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    color: rgba(226,232,240,.72) !important;
}

    .login-remember label,
    .login-remember span {
        color: rgba(226,232,240,.78) !important;
    }

.btn-primary {
    min-width: 190px;
    padding: 14px 38px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient( 135deg, var(--primary), var(--primary-dark) );
    color: #fff;
    font-size: 1.12rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(37,99,235,.34);
    transition: transform .12s ease, filter .12s ease;
}

    .btn-primary:hover {
        filter: brightness(1.04);
        transform: translateY(-1px);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

/* =========================================================
   Reason Box
   ========================================================= */

.login-reason-box {
    margin: 12px 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
}

.login-reason-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 700;
}

.login-reason-body {
    font-size: .9rem;
    line-height: 1.45;
    opacity: .9;
}

/* =========================================================
   Hero / SysInfo
   ========================================================= */

.hero-wrap {
    position: absolute;
    right: 24px;
    bottom: 43px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hero-img {
    width: 220px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* 公司管理端：右側管理員人物位置 */
.irrs-admin-login-frame .hero-wrap {
    right: 70px;
    bottom: 150px;
}

.irrs-admin-login-frame .hero-img {
    width: 210px;
}

.sysinfo {
    position: absolute;
    right: 24px;
    bottom: 20px;
    min-width: 260px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(0,0,0,.34);
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(12px);
    color: #E5E7EB;
    font-size: .9rem;
    line-height: 1.7;
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
}

    .sysinfo strong {
        color: #f9fafb;
        font-weight: 600;
    }

/* =========================================================
   Desktop
   ========================================================= */

@media (min-width: 821px) {
    .frame {
        max-width: 960px;
        min-height: 560px;
        padding: 24px 32px;
    }

    .frame-header {
        top: 22px;
        left: 500px;
    }

    .login-card {
        transform: translateY(22px);
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 820px) {
    .screen {
        align-items: flex-start;
        padding: 10px 8px;
    }

    .frame {
        width: 100%;
        max-width: 380px;
        min-height: auto !important;
        padding: 22px 16px 20px !important;
        margin-top: 0 !important;
        border-radius: 0;
        box-shadow: none;
    }

    .frame-header {
        position: relative !important;
        top: auto !important;
        left: 46px !important;
        right: auto !important;
        width: 100%;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 16px;
        margin: 20px 0 22px !important;
        padding-left: 0 !important;
        padding-right: 20px;
        color: #fff;
        z-index: 20;
    }    

    .logo-shield {
        width: 62px;
        height: 74px;
    }

    .brand-text {
        display: flex !important;
        flex-direction: column;
        text-align: left;
        line-height: 1.15;
        min-width: 0;
    }

    .brand-zh,
    .brand-en {
        display: block !important;
        font-size: 1rem;
        font-weight: 900;
        color: #fff;
        letter-spacing: .04em;
        white-space: nowrap;
    }

    .brand-agency {
        display: block !important;
        font-size: 1.35rem !important;
        font-weight: 900 !important;
        color: #fff !important;
        letter-spacing: .03em;
        white-space: nowrap;
        text-align: left;
    }

    .frame-body {
        display: grid;
        grid-template-columns: 1fr;
        column-gap: 0;
        min-height: auto !important;
        margin-top: 0 !important;
    }

    .login-card {
        max-width: none;
        margin: 0 auto;
        margin-bottom: 0 !important;
        padding: 20px 18px;
        transform: none !important;
    }

    .login-title {
        font-size: 1.55rem;
        letter-spacing: .12em;
    }

    .hero-area {
        display: none !important;
        min-height: 0 !important;
    }

    .hero-wrap {
        display: none;
    }

    .captcha-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
        max-width: 220px;
    }

        .captcha-wrap .dxeTextBoxSys,
        .captcha-wrap .dxeTextBox {
            width: 120px !important;
            max-width: 120px !important;
        }

    .toggle-pwd-btn {
        right: 10px;
    }

    .sysinfo {
        position: static !important;
        width: calc(100% - 28px);
        max-width: 330px;
        margin: 14px auto 0 !important;
        box-sizing: border-box;
    }
    


    .irrs-login-frame,
    .irrs-admin-login-frame {
        min-height: auto !important;
    }

    body {
        font-size: 14.5px;
    }
}

@media (max-width: 420px) {
    .btn-primary {
        min-width: 0;
        width: 50%;
        padding-inline: 14px;
    }
}

/* =========================================================
   Captcha spacing fix
   DevExpress Captcha 圖片與輸入框間距
   ========================================================= */

/* 驗證碼圖片右側留空 */
.dxCaptchaImage .dxca-imageDiv {
    margin-right: 14px !important;
}

/* 避免 DevExpress 內層 table 把距離吃掉 */
.captcha-wrap table {
    border-collapse: separate !important;
}

/* 驗證碼右側輸入框再保險往右推 */
.captcha-wrap .dxeTextBoxSys,
.captcha-wrap .dxeTextBox {
    margin-left: 14px !important;
}

/* 手機版間距縮小 */
@media (max-width: 820px) {
    .dxCaptchaImage .dxca-imageDiv {
        margin-right: 8px !important;
    }

    .captcha-wrap .dxeTextBoxSys,
    .captcha-wrap .dxeTextBox {
        margin-left: 8px !important;
    }
}

.login-card input.base-input,
.login-card .base-input,
.captcha-wrap .dxeTextBoxSys,
.captcha-wrap .dxeTextBox {
    background: rgba(18, 32, 54, .58) !important;
    border: 1px solid rgba(203,213,225,.30) !important;
}

.login-subtitle,
.login-help,
.login-remember {
    color: rgba(226,232,240,.82) !important;
}

