/* hp_brand — Concept A "Trusted Split" login (B-5183). Loaded only on the login task, on top of
   Roundcube Elastic. Brand panel (navy/gold) left, white sign-in card right; stacks on small screens.
   WCAG 2.2 AA: navy #18293F on white 14.9:1 · #4B5565 on white 7.2:1 · gold #E9B824 on navy 9.4:1 · white on navy 14.9:1 */

:root {
    --hp-navy: #18293F;
    --hp-navy-2: #1C314B;
    --hp-navy-3: #0F1B2D;
    --hp-gold: #E9B824;
    --hp-gold-soft: #F2C94C;
    --hp-ink: #141C2B;
    --hp-ink-2: #4B5565;
    --hp-line: #D6DDE8;
    --hp-surface: #FFFFFF;
    --hp-surface-2: #F4F6FA;
    --hp-focus: #E9B824;
    --hp-error: #B42318;
}
html.dark-mode {
    --hp-ink: #F4F6FA;
    --hp-ink-2: #B7C0CE;
    --hp-line: #2E3B52;
    --hp-surface: #141C2B;
    --hp-surface-2: #1C2538;
}

/* ── override Elastic's centred-column login ── */
.task-login #layout { min-height: 100vh; min-height: 100dvh; }
.task-login #layout-content.hp-login { text-align: left; display: block; width: 100%; padding: 0; overflow: auto; background: var(--hp-surface); }
.task-login #login-form { position: static; top: auto; width: 100%; max-width: none; margin: 0; }
.task-login .hp-login *, .task-login .hp-login *::before, .task-login .hp-login *::after { box-sizing: border-box; }

.hp-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; min-height: 100dvh; }

/* ── brand panel ── */
.hp-brand {
    background: linear-gradient(160deg, var(--hp-navy-2) 0%, var(--hp-navy) 55%, var(--hp-navy-3) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    padding: clamp(24px, 5vw, 64px);
    position: relative; overflow: hidden;
}
.hp-brand::after { /* subtle gold rule, decorative */
    content: ""; position: absolute; left: clamp(24px, 5vw, 64px); right: clamp(24px, 5vw, 64px); bottom: clamp(18px, 3vw, 36px);
    height: 2px; background: linear-gradient(90deg, var(--hp-gold), transparent 70%); opacity: .9;
}
.hp-brand-inner { width: 100%; max-width: 440px; }
.hp-brand-logo { display: block; width: min(320px, 70%); height: auto; margin: 0 0 clamp(20px, 4vw, 40px); }
.hp-brand-title { font-size: clamp(1.35rem, 2.1vw + .6rem, 2rem); line-height: 1.2; font-weight: 700; margin: 0 0 1rem; color: #fff; letter-spacing: -.01em; }
.hp-brand-points { list-style: none; margin: 0 0 1.5rem; padding: 0; color: #DCE3EE; font-size: 1rem; line-height: 1.5; }
.hp-brand-points li { position: relative; padding-left: 1.5rem; margin: .5rem 0; }
.hp-brand-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--hp-gold); }
.hp-brand-foot { margin: 0; font-size: .85rem; color: #B7C0CE; letter-spacing: .04em; text-transform: uppercase; }

/* ── sign-in card ── */
.hp-card { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 64px); background: var(--hp-surface); color: var(--hp-ink); }
.hp-card-inner { width: 100%; max-width: 420px; }
.hp-card-logo { display: none; width: 180px; height: auto; margin: 0 auto 20px; }
html.dark-mode .hp-card-logo { filter: brightness(0) invert(1); }

.hp-chip {
    display: inline-flex; align-items: center; gap: .5rem; max-width: 100%;
    padding: .35rem .75rem .35rem .4rem; border-radius: 999px;
    background: var(--hp-surface-2); border: 1px solid var(--hp-line); color: var(--hp-ink-2);
    font-size: .9rem; line-height: 1.2; margin: 0 0 1.25rem;
}
.hp-chip-generic { padding-left: .75rem; }
.hp-chip-initials {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.75rem; height: 1.75rem; padding: 0 .35rem; border-radius: 999px;
    background: var(--hp-gold); color: var(--hp-navy); font-weight: 700; font-size: .75rem; letter-spacing: .02em;
}
.hp-chip-name { color: var(--hp-ink); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-chip-sep { color: var(--hp-line); }
.hp-chip-tag { white-space: nowrap; }

.hp-login-title { font-size: clamp(1.5rem, 1.2vw + 1rem, 1.9rem); font-weight: 700; margin: 0 0 .5rem; color: var(--hp-ink); letter-spacing: -.01em; }
.hp-login-hint { margin: 0 0 1.5rem; color: var(--hp-ink-2); font-size: .95rem; line-height: 1.5; }
.hp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; color: var(--hp-ink); }

/* form (Roundcube renders a table; Elastic's ui.js may rewrite it to .form-group rows — handle both) */
#login-form table, #login-form tbody, #login-form tr, #login-form td { display: block; width: 100%; padding: 0; }
#login-form td.title, #login-form .col-form-label { padding: 0 0 .35rem; text-align: left; }
#login-form .form-group, #login-form .row { display: block; margin: 0 0 1rem; }
#login-form label { display: block; font-weight: 600; font-size: .95rem; color: var(--hp-ink); margin: 0 0 .35rem; }
#login-form .form-control, #login-form input[type="email"], #login-form input[type="text"], #login-form input[type="password"] {
    display: block; width: 100%; min-height: 48px; padding: .6rem .85rem; font-size: 1rem;
    color: var(--hp-ink); background: var(--hp-surface); border: 1.5px solid var(--hp-line); border-radius: 10px;
    box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease;
}
#login-form .form-control::placeholder { color: #8A94A6; }
#login-form .form-control:focus, #login-form .form-control:focus-visible {
    outline: none; border-color: var(--hp-navy); box-shadow: 0 0 0 3px rgba(233, 184, 36, .55);
}
html.dark-mode #login-form .form-control:focus { border-color: var(--hp-gold); }
#login-form .formbuttons, #login-form td.formbuttons { margin: 1.25rem 0 0; padding: 0; text-align: left; }
#login-form button.mainaction, #rcmloginsubmit {
    display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
    padding: .7rem 1rem; font-size: 1rem; font-weight: 700; letter-spacing: .01em;
    color: #fff; background: var(--hp-navy); border: 0; border-radius: 10px; cursor: pointer;
    transition: background-color .15s ease, transform .05s ease;
}
#login-form button.mainaction:hover, #rcmloginsubmit:hover { background: var(--hp-navy-2); }
#login-form button.mainaction:active, #rcmloginsubmit:active { transform: translateY(1px); }
#login-form button.mainaction:focus-visible, #rcmloginsubmit:focus-visible { outline: 3px solid var(--hp-focus); outline-offset: 2px; }
#rcmloginsubmit:before { display: none !important; }

#login-footer { margin-top: 1.5rem; color: var(--hp-ink-2); font-size: .9rem; line-height: 1.5; flex: none; }
#login-footer > div { margin: 0; padding: 0; background: none; }
.hp-foot-line { margin: 0 0 .35rem; }
#login-footer a, #login-footer a:visited { color: var(--hp-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
html.dark-mode #login-footer a { color: var(--hp-gold); }
#login-footer a:focus-visible { outline: 3px solid var(--hp-focus); outline-offset: 2px; border-radius: 3px; }

/* message toast (Elastic #messagestack) — keep readable on both themes */
.task-login #messagestack div.error { background: var(--hp-error); color: #fff; }

/* ── responsive ── */
@media (max-width: 900px) {
    .hp-split { grid-template-columns: 1fr; min-height: auto; }
    .hp-brand { padding: 28px 20px 32px; }
    .hp-brand::after { display: none; }
    .hp-brand-inner { max-width: 520px; }
    .hp-brand-logo { width: min(240px, 60%); margin-bottom: 14px; }
    .hp-brand-title { font-size: 1.25rem; margin-bottom: .5rem; }
    .hp-brand-points { display: none; }
    .hp-brand-foot { font-size: .75rem; }
    .hp-card { padding: 28px 16px 40px; align-items: flex-start; }
}
@media (max-width: 420px) {
    .hp-chip { font-size: .85rem; }
    .hp-chip-tag { display: none; }
    .hp-chip-sep { display: none; }
    .hp-login-title { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    #login-form .form-control, #rcmloginsubmit, #login-form button.mainaction { transition: none; }
}
@media print { .hp-brand { display: none; } }
