/**
 * Roundcube Webmail styles for the Elastic skin
 *
 * Copyright (c) The Roundcube Dev Team
 *
 * The contents are subject to the Creative Commons Attribution-ShareAlike
 * License. It is allowed to copy, distribute, transmit and to adapt the work
 * by keeping credits to the original authors in the README.md file.
 * See http://creativecommons.org/licenses/by-sa/3.0/ for details.
 */

@import "global";
@import "layout";
@import "widgets/common";
@import "widgets/buttons";
@import "widgets/jqueryui";
@import "widgets/dialogs";
@import "widgets/menu";
@import "widgets/messages";
@import "widgets/lists";
@import "widgets/forms";
@import "widgets/editor";


/*** Login form ***/

.task-login {
    #layout-content {
        text-align: center;
        width: 100%;
        display: block;
    }

    #logo {
        display: inline-block;
        position: relative;
        top: 16vh;
        max-height: 100px;
    }
}

#login-form {
    margin: 0 auto;
    top: 20vh;
    width: 95%;
    max-width: 320px;
    position: relative;

    // Fixes table width in IE11
    table, tbody {
        display: block;
    }

    // Fixes input width in IE11
    .row {
        margin-right: 0;
        margin-left: 0;
    }

    .oauthlogin {
        margin-top: 1em;
        padding-top: 1em;
    }

    .formbuttons + .oauthlogin {
        border-top: 1px solid #ccc;
    }
}

#rcmloginsubmit {
    &:before {
        display: none !important;
    }
}

#login-footer {
    flex: 1;
    color: @color-black-shade-text;

    & > div {
        margin-top: 1rem;
        padding: 1rem;
        background: @color-black-shade-bg;
        border-radius: .3rem;
    }
}

#login-addon {
    position: absolute;
    bottom: 0;
    max-height: 30%;
    margin: 1rem !important;
    width: auto !important;
    overflow: auto;

    @media screen and (min-width: (@screen-width-small + 1px)) {
        max-width: @screen-width-small;
        margin: auto !important;
        bottom: 1rem;
        left: 0;
        right: 0;
    }
}

body.task-error-login #layout {
    #layout-menu,
    #layout-content > .header {
        display: none;
    }
}

/*** Addressbook UI ***/

#contactpic {
    width: @layout-contact-icon-width;
    height: @layout-contact-icon-height;
    border-radius: .5rem;
    overflow: hidden;
    display:table-cell;
    vertical-align:middle;
    text-align: center;
    background-color: @color-image-upload-background;

    img {
        max-width: @layout-contact-icon-width;
        max-height: @layout-contact-icon-height;
    }
}

#contacthead {
    .names {
        margin-bottom: .5rem;

        span.namefield {
            font-size: 1.5rem;
            font-weight: bold;
            line-height: 1.2;
        }
    }

    &.readonly {
        .source.row {
            color: @color-form-hint;
            font-size: 90%;
            margin-bottom: .25rem;
        }
    }
}

/*** Mail UI ***/

#message-header {
    margin-bottom: 1rem;

    & > .subject {
        font-size: 1.5rem;
        font-weight: bold;

        body.status-flagged &:before {
            &:extend(.font-icon-class);
            display: inline;
            float: none;
            content: @fa-var-flag;
            font-size: 1em;
            color: @color-error;
        }

        a.extwin {
            text-decoration: none;

            &:before {
                &:extend(.font-icon-class);
                float: none;
                display: inline-block;
                font-size: 75%;
                line-height: 1.5;
                margin: 0;
                content: @fa-var-external-link-square-alt;
            }
        }

        span.inner {
            display: none;
        }
    }

    & > .header {
        display: flex;

        img.contactphoto {
            margin: 0 1rem 0 0;
            border-radius: 50%;
            width: @mail-header-photo-height;
            height: @mail-header-photo-height;
            object-fit: cover;
            background: @color-image-upload-background;
        }
    }

    .header-content {
        min-height: @mail-header-photo-height;
        flex: 1;

        &.details-view {
            .header-summary {
                display: none;
            }
            .header-headers {
                display: initial;
            }
        }
    }

    .header-summary {
        margin-top: .25rem;

        & > span {
            display: inline-block;
        }
    }

    .header-headers {
        display: none;

        .header-title {
            white-space: nowrap;
            color: @color-black-shade-text;
            font-weight: bold;
            padding-right: 1rem;
            vertical-align: top;
        }
    }

    .header-links {
        margin-top: .25rem;

        a {
            font-size: 90%;
            margin-right: .5rem;
            text-decoration: none;
            white-space: nowrap;
            display: inline-block;

            &:before {
                &:extend(.font-icon-class);
                height: 1.5rem;
                line-height: 1.3;
            }

            &.headers-details:before {
                content: @fa-var-envelope;
            }

            &.headers-summary:before {
                .font-icon-regular(@fa-var-envelope);
            }

            &.headers-all:before {
                content: @fa-var-info-circle;
            }

            &.html:before {
                content: @fa-var-image;
            }

            &.plain:before {
                content: @fa-var-align-justify;
            }

            &.zipdownload:before {
                content: @fa-var-download;
            }
        }
    }
}

.message-partheaders {
    padding: .25rem .5rem;
    margin: .5rem 0 -.5rem 0;
    border-top: 1px solid @color-messagepart-border;
    background-color: @color-messagepart-background;

    table.headers-table {
        font-size: 90%;
        color: @color-mail-headers;

        .header-title {
            .overflow-ellipsis();
            white-space: nowrap;
            max-width: 8em;
            font-weight: bold;
            padding-right: 1rem;
            vertical-align: top;
        }

        .subject {
            font-weight: bold;
        }

        & + .message-part,
        & + .message-htmlpart {
            border-top: 0;
            margin: 0;
        }
    }
}

#message-content {
    .attachmentslist:not(:empty) {
        margin-bottom: 1rem;
    }
}

#messagebody {
    &.mailvelope {
        iframe {
            min-height: 75vh;
        }
    }
}

.message-part,
.message-htmlpart {
    padding-top: .5rem;
    // Fixes absolute positioned mail message content
    position: relative;

    &:not(:first-child) {
        border-top: 1px solid @color-messagepart-border;
        margin-top: .5rem;
    }

    &:last-child {
        margin-bottom: .5rem;
    }

    div.rcmBody {
        // Remove margins that can be set by the mail message styles
        margin: 0 auto !important;
        // Fix floating table issue (#9804)
        overflow: auto hidden;
    }

    blockquote {
        .overflow-ellipsis();
        color: @color-blockquote-0;
        border-left: 2px solid @color-blockquote-0-border;
        border-right: 2px solid @color-blockquote-0-border;
        background-color: @color-blockquote-background;
        margin: 2px 0;
        padding: 0 .4em;

        blockquote {
            color: @color-blockquote-1;
            border-left: 2px solid @color-blockquote-1-border;
            border-right: 2px solid @color-blockquote-1-border;

            blockquote {
                color: @color-blockquote-2;
                border-left: 2px solid @color-blockquote-2-border;
                border-right: 2px solid @color-blockquote-2-border;
            }
        }

        span.blockquote-link {
            top: 0;
            cursor: pointer;
            right: .5rem;
            min-width: 4rem;
            padding: .2rem .25rem .2rem .5rem;
            font-size: 90%;
            text-align: center;
            color: @color-black-shade-text;
            background: @color-black-shade-bg;
            border: 1px solid @color-black-shade-border;
            border-radius: .3rem;
            line-height: 1;
            .font-family(); // don't inherit monospace font

            &:after {
                &:extend(.font-icon-class);
                content: @fa-var-angle-down;
                display: inline-block;
                float: none;
                margin: 0;
                font-size: 90%;
            }

            &.collapsed:after {
                content: @fa-var-angle-up;
            }
        }

        &.blockquote-header {
            text-overflow: ellipsis !important;
            padding-right: 5rem !important;
        }
    }
}

.message-part {
    span.sig {
        color: @color-mail-signature;
    }

    div.pre {
        font-family: monospace;
        font-size: 13px;
    }

    // This is needed for proper display of quoted plain text
    blockquote {
        display: inline-block;
        min-width: 100%;

        & + br {
            // compensate the spacing "removed" by the inline-block style above
            display: block;
            margin-top: 1em;
        }
    }
}

.message-htmlpart {
    *,
    ::after,
    ::before {
        // Reset Bootstrap defaults that may interfere with HTML message content (#9727)
        box-sizing: initial;
    }
}

#compose-attachments {
    margin: 1rem 1rem 0 1rem;
}

.suspicious-address-warning:before {
    .font-icon-class();
    float: none;
    display: inline-block;
    content: @fa-var-exclamation-triangle;
    color: @color-message-warning;
}

#composestatusbar {
    opacity: .3;
    right: 2.5rem;

    @media screen and (min-width: (@screen-width-small + 1px)) {
        display: none;
    }

    a.button {
        display: inline-block;

        &:before {
            line-height: @layout-touch-header-height;
            font-size: 1.25rem !important;
        }
    }
}

/*** Settings UI ***/

// A default icon for settings menu entries added by plugins
.settings-default-icon {
    tr > td.section::before,
    li > a:before {
        content: @fa-var-cog;
    }
}

& when (@dark-mode-enabled = true) {
    @import "dark";
}

@import (optional) "_styles";




/* ====================================================================== */
/* 【黃金完美收官】輸入框與登入按鈕集體精準縮短一半（220像素）排版       */
/* ====================================================================== */

@import url("../../../program/resources/embed.css");

/* 1. 物理粉碎新版所有的原廠白色大方框與陰影遮擋 */
body, #layout, #layout-content, .layout-wrapper, .card, .login-card, .login-form-container, #login-form {
    background: transparent !important; 
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* 2. 強制注入全域滿版火車站背景圖 */
body {
    background-color: #f8fafc !important; 
    background-image: url('../images/378473543098.jpg') !important; 
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
}

/* 3. 消滅輸入框左側圖示 */
.input-group-addon, .input-group-text, .input-group-prepend, .input-group .input-group-text {
    background: transparent !important;
    border: none !important;
    padding-right: 0 !important;
    color: #fff !important;
}

/* 4. 【核心寬度修正】將寬度從 440px 砍半調整為 220px，實現精緻的窄版現代設計 */
#login-form,
#login-form .form-group,
#login-form .input-group,
#login-form .formactions {
    width: 320px !important;        /* 👈 【關鍵：440px 砍半】所有人統一改為 220px 縮短一半 */
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    box-sizing: border-box !important;
    flex: none !important;          
}

#login-form label, #login-form .form-label {
    display: none !important;
}

/* 5. 輸入框 100% 滿幅寬度填充（自動適應父容器的 220 像素） */
#login-form input[type="text"], 
#login-form input[type="password"], 
#login-form .form-control {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 18px !important;
    background: rgba(255, 255, 255, 0.2) !important; 
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    color: #fff !important;
    font-size: 16px !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    margin-bottom: 20px !important;
    display: block !important;
}

#login-form input:focus {
    background: rgba(255, 255, 255, 0.4) !important;
    outline: none !important;
    color: #fff !important;
}

/* 6. 登入按鈕 100% 滿幅寬度填充（自動適應父容器的 220 像素） */
#login-form input[type="submit"], 
#login-form button[type="submit"], 
.button.mainaction {
    display: block !important;
    width: 100% !important;         
    max-width: 100% !important;
    background: linear-gradient(to bottom, #3498db, #2980b9) !important;
    color: white !important;
    padding: 14px !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    text-transform: uppercase !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    margin-top: 15px !important;
    margin-bottom: 50px !important; 
}

#login-footer {
    color: rgba(255,255,255,0.6) !important;
    margin-top: 20px !important;
    font-size: 13px !important;
    display: block !important;
    text-align: center !important;
}

h1.voice, .layout-wrapper h1, #layout-content h1, .voice, .floating-title {
    display: none !important;
    visibility: hidden !important;
}

/* ====================================================================== */
/* 7. 【重構大字】SILVER CENTRE 雙色字體與實體官方 Logo 的不跑版佈局     */
/* ====================================================================== */
.header, .brand-header, #layout-content > .header {
    position: relative !important;
    height: 120px !important;       
    width: 600px !important;        /* 👈 撐開至 600px 充足寬度，防原廠框架擠壓字體 */
    margin: 150px auto 0 auto !important; 
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;          
    background: transparent !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 讓系統讀取到的實體原廠 Logo 標籤放大 108px 並卡在中間 */
.header #logo, .brand-header #logo, #layout-content #logo {
    position: static !important;   
    transform: none !important;
    height: 108px !important;       
    width: 108px !important;        
    max-height: 108px !important;
    display: block !important;
    order: 2 !important;           /* 👈 強制定死在正中間（第二順位） */
    visibility: visible !important;
    opacity: 1 !important;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)) !important;
}

/* 【核心突破】強制將頂部所有的虛擬文字元素拉大、改色，並分別站立於 Logo 左右兩側 */
.header::before, .header::after, 
.brand-header::before, .brand-header::after,
#layout-content > .header::before, #layout-content > .header::after {
    position: static !important;   
    transform: none !important;
    font-weight: 900 !important;
    font-size: 34px !important;    /* 👈 強制設定為 34px 大字，確保清晰可見 */
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6) !important;
    white-space: nowrap !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    width: auto !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 左側大白字：SILVER (強制填色，排在第一順位) */
.header::before, .brand-header::before, #layout-content > .header::before { 
    content: "SILVER" !important; 
    color: #ffffff !important;      /* 👈 亮白色 */
    order: 1 !important; 
    text-align: right !important; 
}

/* 右側寶藍字：CENTRE (強制填色，排在第三順位) */
.header::after, .brand-header::after, #layout-content > .header::after { 
    content: "CENTRE" !important; 
    color: #3498db !important;      /* 👈 寶藍色 */
    order: 3 !important; 
    text-align: left !important; 
}

/* ====================================================================== */
/* 8. 使用正確的英文半形減號，將整個對齊後的表單往上吸附，插在標題正中央 */
/* ====================================================================== */
#login-form {
    margin-top: -70px !important;   /* 👈 精準置中定位，將輸入框提到標題腹地 */
    position: relative !important;
    z-index: 20 !important;
}

/* ====================================================================== */
/* 9. 【萬能元素強拆】徹底無視原廠容器，周邊所有政策法律文字 100% 移至最右邊 */
/* ====================================================================== */

/* 【強拉左上角所有政策連結】直接對全域符合條件的 <a> 標籤強制固定在最右上角 */
a[href*="privacy"],
a[href*="service"],
a[href*="policy"],
a[href*="terms"],
.header-links a,
#header-links a {
    position: fixed !important;       /* 👈 改用 fixed 徹底抽離，無視所有原廠父容器 */
    top: 30px !important;
    right: 40px !important;           /* 👈 預設全部死死釘在最右邊 */
    left: auto !important;            /* 徹底切斷原廠左側定位 */
    display: block !important;
    z-index: 999999 !important;       
    text-shadow: 0 2px 6px rgba(0,0,0,0.8) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14px !important;
    width: auto !important;
}

/* 【左右拉開防重疊】把 Terms 或是第一個連結往左推開，與 Privacy 完美並排 */
a[href*="service"],
a[href*="terms"],
.header-links a:first-of-type,
#header-links a:first-of-type {
    right: 170px !important;          /* 👈 將第一個連結單獨往左邊推開 170 像素，實現優雅並排 */
}

/* 【強拉左下角所有宣告小字】揪出底端區域內所有的容器、法律通知與衍生小字 */
#layout-footer,
#login-footer,
.footer-left,
[role="contentinfo"],
div[id*="footer"],
div[class*="footer"],
#layout-footer p,
#layout-footer span,
#layout-footer a {
    position: fixed !important;       /* 👈 改用 fixed 徹底抽離 */
    bottom: 25px !important;          /* 距離網頁最底部 25 像素 */
    right: 40px !important;           /* 👈 強制死死固定在網頁最右邊 */
    left: auto !important;            /* 徹底切斷原廠左側定位 */
    width: auto !important;
    max-width: 450px !important;      
    z-index: 999999 !important;
    background: transparent !important;
}

/* 【宣告文字靠右】強制讓那一整坨多行宣告的所有內層子元素，通通改成「靠右對齊」 */
#layout-footer * ,
#login-footer * ,
div[id*="footer"] * ,
div[class*="footer"] * {
    text-align: right !important;     
    margin-left: auto !important;     
    margin-right: 0 !important;
    color: rgba(255, 255, 255, 0.6) !important; 
    font-size: 13px !important;
    line-height: 1.6 !important;
}

