/* ==========================================================================
   SMLK-branded login screen for the Elastic skin
   Mirrors the design tokens of smlk.hu (assets/css/style.css)
   Scoped entirely to body.task-login so no other Roundcube screen is affected.
   ========================================================================== */

:root {
  --smlk-bg-950: #05070b;
  --smlk-bg-900: #0a0d13;
  --smlk-bg-800: #12161f;
  --smlk-line: #212836;
  --smlk-line-strong: #303a4c;

  --smlk-blue: #2f6fed;
  --smlk-blue-hover: #1d54c4;
  --smlk-blue-light: #7ba4ff;
  --smlk-blue-dim: rgba(47, 111, 237, 0.14);

  --smlk-ink: #eef1f7;
  --smlk-ink-soft: #9aa3b8;
  --smlk-ink-faint: #626b80;

  --smlk-radius-sm: 6px;
  --smlk-radius-lg: 14px;

  --smlk-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --smlk-font-body: 'Inter', 'Segoe UI', sans-serif;
}

html {
  background: var(--smlk-bg-950);
}
body.task-login {
  background: var(--smlk-bg-950) !important;
  font-family: var(--smlk-font-body);
  color: var(--smlk-ink);
  position: relative;
}

/* Blueprint-grid backdrop, echoes the hero section on smlk.hu */
body.task-login::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--smlk-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--smlk-line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 82%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 82%);
}

body.task-login .task-login#layout-content,
body.task-login #layout-content {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

/* ---------- Brand block (replaces default Roundcube logo) ---------- */
.smlk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  top: 12vh;
}
.smlk-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--smlk-radius-sm);
  background: var(--smlk-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.smlk-brand-mark svg { width: 22px; height: 22px; }
.smlk-brand-text { display: flex; flex-direction: column; align-items: flex-start; }
.smlk-brand-name {
  font-family: var(--smlk-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  color: var(--smlk-ink);
  text-decoration: none;
  transition: color 0.15s ease;
}
.smlk-brand-name:hover { color: var(--smlk-blue-light); }
.smlk-brand-sub {
  font-family: var(--smlk-font-body);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--smlk-ink-faint);
  margin-top: 2px;
  cursor: default;
}

body.task-login #logo {
  display: none;
}

/* ---------- Login card ---------- */
body.task-login #login-form {
  top: 16vh;
  max-width: 360px;
  background: var(--smlk-bg-800);
  border: 1px solid var(--smlk-line);
  border-radius: var(--smlk-radius-lg);
  padding: 32px 28px 26px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6);
  text-align: left;
}

/* Linearize the login table into a predictable block layout so every row's
   height is exactly its visible content — needed so the inset icons (below)
   can center themselves against the input alone, not against extra padding. */
body.task-login #login-form table.propform,
body.task-login #login-form table.propform tbody,
body.task-login #login-form table.propform tr {
  display: block;
  width: 100%;
}

body.task-login #login-form td.title {
  display: none;
}

body.task-login #login-form td.input {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
}
body.task-login #login-form tr:last-child td.input {
  margin-bottom: 0;
}

body.task-login #login-form input.form-control,
body.task-login #login-form input[type="text"],
body.task-login #login-form input[type="password"],
body.task-login #login-form input[type="email"] {
  width: 100%;
  background: var(--smlk-bg-950);
  border: 1px solid var(--smlk-line-strong);
  border-radius: var(--smlk-radius-sm);
  padding: 12px 14px 12px 44px;
  color: var(--smlk-ink);
  font-size: 15px;
  font-family: inherit;
  box-shadow: none;
  transition: border-color 0.15s ease;
}
body.task-login #login-form input.form-control:focus,
body.task-login #login-form input[type="text"]:focus,
body.task-login #login-form input[type="password"]:focus,
body.task-login #login-form input[type="email"]:focus {
  outline: none;
  border-color: var(--smlk-blue);
  box-shadow: 0 0 0 3px var(--smlk-blue-dim);
}
body.task-login #login-form input::placeholder {
  color: var(--smlk-ink-faint);
}

/* ---------- Inset field icons (replace Roundcube's default boxed prepend icons) ---------- */
body.task-login #login-form .input-group {
  position: relative;
  display: block;
}
body.task-login #login-form .input-group-prepend {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  pointer-events: none;
  background: none;
  border: none;
}
/* Bootstrap bumps the focused input's z-index above input-group addons;
   pin it back down so the inset icon never gets covered on focus/click. */
body.task-login #login-form .input-group > .form-control,
body.task-login #login-form .input-group > .form-control:focus {
  position: relative;
  z-index: 1;
}
body.task-login #login-form .input-group-text.icon {
  background-color: var(--smlk-ink-faint);
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  width: 18px;
  height: 18px;
  display: inline-block;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.15s ease;
}
body.task-login #login-form .input-group-text.icon::before {
  content: none !important;
}
body.task-login #login-form .input-group-text.icon.user {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4.4 3.6-8 8-8s8 3.6 8 8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4.4 3.6-8 8-8s8 3.6 8 8'/%3E%3C/svg%3E");
}
body.task-login #login-form .input-group-text.icon.pass {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}
body.task-login #login-form .input-group:focus-within .input-group-text.icon {
  background-color: var(--smlk-blue);
}

/* ---------- "Keep me logged in" switch (persistent_login plugin) ---------- */
body.task-login #login-form tr.form-group:has(.smlk-switch) {
  margin-top: -8px;
}
body.task-login #login-form .smlk-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}
body.task-login #login-form .smlk-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
body.task-login #login-form .smlk-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--smlk-bg-950);
  border: 1px solid var(--smlk-line-strong);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
body.task-login #login-form .smlk-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--smlk-ink-faint);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
body.task-login #login-form .smlk-switch input:checked ~ .smlk-switch-track {
  background: var(--smlk-blue);
  border-color: var(--smlk-blue);
}
body.task-login #login-form .smlk-switch input:checked ~ .smlk-switch-track .smlk-switch-knob {
  transform: translateX(16px);
  background: #ffffff;
}
body.task-login #login-form .smlk-switch input:focus-visible ~ .smlk-switch-track {
  box-shadow: 0 0 0 3px var(--smlk-blue-dim);
}
body.task-login #login-form .smlk-switch-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--smlk-ink-soft);
  user-select: none;
}
body.task-login #login-form .smlk-switch input:checked ~ .smlk-switch-label {
  color: var(--smlk-ink);
}

/* ---------- Public-computer warning hint ---------- */
body.task-login #login-form tr#ifpl-hint {
  margin: 0 0 14px;
}
body.task-login #login-form td.ifpl-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(224, 76, 76, 0.14);
  color: #f5b2b2;
  border: 1px solid rgba(224, 76, 76, 0.3);
  border-radius: var(--smlk-radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: none;
  text-align: left;
}
body.task-login #login-form td.ifpl-hint::before {
  content: '!';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5b2b2;
  color: #3a0d0d;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

body.task-login #login-form .formbuttons {
  margin: 6px 0 0;
}
body.task-login #login-form #rcmloginsubmit {
  width: 100%;
  background: var(--smlk-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--smlk-radius-sm);
  padding: 13px 22px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
body.task-login #login-form #rcmloginsubmit:hover {
  background: var(--smlk-blue-hover);
}
body.task-login #login-form #rcmloginsubmit:active {
  transform: scale(0.98);
}

/* ---------- Footer ---------- */
body.task-login #login-footer {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  text-align: center;
  font-family: var(--smlk-font-body);
  font-size: 13px;
  color: var(--smlk-ink-faint);
}
body.task-login #login-footer a,
body.task-login #login-footer .support-link {
  color: var(--smlk-blue-light);
  text-decoration: none;
}
body.task-login #login-footer a:hover {
  color: var(--smlk-blue);
  text-decoration: underline;
}

/* Notifications (#messagestack) are styled globally by styles/custom-notifications.css,
   linked from includes/layout.html, so they look the same on every Roundcube screen. */

/* ---------- Scrollbar to match smlk.hu ---------- */
body.task-login { scrollbar-color: var(--smlk-line-strong) var(--smlk-bg-950); scrollbar-width: thin; }
body.task-login::-webkit-scrollbar { width: 12px; height: 12px; }
body.task-login::-webkit-scrollbar-track { background: var(--smlk-bg-950); }
body.task-login::-webkit-scrollbar-thumb { background: var(--smlk-line-strong); border-radius: 999px; border: 3px solid var(--smlk-bg-950); }
