/* =====================================================================
   KAANIX login page: no top bar, centred card on a dark charcoal gradient.
   Styling only. Applies to pages that use .login-shell (signed out).
   ===================================================================== */

/* Hide the top bar on signed-out pages (login / platform login) */
body:has(main.login-shell) .topbar {
  display: none !important;
}

.login-shell {
  min-height: 100vh !important;
  margin: 0 !important;
  max-width: none !important;
  display: grid !important;
  place-items: center;
  padding: 32px 18px !important;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, color-mix(in srgb,var(--c-red) 20%,transparent) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 90% 95%, color-mix(in srgb,var(--c-white) 7%,transparent) 0%, transparent 70%),
    linear-gradient(140deg, var(--c-charcoal-900) 0%, var(--c-charcoal) 48%, var(--c-charcoal-600) 75%, var(--c-charcoal-900) 100%) !important;
}

.login-shell .flash {
  width: min(440px, 100%);
  margin: 0 auto 14px;
  border-radius: 12px;
}

.login-card {
  width: min(420px, 100%) !important;
  padding: 40px 38px 36px !important;
  background: var(--c-white) !important;
  color: var(--c-charcoal) !important;
  border: 1px solid color-mix(in srgb,var(--c-white) 13%,transparent) !important;
  border-radius: 20px !important;
  box-shadow: 0 30px 80px color-mix(in srgb,var(--c-black) 45%,transparent), 0 0 0 1px color-mix(in srgb,var(--c-white) 6%,transparent) !important;
  text-align: center;
  animation: kx-login-in .35s ease-out;
}

@keyframes kx-login-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.login-card .login-app-logo {
  margin: 0 auto 12px !important;
  max-width: 84px;
  max-height: 84px;
}

.login-card .eyebrow {
  margin: 0 0 6px;
  color: var(--c-red) !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.login-card h1 {
  margin: 0 0 6px;
  color: var(--c-charcoal) !important;
  font-size: 28px;
  line-height: 1.15;
}

.login-card .muted {
  margin: 0 0 26px;
  color: var(--c-gray-500) !important;
  font-size: 14.5px;
}

.login-card form {
  display: grid;
  gap: 16px;
  text-align: left;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--c-charcoal-600) !important;
  font-size: 13.5px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--c-gray-200) !important;
  border-radius: 11px !important;
  background: var(--c-gray-25) !important;
  color: var(--c-charcoal) !important;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.login-card input:focus {
  border-color: var(--c-red) !important;
  background: var(--c-white) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--c-red) 18%,transparent);
}

.login-card input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--c-gray-25) inset !important;
  -webkit-text-fill-color: var(--c-charcoal) !important;
}

.login-card button.primary {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 0 !important;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-700)) !important;
  color: var(--c-white) !important;
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 10px 24px color-mix(in srgb,var(--c-red) 25%,transparent);
  transition: transform .12s, box-shadow .15s, filter .15s;
}

.login-card button.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 30px color-mix(in srgb,var(--c-red) 31%,transparent);
}

.login-card button.primary:active {
  transform: translateY(1px);
}

@media (max-width: 480px) {
  .login-card { padding: 30px 22px 26px !important; }
  .login-card h1 { font-size: 24px; }
}

/* ---------- Eye icon on the password show/hide button (all pages) ----------
   visibility-toggle.js still adds the button and toggles aria-pressed.
   The text is hidden and an eye / eye-off icon is drawn instead. */
.password-eye {
  font-size: 0 !important;
  color: var(--c-gray-500);
  display: grid !important;
  place-items: center;
}

.password-eye::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-eye[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10.6 10.6 0 0 1 12 4c6.4 0 10 7 10 7a17.6 17.6 0 0 1-2.2 3.2M6.6 6.6A17.4 17.4 0 0 0 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='M2 2l20 20'/%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='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10.6 10.6 0 0 1 12 4c6.4 0 10 7 10 7a17.6 17.6 0 0 1-2.2 3.2M6.6 6.6A17.4 17.4 0 0 0 2 12s3.6 7 10 7a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}

.password-eye:hover,
.password-eye:focus-visible {
  color: var(--c-red-700);
}

.login-card .password-eye:hover,
.login-card .password-eye:focus-visible {
  background: color-mix(in srgb,var(--c-red) 12%,transparent) !important;
}

/* Keep the eye button vertically centred inside the input */
.password-field {
  display: block;
  line-height: 0;
}

.password-field > input {
  display: block;
  margin: 0;
}

.password-eye {
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 0;
}

.password-eye::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- Forgot password (UI only) ---------- */
.login-card-forgot { display: none; }

.login-shell:has(#forgot-password:target) .login-card-forgot { display: block; }
.login-shell:has(#forgot-password:target) .login-card-main { display: none; }

.login-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 -4px;
}

.forgot-link,
.back-link {
  color: var(--c-red-700) !important;
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none !important;
  border-radius: 6px;
  transition: color .15s;
}

.forgot-link:hover,
.back-link:hover {
  color: var(--c-red) !important;
  text-decoration: underline !important;
}

.forgot-link:focus-visible,
.back-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--c-red) 25%,transparent);
}

.forgot-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--c-red-50);
  color: var(--c-red);
}

.forgot-icon svg {
  width: 30px;
  height: 30px;
}

.forgot-error {
  margin: -8px 0 0;
  color: var(--c-red-500);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.login-card input[aria-invalid="true"] {
  border-color: var(--c-red-500) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--c-red-500) 13%,transparent) !important;
}

.forgot-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--c-orange-300);
  border-radius: 12px;
  background: var(--c-orange-50);
  color: var(--c-orange-700);
  text-align: left;
}

.forgot-notice[hidden] { display: none; }

.forgot-notice svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.forgot-notice b {
  display: block;
  font-size: 13.5px;
}

.forgot-notice span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
}
