/* ==========================================================================
   前台樣式（登入、填答、完成頁共用，只有這一份）
   - 手機可作答：量表在窄螢幕改為直向排列；第二部分每個組織一張卡片
   - 不使用 inline style（配合 CSP）
   ========================================================================== */
:root {
    --ess-primary: #2f6fb3;
    --ess-primary-dark: #1f4e80;
    --ess-bg: #f3f6fa;
    --ess-missing: #dc3545;
}

body.front {
    min-height: 100vh;
    background: var(--ess-bg);
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
}

.is-hidden {
    visibility: hidden;
}

.pre-line {
    white-space: pre-line;
}

/* ----- 頂部列 ----- */
.front-header {
    background: var(--ess-primary-dark);
    color: #fff;
}
.front-header .title {
    font-weight: 700;
}

/* ----- 登入、完成頁 ----- */
.front-box {
    width: 100%;
    max-width: 420px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
}

/* ----- 登入頁（與行動訂單 OrderM 登入頁相同設計：公司品牌色漸層、白色卡片、公司標誌） ----- */
body.front-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* 公司品牌色漸層（logo 主色 #008cd3 → 深色 #005a8c） */
    background: linear-gradient(135deg, #008cd3 0%, #005a8c 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.25rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-card .logo-area {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* 公司標誌（SVG 原色，只調整大小） */
.login-card .company-logo {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto 1.25rem;
}

.login-card .system-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.login-card .system-title .fas {
    font-size: .9em;
    color: #008cd3;
}

.login-card .btn-m365 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font-size: 1.05rem;
    background-color: #008cd3;
    border-color: #008cd3;
}

.login-card .btn-m365:hover,
.login-card .btn-m365:focus {
    background-color: #0077b3;
    border-color: #0077b3;
}

.login-card .login-hint {
    line-height: 1.7;
}

/* 資安提醒：淡黃底＋左側色條，醒目但不搶登入按鈕 */
.login-card .security-notice {
    background: #fff8e1;
    border-left: 4px solid #f0ad00;
    border-radius: 6px;
    padding: .65rem .85rem;
    color: #5c4a00;
    line-height: 1.6;
}

/* 說明文字以短句為單位換行，不會把詞拆成兩行 */
.login-card .phrase {
    display: inline-block;
}

/* 「或」分隔線（同時提供帳號密碼登入時） */
.login-card .login-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: #6c757d;
    font-size: .875rem;
}

.login-card .login-divider[hidden] {
    display: none;
}

.login-card .login-divider::before,
.login-card .login-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #dee2e6;
}

/* ----- 填答頁 ----- */
.survey-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}
.survey-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.survey-progress {
    height: 0.5rem;
}

/* 題目 */
.question {
    padding: 0.9rem 0;
    border-bottom: 1px solid #eef1f4;
}
.question:last-child {
    border-bottom: 0;
}
.question-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.question-no {
    display: inline-block;
    min-width: 2rem;
    color: var(--ess-primary-dark);
    font-weight: 700;
}

/* 量表：寬螢幕橫排等寬；窄螢幕直排 */
.scale {
    display: flex;
    gap: 0.4rem;
}
.scale .btn {
    flex: 1 1 0;
    padding: 0.4rem 0.25rem;
    font-size: 0.9rem;
    line-height: 1.25;
}
.scale .scale-value {
    display: block;
    font-weight: 700;
}
@media (max-width: 575.98px) {
    .scale {
        flex-direction: column;
    }
    .scale .btn {
        text-align: left;
        padding-left: 0.75rem;
    }
    .scale .scale-value {
        display: inline-block;
        min-width: 1.5rem;
    }
}

/* 第二部分：組織卡片 */
.org-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
}
.org-card .org-name {
    font-weight: 700;
    font-size: 1.05rem;
}
.org-card .step-label {
    font-size: 0.9rem;
    color: #495057;
    margin: 0.6rem 0 0.3rem;
}
.org-card .step-disabled {
    opacity: 0.45;
}

/* 未填答的題目 */
.is-missing {
    border-left: 4px solid var(--ess-missing);
    padding-left: 0.75rem;
    background: #fff5f5;
}
.missing-hint {
    color: var(--ess-missing);
    font-size: 0.875rem;
}

/* 底部按鈕列 */
.survey-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0 2rem;
}
