/* WASDEV Mail — page de connexion: même style que l'espace client et le super admin WASDEV */
body.task-login {
  --w-bg: #0a0a0d; --w-card: #14131b; --w-line: #262433; --w-fg: #ece9f5; --w-dim: #a8a4b8; --w-mute: #6f6b82;
  --w-purple: #8b5cf6; --w-purple-l: #b794ff; --w-grad: linear-gradient(100deg, #8b5cf6 0%, #6d8bff 55%, #0098ff 100%);
  background: radial-gradient(70% 60% at 50% 100%, rgba(109, 40, 217, .18), transparent 70%), var(--w-bg) !important;
  color: var(--w-fg); font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
}
body.task-login #layout { background: transparent; }
/* Elastic centre le texte et rétrécit la carte: on remet un bloc qui défile, carte centrée avec margin:auto (jamais coupée) */
body.task-login #layout-content {
  background: transparent !important; border: 0 !important; display: flex !important; flex-direction: column; justify-content: flex-start !important;
  align-items: stretch; text-align: left !important; padding: 28px 16px; overflow-y: auto;
}
body.task-login #layout-content > #logo { display: none; }

.wauth { flex: none; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; max-width: 1000px; border: 1px solid var(--w-line);
  border-radius: 22px; overflow: hidden; background: var(--w-card); box-shadow: 0 40px 120px -40px rgba(109, 40, 217, .55); }
.wauth__brand { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 48px 42px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, rgba(139, 92, 246, .32), transparent 60%),
              radial-gradient(90% 80% at 100% 100%, rgba(0, 152, 255, .22), transparent 60%), #0c0b14; border-right: 1px solid var(--w-line); }
.wauth__logo { position: relative; width: 92px; height: 92px; margin-bottom: 10px; }
.wauth__logo::before { content: ""; position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .55), rgba(0, 152, 255, .15) 55%, transparent 70%); filter: blur(10px); animation: aglow 3.2s ease-in-out infinite; }
.alogo { position: relative; display: block; width: 100%; height: 100%; }
.alogo path { transform-box: fill-box; transform-origin: center; }
.alogo__l { animation: aleft 3.2s ease-in-out infinite; }
.alogo__r { animation: aright 3.2s ease-in-out infinite; }
.alogo__s { animation: aslash 3.2s ease-in-out infinite; }
@keyframes aleft { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
@keyframes aright { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes aslash { 0%, 100% { opacity: .75; transform: rotate(0); } 50% { opacity: 1; transform: rotate(8deg); } }
@keyframes aglow { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
.wauth__name { margin: 0; font-size: 2.25rem; font-weight: 800; letter-spacing: .08em; line-height: 1.1; color: var(--w-fg); }
.wauth__name b { background: var(--w-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wauth__motto { margin: 0 0 22px; color: var(--w-dim); font-size: 1rem; }
.wauth__tag { margin: 18px 0 0; display: inline-block; align-self: flex-start; color: var(--w-purple-l); background: rgba(139, 92, 246, .14);
  border: 1px solid rgba(139, 92, 246, .3); padding: 3px 12px; border-radius: 999px; font-size: .92rem; font-weight: 650; }
/* code qui se tape: chaque ligne grandit lettre par lettre, reste, puis s'efface (en boucle) */
.acode { padding: 14px 16px; border: 1px solid rgba(139, 92, 246, .28); border-radius: 12px; background: rgba(8, 7, 14, .75);
  font: .9rem/1.75 "Cascadia Code", Consolas, ui-monospace, monospace; color: #cfc9e6; }
.acode__l { display: block; width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; animation: atype 9s steps(var(--n)) infinite both; }
.acode__l.l1 { --n: 29; --w: 29ch; }
.acode__l.l2 { --n: 32; --w: 32ch; animation-delay: 1.1s; }
.acode__l.l3 { --n: 29; --w: 29ch; animation-delay: 2.2s; }
.acode__l.l3::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: #b794ff; animation: acaret 1s steps(1) infinite; }
@keyframes atype { 0% { width: 0; } 18%, 82% { width: var(--w); } 96%, 100% { width: 0; } }
@keyframes acaret { 50% { opacity: 0; } }
.acode i { font-style: normal; }
.acode .k { color: #b794ff; }
.acode .f { color: #6db8ff; }
.acode .s { color: #34d399; }
.acode .o { color: #8b5cf6; }

.wauth__form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.wauth__title { margin: 0 0 10px; font-size: 2.1rem; font-weight: 700; letter-spacing: -.015em; color: var(--w-fg); }
.wauth__lead { margin: 0 0 18px; color: var(--w-dim); font-size: 1.05rem; line-height: 1.6; }

/* formulaire Roundcube (Elastic) habillé en WASDEV */
body.task-login #login-form { position: static !important; top: auto !important; max-width: none !important; width: 100%; height: auto !important;
  margin: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; text-align: left; }
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%; border: 0; padding: 0; background: transparent; }
body.task-login #login-form td.title { display: block !important; margin: 12px 0 6px; color: var(--w-dim); font-size: 1rem; text-align: left; }
body.task-login #login-form td.title label { color: var(--w-dim); }
body.task-login #login-form .input-group { flex-wrap: nowrap; }
body.task-login #login-form .input-group-prepend, body.task-login #login-form .input-group-text { display: none !important; }
body.task-login #login-form input.form-control {
  width: 100%; height: 50px; padding: 0 14px; font-size: 1.05rem; color: var(--w-fg) !important; background: #0b0a10 !important;
  border: 1px solid var(--w-line) !important; border-radius: 12px !important; box-shadow: none !important;
}
body.task-login #login-form input.form-control:focus { border-color: var(--w-purple) !important; box-shadow: 0 0 0 3px rgba(139, 92, 246, .25) !important; }
body.task-login #login-form input::placeholder { color: var(--w-mute); }
body.task-login #login-form .formbuttons { margin: 22px 0 0; padding: 0; }
body.task-login #rcmloginsubmit {
  width: 100%; height: 52px; border: 0 !important; border-radius: 12px !important; background: var(--w-grad) !important; color: #fff !important;
  font-size: 1.1rem; font-weight: 700; text-transform: none !important; letter-spacing: 0; box-shadow: 0 12px 30px -12px rgba(109, 40, 217, .8); cursor: pointer;
}
body.task-login #rcmloginsubmit:hover { filter: brightness(1.08); }
body.task-login #login-footer { margin-top: 22px; text-align: center; color: var(--w-mute); font-size: .92rem; }
body.task-login #login-footer a { color: var(--w-purple-l); }
body.task-login #messagestack { z-index: 50; }

/* œil mauve: afficher / masquer le mot de passe */
.wpw { position: relative; display: block; width: 100%; }
.wpw input.form-control { padding-right: 50px !important; }
.wpw__eye { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--w-purple); cursor: pointer; }
.wpw__eye:hover { color: var(--w-purple-l); background: rgba(139, 92, 246, .14); }
.wpw__eye .wpw__hide, .wpw__eye.on .wpw__show { display: none; }
.wpw__eye.on .wpw__hide { display: block; }

/* «Mot de passe oublié ?» */
.wforgot { margin: 16px 0 0; text-align: center; font-size: 1rem; }
.wforgot a { color: var(--w-purple-l); }

/* étape 2: code de l'application d'authentification */
body.w2fa #login-form input.wcode { height: 58px; text-align: center; font: 700 1.6rem/1 "Cascadia Code", Consolas, ui-monospace, monospace !important;
  letter-spacing: .45em; padding-left: calc(14px + .45em); }
body.w2fa #login-form td.w2fa__trust { display: flex !important; gap: 12px; align-items: flex-start; margin: 18px 0 0; color: var(--w-fg); }
body.w2fa #login-form td.w2fa__trust input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: #8b5cf6; cursor: pointer; }
body.w2fa #login-form td.w2fa__trust label { color: var(--w-fg); cursor: pointer; }

@media (max-width: 820px) {
  .wauth { grid-template-columns: 1fr; }
  .wauth__brand { padding: 24px 22px 20px; border-right: 0; border-bottom: 1px solid var(--w-line); }
  .wauth__logo { width: 56px; height: 56px; margin-bottom: 4px; }
  .wauth__name { font-size: 1.6rem; }
  .wauth__motto { margin-bottom: 14px; }
  .acode { padding: 10px 12px; font-size: .74rem; }
  .wauth__form { padding: 26px 22px; }
  .wauth__title { font-size: 1.7rem; }
  body.task-login #layout-content { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .alogo path, .wauth__logo::before, .acode__l, .acode__l.l3::after { animation: none; }
  .acode__l { width: auto; }
}
