/* Webmail login - "liquid glass" design shared by every mail.<domain> host (Roundcube 1.6 / Elastic).
   Scoped to body.task-login, injected by nginx on the login screen only; no Roundcube file is modified.
   Per-domain colours come from themes/<host>.css:  --cb-a (accent, white text on it passes AA), --cb-a-rgb, --cb-b (second hue), --cb-b-rgb. */

body.task-login {
  --cb-a: #4452e0; --cb-a-rgb: 68 82 224; --cb-b: #7080ff; --cb-b-rgb: 112 128 255;
  --ink: #101828; --muted: #5b6577; --label: #232b3a; --line: rgb(16 24 40 / 14%);
  --glass: rgb(255 255 255 / 56%); --glass-edge: rgb(255 255 255 / 85%); --field: rgb(255 255 255 / 78%); --field-focus: #fff;
  --field-solid: #fff; --plate: #fff; --shadow: 16 24 40;
  margin: 0; min-height: 100vh; color: var(--ink); overflow-x: hidden;
  font-family: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 700px at 8% -10%, rgb(var(--cb-a-rgb) / 22%), transparent 60%),
    radial-gradient(900px 640px at 100% 108%, rgb(var(--cb-b-rgb) / 24%), transparent 60%),
    linear-gradient(160deg, #f6f8fd 0%, #eef1f9 100%) fixed;
}
html.dark-mode body.task-login {
  --ink: #f2f5fb; --muted: #aab4c8; --label: #dfe5f1; --line: rgb(255 255 255 / 16%);
  --glass: rgb(22 28 46 / 52%); --glass-edge: rgb(255 255 255 / 16%); --field: rgb(8 12 24 / 55%); --field-focus: rgb(8 12 24 / 85%);
  --field-solid: #0b1020; --plate: #fff; --shadow: 0 0 0;
  background:
    radial-gradient(1100px 700px at 8% -10%, rgb(var(--cb-a-rgb) / 34%), transparent 60%),
    radial-gradient(900px 640px at 100% 108%, rgb(var(--cb-b-rgb) / 30%), transparent 60%),
    linear-gradient(160deg, #080c18 0%, #0d1426 100%) fixed;
}

/* soft colour orbs behind the glass: this is what makes the blur visible */
body.task-login::before, body.task-login::after { content: ""; position: fixed; z-index: 0; border-radius: 50%; pointer-events: none; }
body.task-login::before {
  width: 360px; height: 360px; left: calc(50% - 400px); top: 14%;
  background: radial-gradient(circle at 35% 30%, rgb(var(--cb-a-rgb) / 70%), rgb(var(--cb-a-rgb) / 0%) 70%);
  filter: blur(8px); animation: cb-float-a 18s ease-in-out infinite;
}
body.task-login::after {
  width: 300px; height: 300px; right: calc(50% - 380px); bottom: 10%;
  background: radial-gradient(circle at 40% 35%, rgb(var(--cb-b-rgb) / 70%), rgb(var(--cb-b-rgb) / 0%) 70%);
  filter: blur(8px); animation: cb-float-b 22s ease-in-out infinite;
}
@keyframes cb-float-a { 50% { transform: translate(40px, 50px) scale(1.08); } }
@keyframes cb-float-b { 50% { transform: translate(-44px, -36px) scale(.92); } }

body.task-login #layout { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: transparent; }

/* ---- the glass card */
body.task-login #layout-content {
  color: var(--ink); position: relative; isolation: isolate; width: min(440px, 100%); max-width: 100%; margin: 0; left: auto; top: auto; transform: none;
  padding: 34px 34px 24px; display: flex; flex-direction: column;
  border: 1px solid var(--glass-edge); border-radius: 30px; background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 70%), inset 0 -1px 0 rgb(255 255 255 / 12%), inset 1px 0 0 rgb(255 255 255 / 25%),
    0 1px 2px rgb(var(--shadow) / 10%), 0 24px 60px -24px rgb(var(--shadow) / 45%), 0 60px 120px -50px rgb(var(--cb-a-rgb) / 45%);
  animation: cb-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
/* liquid-glass highlight sweeping across the top-left of the card */
body.task-login #layout-content::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, rgb(255 255 255 / 55%) 0%, rgb(255 255 255 / 0%) 34%), radial-gradient(420px 160px at 90% 0%, rgb(var(--cb-b-rgb) / 14%), transparent 70%);
}
html.dark-mode body.task-login #layout-content::after { background: linear-gradient(155deg, rgb(255 255 255 / 14%) 0%, rgb(255 255 255 / 0%) 32%), radial-gradient(420px 160px at 90% 0%, rgb(var(--cb-b-rgb) / 18%), transparent 70%); }
@keyframes cb-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* Elastic positions the login elements with offsets - reset them */
body.task-login #logo, body.task-login #login-form, body.task-login #login-footer {
  position: static !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important; transform: none; max-width: none;
}

/* ---- logo on a white plate (works for transparent, dark-tile and photo logos, in light and dark mode) */
body.task-login #logo {
  order: 1; opacity: 1 !important; display: block; width: auto; height: auto; max-width: min(250px, 80%); max-height: 86px; margin: 0 auto 20px; box-sizing: content-box;
  padding: 13px 20px; border-radius: 22px; background: var(--plate); object-fit: contain;
  box-shadow: 0 1px 0 rgb(255 255 255 / 80%) inset, 0 0 0 1px rgb(var(--shadow) / 6%), 0 18px 34px -16px rgb(var(--shadow) / 45%), 0 8px 24px -12px rgb(var(--cb-a-rgb) / 45%);
}
body.task-login #layout-content::before {
  order: 2; content: "Welcome back"; display: block; text-align: center; font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
}
body.task-login #login-form { order: 3; margin: 0; padding: 0; width: 100% !important; background: transparent; box-shadow: none; border: 0; }
body.task-login #login-form::before { content: "Sign in with your full email address"; display: block; text-align: center; color: var(--muted); font-size: 14.5px; margin: 6px 0 24px; }

/* ---- fields: table -> stacked label + input. Roundcube's script hides the label cell and adds an icon box and a "Username" placeholder; both are handled here */
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 !important; width: 100%; padding: 0; border: 0; background: transparent; }
body.task-login #login-form tr { margin: 0 0 16px; text-align: left; position: relative; }
body.task-login #login-form td.title { display: none !important; }
body.task-login #login-form tr::before { display: block; margin: 0 0 7px 3px; font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--label); }
body.task-login #login-form tr:nth-child(1)::before { content: "Email address"; }
body.task-login #login-form tr:nth-child(2)::before { content: "Password"; }
body.task-login #login-form .input-group-prepend { display: none !important; }
body.task-login #login-form .input-group { display: block !important; position: relative; }
body.task-login #login-form input.form-control {
  display: block; width: 100% !important; height: 52px; padding: 0 16px 0 48px; margin: 0; border-radius: 16px !important; border: 1px solid var(--line);
  background-color: var(--field); background-repeat: no-repeat; background-position: 16px center; background-size: 20px; color: var(--ink); caret-color: var(--cb-a);
  font-size: 16px; box-shadow: inset 0 1px 2px rgb(var(--shadow) / 6%); outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
body.task-login #login-form #rcmloginpwd { padding-right: 50px; }
body.task-login #login-form #rcmloginuser { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a869a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m3.5 7.5 8.5 6 8.5-6'/%3E%3C/svg%3E"); }
body.task-login #login-form #rcmloginpwd { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a869a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='3'/%3E%3Cpath d='M8 10.5V8a4 4 0 0 1 8 0v2.5'/%3E%3C/svg%3E"); }
body.task-login #login-form input.form-control:focus { border-color: var(--cb-a); background-color: var(--field-focus); box-shadow: 0 0 0 4px rgb(var(--cb-a-rgb) / 20%), inset 0 1px 2px rgb(var(--shadow) / 4%); }
body.task-login #login-form input.form-control::placeholder { color: var(--muted); opacity: .55; }
body.task-login #login-form input.form-control:-webkit-autofill, body.task-login #login-form input.form-control:-webkit-autofill:hover, body.task-login #login-form input.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important; caret-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px var(--field-solid) inset !important; box-shadow: 0 0 0 1000px var(--field-solid) inset !important; transition: background-color 9999s ease-out 0s;
}

/* show / hide password (added by cb-login.js) */
body.task-login .cb-eye {
  position: absolute; right: 8px; bottom: 7px; width: 38px; height: 38px; border: 0; border-radius: 12px; background: transparent; color: #7a869a; cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: background-color .15s, color .15s;
}
body.task-login .cb-eye:hover { background: rgb(var(--cb-a-rgb) / 12%); color: var(--cb-a); }
body.task-login .cb-eye:focus-visible { outline: 2px solid var(--cb-a); outline-offset: 1px; }
body.task-login .cb-eye svg { width: 21px; height: 21px; }
body.task-login .cb-eye .cb-off { display: none; }
body.task-login .cb-eye[aria-pressed="true"] .cb-on { display: none; }
body.task-login .cb-eye[aria-pressed="true"] .cb-off { display: block; }
body.task-login .cb-caps { display: none; margin: 7px 3px 0; font-size: 12.5px; color: #b45309; font-weight: 600; }
html.dark-mode body.task-login .cb-caps { color: #fbbf24; }
body.task-login .cb-caps.on { display: block; }

/* forgot password row */
body.task-login .cb-row { display: flex; justify-content: flex-end; margin: -4px 2px 0; }
body.task-login .cb-link { background: none; border: 0; padding: 4px 2px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--cb-a); border-radius: 6px; text-decoration: none; }
html.dark-mode body.task-login .cb-link { color: color-mix(in srgb, var(--cb-a) 45%, #fff); }
body.task-login .cb-link:hover { text-decoration: underline; text-underline-offset: 3px; }
body.task-login .cb-link:focus-visible { outline: 2px solid var(--cb-a); outline-offset: 2px; }

/* ---- sign-in button */
body.task-login #login-form p.formbuttons { margin: 22px 0 0; padding: 0; text-align: center; }
body.task-login #login-form #rcmloginsubmit {
  position: relative; overflow: hidden; width: 100% !important; height: 54px; border: 0; border-radius: 16px !important; cursor: pointer; font-size: 0; color: #fff; text-transform: none !important;
  background: linear-gradient(105deg, var(--cb-a) 0%, var(--cb-g2, var(--cb-a)) 100%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 35%) inset, 0 -1px 0 rgb(0 0 0 / 12%) inset, 0 16px 28px -14px rgb(var(--cb-a-rgb) / 85%);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
body.task-login #login-form #rcmloginsubmit::after { content: "Sign in"; font-size: 16.5px; font-weight: 650; letter-spacing: .01em; color: #fff; }
body.task-login #login-form #rcmloginsubmit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(255 255 255 / 22%), rgb(255 255 255 / 0%) 55%); pointer-events: none; }
body.task-login #login-form #rcmloginsubmit:hover { transform: translateY(-1px); filter: saturate(1.1) brightness(1.04); box-shadow: 0 1px 0 rgb(255 255 255 / 35%) inset, 0 20px 32px -14px rgb(var(--cb-a-rgb) / 90%); }
body.task-login #login-form #rcmloginsubmit:active { transform: translateY(0); }
body.task-login #login-form #rcmloginsubmit:focus-visible { outline: 3px solid rgb(var(--cb-b-rgb) / 70%); outline-offset: 3px; }
body.task-login #login-form #rcmloginsubmit.cb-busy { pointer-events: none; filter: saturate(.8); }
body.task-login #login-form #rcmloginsubmit.cb-busy::after { content: "Signing in\2026"; }

/* ---- footer */
body.task-login #login-footer { margin: 24px 0 0; padding: 15px 0 0; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
body.task-login #login-footer .cb-secure { display: block; font-weight: 600; letter-spacing: .02em; color: #2f7d4f; margin-bottom: 4px; }
html.dark-mode body.task-login #login-footer .cb-secure { color: #7bd69b; }
body.task-login #login-footer a { color: var(--cb-a); font-weight: 600; }
body.task-login .noscriptwarning { position: relative; z-index: 2; max-width: 440px; margin: 12px auto; }
body.task-login #messagestack { z-index: 5; }

/* ---- modals (forgot password, help) */
.cb-modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 18px; background: rgb(8 12 24 / 38%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cb-modal.open { display: grid; animation: cb-fade .18s ease-out both; }
@keyframes cb-fade { from { opacity: 0; } }
.cb-dialog {
  position: relative; isolation: isolate; width: min(460px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 28px 28px 24px; border-radius: 26px;
  font-family: "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Arial, sans-serif; color: #101828;
  background: rgb(255 255 255 / 78%); border: 1px solid rgb(255 255 255 / 85%); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 30px 80px -20px rgb(8 12 24 / 55%); animation: cb-pop .25s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes cb-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
html.dark-mode .cb-dialog { color: #f2f5fb; background: rgb(20 26 44 / 78%); border-color: rgb(255 255 255 / 14%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%), 0 30px 80px -20px rgb(0 0 0 / 75%); }
.cb-dialog h2 { margin: 0 34px 6px 0; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.cb-dialog p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: #5b6577; }
html.dark-mode .cb-dialog p { color: #aab4c8; }
.cb-x { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 11px; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; opacity: .65; }
.cb-x:hover { background: rgb(128 138 160 / 20%); opacity: 1; }
.cb-x:focus-visible, .cb-dialog button:focus-visible, .cb-dialog a:focus-visible, .cb-dialog input:focus-visible { outline: 2px solid var(--cb-a, #4452e0); outline-offset: 2px; }
.cb-dialog label { display: block; margin: 0 0 6px 2px; font-size: 13px; font-weight: 650; }
.cb-dialog input[type=email] {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid rgb(16 24 40 / 16%); background: rgb(255 255 255 / 85%); color: #101828; font-size: 15.5px; box-sizing: border-box; margin-bottom: 12px;
}
html.dark-mode .cb-dialog input[type=email] { background: rgb(8 12 24 / 60%); color: #f2f5fb; border-color: rgb(255 255 255 / 18%); }
.cb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border: 0; border-radius: 14px; cursor: pointer; text-decoration: none; font: inherit; font-size: 15px; font-weight: 650;
  color: #fff !important; background: linear-gradient(105deg, var(--cb-a, #4452e0), var(--cb-g2, var(--cb-a, #4452e0)));
  box-shadow: 0 1px 0 rgb(255 255 255 / 30%) inset, 0 12px 22px -12px rgb(var(--cb-a-rgb, 68 82 224) / 80%);
}
.cb-btn:hover { filter: brightness(1.06); }
.cb-btn.ghost { color: inherit !important; background: rgb(128 138 160 / 14%); box-shadow: none; border: 1px solid rgb(128 138 160 / 28%); }
.cb-btn.ghost:hover { background: rgb(128 138 160 / 22%); filter: none; }
.cb-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 12.5px; color: #7a869a; }
.cb-or::before, .cb-or::after { content: ""; flex: 1; height: 1px; background: rgb(128 138 160 / 30%); }
.cb-note { font-size: 12.5px !important; color: #7a869a !important; margin: 10px 0 0 !important; }
.cb-list { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.cb-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgb(128 138 160 / 12%); font-size: 14.5px; }
.cb-list svg { width: 20px; height: 20px; flex: none; color: var(--cb-a, #4452e0); }
html.dark-mode .cb-list svg { color: color-mix(in srgb, var(--cb-a, #4452e0) 45%, #fff); }
.cb-list a { color: inherit; font-weight: 600; text-decoration: none; word-break: break-all; }
.cb-list a:hover { text-decoration: underline; }
.cb-list small { display: block; font-size: 12px; opacity: .65; font-weight: 400; }
.cb-acc { margin: 6px 0 0; border-radius: 14px; background: rgb(128 138 160 / 12%); }
.cb-acc summary { cursor: pointer; padding: 13px 14px; font-weight: 650; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; }
.cb-acc summary::after { content: "+"; font-size: 18px; line-height: 1; opacity: .6; }
.cb-acc[open] summary::after { content: "\2212"; }
.cb-acc summary::-webkit-details-marker { display: none; }
.cb-acc dl { margin: 0; padding: 0 14px 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.cb-acc dt { opacity: .65; } .cb-acc dd { margin: 0; font-weight: 600; word-break: break-all; }

@media (max-width: 480px) {
  body.task-login #layout-content { padding: 28px 20px 20px; border-radius: 26px; }
  body.task-login #layout-content::before { font-size: 25px; }
  body.task-login::before { width: 220px; height: 220px; left: -60px; }
  body.task-login::after { width: 200px; height: 200px; right: -60px; }
  .cb-dialog { padding: 24px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body.task-login::before, body.task-login::after, body.task-login #layout-content, .cb-modal.open, .cb-dialog { animation: none; }
  body.task-login #login-form #rcmloginsubmit, body.task-login #login-form input.form-control { transition: none; }
}
@supports not (backdrop-filter: blur(1px)) { body.task-login #layout-content { background: rgb(255 255 255 / 88%); } html.dark-mode body.task-login #layout-content { background: rgb(18 24 40 / 92%); } .cb-dialog { background: rgb(255 255 255 / 96%); } html.dark-mode .cb-dialog { background: rgb(18 24 40 / 97%); } }

/* "password changed" note on the login card */
body.task-login .cb-notice { order: 3; margin: 14px 0 0; padding: 12px 16px; border-radius: 16px; background: rgb(22 163 74 / 13%); border: 1px solid rgb(22 163 74 / 34%); color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.45; text-align: center; }
