/**
 * Trident Northstar skin for Roundcube Webmail
 * Extends the Elastic skin (imported below) with the Trident Northstar
 * crimson / US DoW brand: accent #DC2626, highlights #EF4444, deep #991B1B.
 *
 * License: Creative Commons Attribution-ShareAlike (same as Elastic).
 */

@import url("../../elastic/styles/styles.min.css");

/* ============================================================
   GLOBAL ACCENTS — links, buttons, focus states
   ============================================================ */

a { color: #DC2626; }
a:hover { color: #991B1B; }
html.dark-mode a { color: #F87171; }
html.dark-mode a:hover { color: #EF4444; }

.btn-primary,
.btn-primary:focus,
button.btn.mainaction {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:not(:disabled):not(.disabled):active,
button.btn.mainaction:hover {
    background-color: #B91C1C !important;
    border-color: #B91C1C !important;
}

.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.35) !important;
}

html.dark-mode .btn-primary,
html.dark-mode button.btn.mainaction {
    background-color: #991B1B !important;
    border-color: #991B1B !important;
}

.btn-link { color: #DC2626; }
.btn-link:hover { color: #991B1B; }

.progress-bar { background-color: #DC2626; }

/* Form focus rings */
.form-control:focus,
input:focus,
select.custom-select:focus,
textarea:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25) !important;
}

/* Checkboxes, radios, switches */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
}
.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25) !important;
}
html.dark-mode .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #B91C1C !important;
    border-color: #B91C1C !important;
}

/* Tabs (Settings) */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: #DC2626 !important;
    border-bottom-color: #DC2626 !important;
}

/* Dropdown/popup menu hover */
.popupmenu li > a:hover,
.popupmenu li > a:focus,
ul.menu li > a:hover,
ul.menu li > a:focus,
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active,
.dropdown-item:active {
    background-color: #DC2626 !important;
    color: #fff !important;
}

/* ============================================================
   TASK MENU (left sidebar) — near-black crimson
   ============================================================ */

#layout-menu,
#taskmenu {
    background-color: #1A0808 !important;
}

#taskmenu a.selected,
#taskmenu a.selected:focus {
    background-color: #3A0F0F !important;
    color: #fff !important;
}

#taskmenu a:hover,
#taskmenu a:focus {
    background-color: #4A1313 !important;
    color: #fff !important;
}

#taskmenu a.action,
#taskmenu a.compose {
    color: #F87171 !important;
}

#taskmenu a.action:hover,
#taskmenu a.compose:hover {
    color: #fff !important;
}

/* Mobile popover menu header */
.popover-header {
    background-color: #3A0F0F;
    color: #fff;
}

/* ============================================================
   LISTS — selected rows, unread badges
   ============================================================ */

.listing li.selected > a,
.listing tr.selected td,
table.listing tr.selected td,
.listing li.selected {
    background-color: #FBEAEA !important;
}

html.dark-mode .listing li.selected > a,
html.dark-mode .listing tr.selected td,
html.dark-mode table.listing tr.selected td,
html.dark-mode .listing li.selected {
    background-color: #451A1A !important;
    color: #F5C6C6 !important;
}

span.unreadcount,
.listing li > a span.unreadcount {
    background-color: #DC2626 !important;
    color: #fff !important;
}

/* Datepicker */
.ui-datepicker .ui-state-active,
.ui-datepicker .ui-state-highlight {
    background: #DC2626 !important;
    color: #fff !important;
}

/* Toolbar selected state */
.toolbar a.button.selected { color: #DC2626 !important; }

/* Information toasts — deep crimson instead of blue */
#messagestack div.information,
.message.information {
    background-color: #991B1B !important;
}

/* Quota indicator */
.quota-widget { color: #DC2626; }

/* Scrollbars */
html.dark-mode ::-webkit-scrollbar-thumb { background-color: #7F1D1D !important; }

/* ============================================================
   LOGIN PAGE — tactical dark w/ Trident Northstar banner
   ============================================================ */

body.task-login {
    background-color: #000;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(10, 3, 3, 0.7) 45%, rgba(0, 0, 0, 0.85) 100%),
        url("../images/backdrop.jpg");
    background-size: 100% 100%, cover;
    background-position: center, left center;
    background-repeat: no-repeat, no-repeat;
}

body.task-login #layout,
body.task-login #layout-content {
    background: transparent !important;
}

body.task-login #layout-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

body.task-login #logo {
    /* Elastic pushes the logo down with a 16vh relative offset, which makes
       it overlap our added brand text — neutralize it and let flex order
       the elements naturally. */
    top: 0 !important;
    max-height: 110px;
    width: auto;
    margin: 0 auto 0.75rem;
    display: block;
    filter:
        drop-shadow(0 0 18px rgba(255, 235, 235, 0.7))
        drop-shadow(0 0 40px rgba(255, 130, 130, 0.45));
}

.tn-brand {
    font-size: 1.9rem;
    font-weight: 800;
    color: #C8CED8;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
}

.tn-brand span { color: #EF4444; }

.tn-positioning {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    text-align: center;
}

.tn-tagline {
    margin: 0.6rem 0 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.tn-credentials {
    margin-top: 1.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    text-align: center;
}

body.task-login #login-form {
    /* Elastic offsets the form 20vh down — neutralize (see #logo note). */
    top: 0 !important;
    background: rgba(30, 0, 0, 0.4);
    border: 1px solid rgba(220, 38, 38, 0.45);
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.25rem;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(220, 38, 38, 0.15);
}

body.task-login #login-form table td.title,
body.task-login #login-form label {
    color: #94A3B8;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

body.task-login .form-control {
    background-color: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(220, 38, 38, 0.4) !important;
    color: #fff !important;
    border-radius: 8px;
}

body.task-login .form-control::placeholder { color: #64748B; }

body.task-login .form-control:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.3) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
}

body.task-login .btn-primary,
body.task-login button.mainaction {
    background: linear-gradient(135deg, #EF4444 0%, #991B1B 100%) !important;
    border: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.45);
}

body.task-login .btn-primary:hover,
body.task-login button.mainaction:hover {
    background: linear-gradient(135deg, #FF6060 0%, #B91C1C 100%) !important;
    box-shadow: 0 14px 40px rgba(220, 38, 38, 0.55);
}

body.task-login #login-footer {
    color: #64748B;
    text-align: center;
}

body.task-login #login-footer a.support-link { color: #EF4444; }

body.task-login .noscriptwarning { color: #EF4444; }
