/* ============================================================
   leck.ai Webmail - Anmeldeseite
   Dunkel, kantig, mit Partikelfeld. Alles unter body.task-login
   gekapselt, damit nichts in die eigentliche Mailoberflaeche leckt.
   ============================================================ */

body.task-login {
  --lh-bg:        #05070b;
  --lh-bg-2:      #080c14;
  --lh-panel:     rgba(10, 15, 24, 0.94);
  --lh-line:      rgba(126, 196, 255, 0.24);
  --lh-line-warm: rgba(126, 196, 255, 0.42);
  --lh-text:      #e8eef6;
  --lh-muted:     #74839a;
  --lh-accent:    #4fdcff;
  --lh-accent-2:  #a970ff;
  --lh-glow:      rgba(79, 220, 255, 0.55);

  background: var(--lh-bg) !important;
  color: var(--lh-text);
  overflow: hidden;
}

/* ---------- Hintergrund: Nebel, Raster, Partikel-Leinwand ---------- */

#lh-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Zwei weiche Lichtquellen - erzeugen den Dunst */
body.task-login::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 46vh at 18% 12%, rgba(56, 152, 214, 0.16), transparent 62%),
    radial-gradient(46vw 40vh at 86% 88%, rgba(150, 84, 255, 0.13), transparent 64%),
    linear-gradient(160deg, var(--lh-bg) 0%, var(--lh-bg-2) 55%, #04060a 100%);
}

/* Feines Raster plus Scanlines - der Pixelanteil */
body.task-login::after {
  content: "";
  position: fixed;
  inset: -2px;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(126, 196, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 196, 255, 0.045) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  background-size: 46px 46px, 46px 46px, 100% 3px;
  animation: lh-drift 32s linear infinite;
  opacity: 0.85;
}

@keyframes lh-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 46px 46px, 46px 46px, 0 0; }
}

/* ---------- Buehne ---------- */

body.task-login #layout,
body.task-login #layout-content {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Elastic klemmt das Layout auf Bildschirmhoehe und schneidet ab.
   Beides muss weg, sonst verschwindet die zentrierte Karte. */
body.task-login #layout {
  overflow: visible !important;
  height: auto !important;
  min-height: 100vh;
  display: block !important;
}

body.task-login #layout-content {
  display: flex !important;
  flex: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: left !important;
  overflow: visible !important;
}

/* Roundcube-Logo weicht dem eigenen Schriftzug */
body.task-login #logo { display: none !important; }

/* Unsichtbare Ueberschrift darf keinen Platz belegen */
body.task-login h1.voice {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Kopfzeile ---------- */

body.task-login .lh-head {
  width: 100%;
  max-width: 392px;
  margin: 0 0 22px;
  animation: lh-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.task-login .lh-mark {
  font: 700 34px/1 ui-sans-serif, "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.028em;
  color: var(--lh-text);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

body.task-login .lh-mark span {
  color: var(--lh-accent);
  text-shadow: 0 0 18px var(--lh-glow);
}

body.task-login .lh-sub {
  margin-top: 9px;
  font: 500 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--lh-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Kurzer Akzentstrich hinter dem Untertitel */
body.task-login .lh-sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--lh-line-warm), transparent);
}

/* ---------- Anmeldefeld ---------- */

body.task-login #login-form {
  position: relative;
  /* Elastic schiebt das Formular mit top:20vh nach unten - zuruecknehmen */
  top: 0 !important;
  width: 100% !important;
  max-width: 392px !important;
  margin: 0 auto !important;
  padding: 30px 30px 26px;
  background: var(--lh-panel);
  border: 1px solid var(--lh-line);
  border-radius: 0;
  box-shadow:
    0 26px 70px -24px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  animation: lh-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

/* Akzentkante oben */
body.task-login #login-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 78px;
  height: 2px;
  background: linear-gradient(90deg, var(--lh-accent), transparent);
}

/* Winkel unten rechts */
body.task-login #login-form::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 16px;
  height: 16px;
  border-right: 1px solid var(--lh-line-warm);
  border-bottom: 1px solid var(--lh-line-warm);
  pointer-events: none;
}

@keyframes lh-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ---------- Formular: Tabellenlayout aufloesen ---------- */

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% !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

body.task-login #login-form tr { margin-bottom: 17px; }

body.task-login #login-form td.title,
body.task-login #login-form label {
  font: 500 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace !important;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left !important;
  color: var(--lh-muted) !important;
  margin: 0 0 7px !important;
  display: block !important;
}

/* ---------- Eingabefelder ---------- */

/* Elastic baut per JavaScript ein Symbol vor jedes Feld und macht
   die Zelle zur .input-group. Beides wird hier auf eine gemeinsame
   Unterkante gebracht, statt es zu verstecken. */
body.task-login #login-form td.input-group,
body.task-login #login-form .input-group {
  display: flex !important;
  /* Bootstrap setzt hier flex-wrap:wrap - zusammen mit einem
     100 Prozent breiten Feld rutscht das Symbol sonst in die
     Zeile darueber */
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--lh-line);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

body.task-login #login-form .input-group:hover {
  border-bottom-color: var(--lh-line-warm);
}

body.task-login #login-form .input-group:focus-within {
  border-bottom-color: var(--lh-accent);
  background: rgba(79, 220, 255, 0.035);
  box-shadow: 0 6px 22px -14px var(--lh-glow);
}

body.task-login #login-form .input-group-prepend {
  display: flex !important;
  align-items: center;
  flex: 0 0 auto;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.task-login #login-form i.input-group-text,
body.task-login #login-form .input-group-text {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  color: #55637a !important;
  font-size: 14px !important;
  line-height: 1 !important;
  transition: color 0.22s ease;
}

body.task-login #login-form .input-group:focus-within i.input-group-text {
  color: var(--lh-accent) !important;
}

body.task-login #login-form input.form-control {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 10px 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: var(--lh-text) !important;
  font: 400 15px/1.3 ui-sans-serif, "Segoe UI", system-ui, sans-serif !important;
}

body.task-login #login-form input.form-control::placeholder { color: #46536a; }

body.task-login #login-form input.form-control:focus {
  outline: 0 !important;
  box-shadow: none !important;
}

/* Chrome faerbt automatisch ausgefuellte Felder sonst weiss */
body.task-login #login-form input:-webkit-autofill,
body.task-login #login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--lh-text);
  -webkit-box-shadow: 0 0 0 1000px #0a0f18 inset;
  caret-color: var(--lh-text);
}

/* ---------- Schaltflaeche ---------- */

body.task-login #rcmloginsubmit,
body.task-login #login-form button.mainaction {
  position: relative;
  width: 100% !important;
  margin-top: 26px !important;
  padding: 13px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(100deg, var(--lh-accent) 0%, #7ac8ff 52%, var(--lh-accent-2) 160%) !important;
  color: #04121c !important;
  font: 700 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace !important;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 30px -14px var(--lh-glow);
}

body.task-login #rcmloginsubmit:hover {
  transform: translate3d(0, -2px, 0);
  filter: brightness(1.08);
  box-shadow: 0 16px 40px -14px var(--lh-glow);
}

body.task-login #rcmloginsubmit:active {
  transform: translate3d(0, 0, 0);
  filter: brightness(0.96);
}

body.task-login #rcmloginsubmit:focus-visible {
  outline: 2px solid var(--lh-accent);
  outline-offset: 3px;
}

/* ---------- Fusszeile und Meldungen ---------- */

body.task-login #login-footer {
  margin-top: 22px !important;
  padding-top: 16px;
  border-top: 1px solid rgba(126, 196, 255, 0.07);
  font: 400 10px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #56637a !important;
  text-align: center;
}

body.task-login #messagestack {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(392px, calc(100vw - 48px));
}

body.task-login #messagestack div {
  border-radius: 0 !important;
  border: 1px solid var(--lh-line) !important;
  background: rgba(12, 17, 26, 0.94) !important;
  color: var(--lh-text) !important;
  font: 400 12px/1.5 ui-sans-serif, "Segoe UI", system-ui, sans-serif !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
}

body.task-login #messagestack div.error {
  border-left: 2px solid #ff5470 !important;
}

/* ---------- Statuszeile unten ---------- */

body.task-login .lh-status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  font: 400 9px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #3f4a5c;
  pointer-events: none;
}

body.task-login .lh-status b {
  font-weight: 400;
  color: var(--lh-accent);
  opacity: 0.75;
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 480px) {
  body.task-login #login-form { padding: 28px 22px 24px; }
  body.task-login .lh-mark { font-size: 28px; }
  body.task-login .lh-status { display: none; }
}

/* ---------- Ruhigere Darstellung, wenn gewuenscht ---------- */

@media (prefers-reduced-motion: reduce) {
  body.task-login::after { animation: none; }
  body.task-login .lh-head,
  body.task-login #login-form { animation: none; }
  body.task-login #rcmloginsubmit { transition: none; }
}
