/*
  MFA stylesheet 鈥� shared by mFAVerify.jsp, MFASetup.jsp,
  MFATotpBind.jsp, MFAOnboarding.jsp.

  Visual style aligned with the Organon brand:
    - 椤堕儴鍝佺墝鏉★紙COOLS 路 MFA + Organon 鍟嗕笟鍗忎綔骞冲彴锛�
    - 鐜荤拑鎷熸�佸崱鐗� + 绮夎壊椤堕儴瑁呴グ鏉�
    - 瑁呴グ鍦嗭紙pink + cyan锛屾闈㈢鏄剧ず锛岀Щ鍔ㄧ闅愯棌锛�
    - Organon 钃濅富鍝佺墝 + Organon 绮夎緟鍔�
    - 杈撳叆妗嗗渾瑙� 8px銆佸乏渚� SVG 鍥炬爣銆佽摑鑹� focus 闃村奖
    - 閿欒鏉� / 杈撳叆妗嗙孩杈� / 淇℃伅鎻愮ず 鐘舵�佺粺涓�
    - 鏈嶅姟鐑嚎 + 杩斿洖鐧诲綍 椤佃剼

  鍚庣閫昏緫濂戠害锛堜笉鍔級锛�
    - 琛ㄥ崟瀛楁 id/name (verifycode, totpcode, lt, execution 绛�)
    - 琛ㄥ崟 action (/services/MFAGateway.do 绛�)
    - JavaScript 鍑芥暟 (confirmBind, enableFactor 绛�)
    - URL 鍙傛暟 (factor, error)
    - session 灞炴�� (userinfo, otpauthuri, totpsecretplain)
*/

/* ----------------------------------------------------------------
   鍝佺墝 token (鏉ヨ嚜 web/common.css L1-13)
   ---------------------------------------------------------------- */
:root {
    --organon-blue:      #1b4298;
    --organon-pink:      #e20177;
    --organon-cyan:      #009ddc;
    --organon-green:     #54b948;
    --ink:               #151923;
    --muted:             #687081;
    --line:              #d9dee8;
    --white:             #ffffff;
    --danger:            #b42318;
    --danger-soft:       #fbeeee;
    --danger-border:     #e8b8b8;

    /* MFA 鍏煎鏃� CSS 鍙橀噺鍚嶏紙琚� JSP / 鏃� class 寮曠敤锛�*/
    --mfa-brand:         var(--organon-blue);
    --mfa-brand-hover:   #142f6e;
    --mfa-brand-soft:    #eef3ff;
    --mfa-brand-shadow:  rgba(27, 66, 152, .12);
    --mfa-text:          #333333;
    --mfa-text-soft:     #666666;
    --mfa-border:        #d0d0d0;
    --mfa-border-soft:   #e8e8e8;
    --mfa-radius:        12px;
}

/* ----------------------------------------------------------------
   鍏ㄥ眬 + 鑳屾櫙
   ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Montserrat, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 82% 18%, rgba(0, 157, 220, .14), transparent 38%),
        radial-gradient(circle at 12% 88%, rgba(226, 1, 119, .08), transparent 36%),
        linear-gradient(180deg, #10234c 0%, #0a1834 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

img { border: none; }

/* ----------------------------------------------------------------
   MFA 鑸炲彴 + 瑁呴グ鍦嗭紙妗岄潰绔級
   ---------------------------------------------------------------- */
.mfa-stage {
    position: relative;
    min-height: 560px;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    overflow: hidden;
}
.mfa-stage::before {
    content: "";
    position: absolute;
    width: 540px; height: 540px;
    right: -240px; bottom: -380px;
    border: 60px solid rgba(226, 1, 119, .55);
    border-radius: 50%;
    opacity: .7;
    z-index: 0;
}
.mfa-stage::after {
    content: "";
    position: absolute;
    width: 380px; height: 380px;
    left: -160px; top: -180px;
    border: 50px solid rgba(0, 157, 220, .35);
    border-radius: 50%;
    opacity: .55;
    z-index: 0;
}
@media (max-width: 700px) {
    .mfa-stage::before, .mfa-stage::after { display: none; }
}

/* ----------------------------------------------------------------
   闈㈡澘锛堢幓鐠冩嫙鎬侊級
   ---------------------------------------------------------------- */
.mfa-panel {
    position: relative;
    z-index: 2;
    width: min(640px, 100%);
    margin: 0;
    padding: 30px 38px 28px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: var(--mfa-radius);
    box-shadow:
        0 28px 80px rgba(5, 19, 48, .45),
        0 0 0 1px rgba(255, 255, 255, .4) inset;
    backdrop-filter: blur(20px) saturate(118%);
    -webkit-backdrop-filter: blur(20px) saturate(118%);
}
.mfa-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    width: 92px; height: 6px;
    border-radius: 0 0 6px 6px;
    background: var(--organon-pink);
    transform: translateX(-50%);
}

/* 椤堕儴鍝佺墝鏉� */
.mfa-brand-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef0f5;
}
.mfa-brand {
    display: inline-flex; align-items: center; gap: 9px;
    color: var(--organon-blue);
    font-size: 12px; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase;
}
.mfa-brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--organon-green);
    box-shadow: 0 0 0 4px rgba(84, 185, 72, .18);
}
.mfa-brand-org {
    font-family: "Helvetica Neue", sans-serif;
    font-size: 13px;
    color: #6d7687;
    letter-spacing: .04em;
    text-transform: none;
    font-weight: 600;
}
.mfa-brand-org strong { color: var(--ink); margin-right: 4px; font-weight: 800; }

/* 鏍囬 */
.mfa-panel h2 {
    margin: 0 0 4px 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.025em;
}
.mfa-panel h2 small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}
.mfa-panel p.intro {
    margin: 8px 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* fieldset + legend 锛圡FASetup.jsp 浣跨敤锛�*/
.mfa-panel fieldset {
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    padding: 14px 22px;
    margin: 18px 0;
    background: #fafbfd;
}
.mfa-panel fieldset legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--organon-blue);
    font-size: 13px;
}

/* 鍚敤鐘舵�佹枃鏈紙MFASetup.jsp 浣跨敤锛�*/
.status-active   { color: var(--organon-green); font-weight: 700; }
.status-inactive { color: #888; font-weight: 700; }

/* ----------------------------------------------------------------
   Tab 鍒囨崲
   ---------------------------------------------------------------- */
.factor-tabs {
    display: flex;
    border-bottom: 2px solid var(--line);
    margin: 16px 0 22px 0;
}
.factor-tab {
    padding: 10px 22px;
    text-decoration: none;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s;
}
.factor-tab:hover { color: #555; }
.factor-tab.active {
    color: var(--organon-blue);
    border-bottom-color: var(--organon-pink);
    font-weight: 700;
}
.factor-panel { display: none; }
.factor-panel.active { display: block; }

/* ----------------------------------------------------------------
   琛ㄥ崟
   ---------------------------------------------------------------- */
.mfa-panel .mfa-input-row { margin: 14px 0; }
.mfa-panel .mfa-input-row label {
    display: block;
    margin-bottom: 8px;
    color: #333946;
    font-size: 13px;
    font-weight: 700;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    width: 19px; height: 19px;
    color: #778196;
    pointer-events: none;
}
.mfa-panel input[type=text],
.mfa-panel input[type=password] {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-size: 15px;
    font-family: inherit;
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.mfa-panel input[type=text]::placeholder,
.mfa-panel input[type=password]::placeholder { color: #a2a9b6; }
.mfa-panel input[type=text]:focus,
.mfa-panel input[type=password]:focus {
    border-color: var(--organon-blue);
    box-shadow: 0 0 0 3px var(--mfa-brand-shadow);
}

/* TOTP 楠岃瘉鐮佷笓鐢細letter-spacing 澶э紝绛夊瀵归綈 */
.mfa-panel input[name=totpcode] {
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-weight: 600;
    padding-left: calc(44px + 0.4em);
    padding-right: calc(14px + 0.4em);
}

/* 閿欒鎬� */
.mfa-input-row.has-error input[type=text],
.mfa-input-row.has-error input[type=password] {
    border-color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .10);
}
.mfa-input-row.has-error input[type=text]:focus,
.mfa-input-row.has-error input[type=password]:focus {
    border-color: var(--organon-blue);
    background: #fff;
    box-shadow: 0 0 0 3px var(--mfa-brand-shadow);
}
.mfa-input-error {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.mfa-input-error::before {
    content: "鈿�";
    font-weight: 700;
}

/* ----------------------------------------------------------------
   鐘舵�佹í骞�
   ---------------------------------------------------------------- */
.mfa-error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    padding: 11px 14px;
    border-radius: 6px;
    margin: 0 0 14px 0;
    font-size: 13px;
    line-height: 1.6;
}
.mfa-info {
    color: #1f5d27;
    background: #edf8ef;
    border: 1px solid #b8e0b8;
    padding: 11px 14px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.6;
}
.mfa-warning {
    color: #8a6a18;
    background: #fff8e0;
    border: 1px solid #f0d878;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.6;
}

/* ----------------------------------------------------------------
   鎸夐挳
   ---------------------------------------------------------------- */
.mfa-actions {
    margin-top: 22px;
    display: flex; justify-content: flex-end; gap: 10px;
    flex-wrap: wrap;
}
.mfa-actions button,
.mfa-actions .mfa-btn,
.mfa-actions .mfa-btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--organon-blue);
    color: #fff;
    border: 1px solid var(--organon-blue);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(27, 66, 152, .22);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.mfa-actions button:hover,
.mfa-actions .mfa-btn:hover,
.mfa-actions .mfa-btn-primary:hover {
    background: var(--mfa-brand-hover);
    border-color: var(--mfa-brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(27, 66, 152, .28);
}
.mfa-actions button[disabled] {
    background: #b8c4d3;
    border-color: #b8c4d3;
    color: #fff;
    cursor: not-allowed;
    opacity: .7;
    box-shadow: none;
    transform: none;
}
.mfa-actions .mfa-btn-secondary {
    /* full button reset for <a> elements (CSS selectors don't inherit
       styles from sibling selectors; <a> defaults differ from <button>) */
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    background: #fff;
    color: var(--organon-blue);
    border: 1px solid var(--organon-blue);
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.mfa-actions .mfa-btn-secondary:hover {
    background: var(--mfa-brand-soft);
    border-color: var(--organon-blue);
    color: var(--organon-blue);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(27, 66, 152, .10);
}
.mfa-actions .mfa-btn-secondary:focus-visible {
    outline: 3px solid rgba(27, 66, 152, .35);
    outline-offset: 2px;
}
.mfa-actions button svg { width: 16px; height: 16px; }

/* ----------------------------------------------------------------
   TOTP QR / Secret
   ---------------------------------------------------------------- */
.mfa-qr {
    text-align: center;
    margin: 18px 0;
    padding: 20px;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #fafbfd;
    transition: box-shadow .2s;
}
.mfa-qr:hover {
    box-shadow: 0 12px 30px rgba(26, 49, 94, .10);
}
.mfa-qr img {
    display: block; margin: 0 auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    width: 180px; height: 180px;
}
.mfa-secret {
    font-family: Menlo, Consolas, monospace;
    text-align: center;
    color: #555;
    font-size: 13px;
    margin-top: 14px;
}
.mfa-secret code {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------
   甯姪鏂囧瓧锛坢FAVerify.jsp锛�
   ---------------------------------------------------------------- */
.mfa-help {
    color: #6d7687;
    font-size: 13px;
    line-height: 1.6;
}
.mfa-help-spaced { margin-top: 14px; }
.mfa-resend      { margin-top: 10px; }

/* ----------------------------------------------------------------
   椤佃剼锛堝惈鏈嶅姟鐑嚎 + 杩斿洖鐧诲綍锛�
   ---------------------------------------------------------------- */
.mfa-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eef0f5;
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6d7687;
}
.mfa-hotline {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--organon-blue);
    font-weight: 700;
    text-decoration: none;
}
.mfa-hotline svg { width: 14px; height: 14px; color: var(--organon-pink); }
.mfa-hotline strong { letter-spacing: .02em; }
.mfa-back {
    color: var(--muted);
    text-decoration: none;
}
.mfa-back:hover { color: var(--ink); text-decoration: underline; }

/* ----------------------------------------------------------------
   Onboarding Modal锛堣鐩栧湪 NewMainTop.jsp 涓婏級
   ---------------------------------------------------------------- */
#mainframe {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
#mfa-modal-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
}
#mfa-modal {
    position: fixed;
    top: 50%; left: 50%;
    width: 480px; max-width: calc(100vw - 32px);
    margin-left: -240px;
    margin-top: -200px;
    background: var(--white);
    border-radius: 14px;
    padding: 28px 32px;
    box-shadow:
        0 28px 80px rgba(5, 19, 48, .45),
        0 0 0 1px rgba(255, 255, 255, .4) inset;
    backdrop-filter: blur(20px) saturate(118%);
    -webkit-backdrop-filter: blur(20px) saturate(118%);
    z-index: 9100;
    font-family: Montserrat, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
#mfa-modal h2 { margin-top: 0; font-size: 20px; color: var(--ink); }
#mfa-skip[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ----------------------------------------------------------------
   鍝嶅簲寮�
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .mfa-panel { padding: 24px 22px; border-radius: 14px; }
    .mfa-panel h2 { font-size: 20px; }
    .mfa-actions { flex-direction: column-reverse; }
    .mfa-actions button, .mfa-actions .mfa-btn,
    .mfa-actions .mfa-btn-primary,
    .mfa-actions .mfa-btn-secondary { width: 100%; }
    .factor-tab { padding: 10px 14px; font-size: 13px; }
}
@media (max-width: 430px) {
    .mfa-panel { padding: 20px 16px; margin: 8px; }
    .mfa-panel h2 { font-size: 18px; }
    .mfa-brand-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mfa-actions { margin-top: 16px; }
}

/* ----------------------------------------------------------------
   鏃犻殰纰�
   ---------------------------------------------------------------- */
:focus-visible { outline: 3px solid rgba(27, 66, 152, .45); outline-offset: 2px; }
.mfa-panel input:focus-visible { outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (prefers-contrast: more) {
    .mfa-error, .mfa-input-error { border-width: 2px; font-weight: 600; }
    .mfa-panel input:focus { box-shadow: 0 0 0 4px rgba(27, 66, 152, .28); }
}