@import url("../../elastic/styles/styles.min.css");
/* Phase 194 — the webmail every domain shares. A child of elastic: the mail
   UI stays elastic; this file draws the sign-in (templates/login.html) and
   gives the menu a mark you can see. One look for every client domain; the
   hosting company is a footnote, not the brand. Light is the base, dark is
   html.dark-mode (elastic sets it from the system or the user's choice). */

:root {
    --hp-ink: #0f172a;
    --hp-mut: #566074;
    --hp-bg: #eef2f9;
    --hp-card: rgba(255, 255, 255, .74);
    --hp-card-edge: rgba(15, 23, 42, .08);
    --hp-card-shine: rgba(255, 255, 255, .9);
    --hp-shadow: 0 28px 70px -24px rgba(30, 41, 80, .32), 0 2px 6px rgba(30, 41, 80, .06);
    --hp-field: rgba(255, 255, 255, .92);
    --hp-field-edge: rgba(15, 23, 42, .14);
    --hp-field-hover: rgba(15, 23, 42, .24);
    --hp-accent: #3e7bfa;
    --hp-accent-2: #7b5cff;
    --hp-ring: rgba(62, 123, 250, .22);
    --hp-glow-a: rgba(76, 141, 255, .55);
    --hp-glow-b: rgba(139, 108, 255, .42);
    --hp-glow-c: rgba(45, 212, 191, .36);
    --hp-warn: #b45309;
    --hp-chip: rgba(62, 123, 250, .10);
    --hp-chip-ink: #2f5fd0;
    --hp-err-ink: #b42318;
    --hp-err-bg: rgba(217, 45, 32, .08);
    --hp-err-edge: rgba(217, 45, 32, .22);
    --hp-card-solid: #fff;
}
html.dark-mode {
    --hp-ink: #e9ecf4;
    --hp-mut: #9aa3b6;
    --hp-bg: #070a12;
    --hp-card: rgba(17, 21, 33, .62);
    --hp-card-edge: rgba(255, 255, 255, .09);
    --hp-card-shine: rgba(255, 255, 255, .07);
    --hp-shadow: 0 30px 80px -24px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .04) inset;
    --hp-field: rgba(255, 255, 255, .045);
    --hp-field-edge: rgba(255, 255, 255, .13);
    --hp-field-hover: rgba(255, 255, 255, .22);
    --hp-ring: rgba(96, 150, 255, .30);
    --hp-glow-a: rgba(62, 123, 250, .42);
    --hp-glow-b: rgba(123, 92, 255, .34);
    --hp-glow-c: rgba(20, 184, 166, .22);
    --hp-warn: #fbbf24;
    --hp-chip: rgba(96, 150, 255, .14);
    --hp-chip-ink: #a9c4ff;
    --hp-err-ink: #ff8a80;
    --hp-err-bg: rgba(255, 99, 88, .10);
    --hp-err-edge: rgba(255, 99, 88, .28);
    --hp-card-solid: #111521;
}

/* ---- the page ------------------------------------------------------------ */
body.task-login,
body.task-login #layout {
    background: var(--hp-bg) !important;
    color: var(--hp-ink);
}
body.task-login #layout-content.hp-login {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 16px 96px;
    background: transparent !important;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* the sky: three slow lights and a fine grain, behind everything */
.hp-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hp-sky::after {
    content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hp-glow {
    position: absolute; display: block; border-radius: 50%;
    /* the radial gradient is the softness — no filter: blur() on a layer the
       size of the screen (it pinned a renderer at 94 % CPU without a GPU) */
    animation: hp-drift 34s ease-in-out infinite alternate;
}
.hp-glow.a { width: 62vmax; height: 62vmax; left: -18vmax; top: -24vmax; background: radial-gradient(circle at 40% 40%, var(--hp-glow-a), transparent 64%); }
.hp-glow.b { width: 56vmax; height: 56vmax; right: -20vmax; top: 6vmax; background: radial-gradient(circle at 50% 50%, var(--hp-glow-b), transparent 62%); animation-duration: 41s; animation-delay: -12s; }
.hp-glow.c { width: 48vmax; height: 48vmax; left: 12vmax; bottom: -28vmax; background: radial-gradient(circle at 50% 50%, var(--hp-glow-c), transparent 62%); animation-duration: 47s; animation-delay: -20s; }
@keyframes hp-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .hp-glow { animation: none; } }

/* ---- the card ------------------------------------------------------------ */
.hp-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    padding: 36px 34px 30px;
    border-radius: 26px;
    background: var(--hp-card);
    border: 1px solid var(--hp-card-edge);
    box-shadow: var(--hp-shadow), inset 0 1px 0 var(--hp-card-shine);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    animation: hp-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes hp-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hp-card { animation: none; } }

.hp-head { text-align: center; margin-bottom: 26px; }
.hp-mark {
    width: 60px; height: 60px; display: block; margin: 0 auto 18px;
    filter: drop-shadow(0 10px 22px rgba(76, 110, 255, .45));
}
.hp-title {
    margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700;
    letter-spacing: -.025em; color: var(--hp-ink);
}
.hp-lead { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--hp-mut); }
.hp-domain {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 12px 0 0; padding: 5px 13px 5px 9px; border-radius: 999px;
    background: var(--hp-chip); color: var(--hp-chip-ink);
    font-size: 14px; font-weight: 600; letter-spacing: .005em;
}
.hp-at {
    display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    background: linear-gradient(135deg, var(--hp-accent), var(--hp-accent-2)); color: #fff;
    font-size: 12px; font-weight: 700; line-height: 1;
}

/* ---- the form Roundcube renders (loginform), reshaped -------------------- */
/* elastic places its form 20vh down, 320px wide and centred text — the card places it now */
body.task-login #login-form { position: static; top: auto; width: 100%; max-width: none; margin: 0; padding: 0;
    text-align: left; background: none; border: 0; box-shadow: none; }
body.task-login #login-form table,
body.task-login #login-form tbody,
body.task-login #login-form tr,
body.task-login #login-form td { display: block; width: 100%; margin: 0; padding: 0; border: 0; }
body.task-login #login-form tr { margin: 0 0 18px; }
body.task-login #login-form tr.form-group.row { margin-left: 0; margin-right: 0; }
body.task-login #login-form td.hp-label { display: block !important; }
body.task-login #login-form td.title label {
    display: block; margin: 0 0 7px; padding: 0;
    font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--hp-mut);
}
body.task-login #login-form .input-group-prepend { display: none !important; }
/* one typeface on the card: elastic sets Roboto on controls */
body.task-login #login-form .form-control,
body.task-login #rcmloginsubmit,
body.task-login #login-form label,
.hp-card, .hp-foot { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body.task-login #login-form td.input { position: relative; display: block; }
body.task-login #login-form .form-control {
    width: 100%; height: 50px; margin: 0;
    padding: 0 16px; border-radius: 13px !important;
    font-size: 16px; /* under 16px iOS zooms the page */
    color: var(--hp-ink);
    background: var(--hp-field);
    border: 1px solid var(--hp-field-edge);
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
body.task-login #login-form .hp-pass .form-control { padding-right: 52px; }
body.task-login #login-form .form-control:hover { border-color: var(--hp-field-hover); }
body.task-login #login-form .form-control:focus {
    outline: 0; border-color: var(--hp-accent);
    box-shadow: 0 0 0 4px var(--hp-ring);
    background: var(--hp-field);
    color: var(--hp-ink);
}
body.task-login #login-form .form-control::placeholder { color: var(--hp-mut); opacity: .55; }
body.task-login #login-form input:-webkit-autofill {
    -webkit-text-fill-color: var(--hp-ink);
    box-shadow: 0 0 0 40px var(--hp-field) inset;
    transition: background-color 9999s;
}

/* show / hide the password (hp-login.js) */
.hp-eye {
    position: absolute; right: 7px; top: 7px; width: 36px; height: 36px;
    display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--hp-mut); cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}
.hp-eye:hover { color: var(--hp-ink); background: var(--hp-field-edge); }
.hp-eye:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--hp-ring); color: var(--hp-ink); }
.hp-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hp-caps { margin: 8px 2px 0; font-size: 13px; font-weight: 600; color: var(--hp-warn); }
.hp-caps::before { content: "⇪ "; }

/* the button */
body.task-login #login-form p.formbuttons { margin: 26px 0 0; padding: 0; }
body.task-login #rcmloginsubmit {
    position: relative; width: 100%; height: 52px; margin: 0;
    border: 0; border-radius: 14px;
    background: linear-gradient(135deg, var(--hp-accent) 0%, #5a6cff 55%, var(--hp-accent-2) 100%);
    color: #fff; font-size: 16px; font-weight: 650; letter-spacing: .005em;
    text-transform: none;
    box-shadow: 0 14px 30px -14px rgba(76, 100, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
body.task-login #rcmloginsubmit:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 18px 36px -14px rgba(76, 100, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .25); }
body.task-login #rcmloginsubmit:active { transform: translateY(0) scale(.99); filter: brightness(.98); }
body.task-login #rcmloginsubmit:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--hp-ring), 0 14px 30px -14px rgba(76, 100, 255, .85); }
body.task-login #rcmloginsubmit.is-busy { color: transparent; pointer-events: none; }
body.task-login #rcmloginsubmit.is-busy::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
    animation: hp-spin .7s linear infinite;
}
@keyframes hp-spin { to { transform: rotate(360deg); } }

/* elastic's own footer inside the form (product name, version) — the page has its own */
body.task-login #login-footer { display: none; }

/* ---- the footnote -------------------------------------------------------- */
.hp-foot {
    position: absolute; z-index: 1; left: 0; right: 0; bottom: 22px;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    padding: 0 16px; font-size: 12.5px; color: var(--hp-mut); text-align: center;
}
.hp-foot a { color: var(--hp-ink); text-decoration: none; font-weight: 600; opacity: .85; }
.hp-foot a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.hp-morse { display: inline-flex; align-items: center; gap: 2px; opacity: .8; }
.hp-morse i, .hp-morse b { display: block; height: 4px; border-radius: 2px; background: var(--hp-accent); }
.hp-morse i { width: 4px; }
.hp-morse b { width: 10px; }

/* the login's messages (wrong password …): in the card (hp-login.js lifts
   them there); elastic's toast stays for a page without the script */
body.task-login #messagestack div { border-radius: 14px; }
body.task-login.hp-inline-errors #messagestack div.error,
body.task-login.hp-inline-errors #messagestack div.warning { display: none; }
.hp-error {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 0 0 18px; padding: 11px 14px; border-radius: 12px;
    font-size: 14px; line-height: 1.45; font-weight: 500;
    color: var(--hp-err-ink); background: var(--hp-err-bg); border: 1px solid var(--hp-err-edge);
}
.hp-error[hidden] { display: none; }
.hp-error::before {
    content: "!"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px;
    border-radius: 50%; background: var(--hp-err-ink); color: var(--hp-card-solid); font-weight: 800; font-size: 13px;
}

/* ---- phones -------------------------------------------------------------- */
@media (max-width: 480px) {
    body.task-login #layout-content.hp-login { justify-content: flex-start; padding: 56px 16px 88px; }
    .hp-card { padding: 30px 22px 24px; border-radius: 22px; }
    .hp-title { font-size: 27px; }
    .hp-mark { width: 54px; height: 54px; margin-bottom: 14px; }
}

/* ---- inside the webmail: the menu's mark (skin_logo = images/mark.svg) --- */
#layout-menu .popover-header img,
#layout-menu #logo,
#layout-menu img.logo {
    width: 44px !important; height: 44px !important; max-width: 44px !important; max-height: 44px !important;
    object-fit: contain; margin: 14px auto 10px; display: block;
    filter: drop-shadow(0 6px 14px rgba(76, 110, 255, .35));
}
