/* ==========================================================================
   login.css — Login page redesign (frontend only)
   Place at: <your static root>/site/css/login.css
   Loaded ONLY by templates/accounts/login.html, and every rule is prefixed
   with .ln-root, so no other page in the application is affected.

   COLOURS: this file deliberately defines no brand colours. Everything that
   was coloured by your existing theme still is:
     - the Login button      -> your theme's .btn-primary (incl. hover/focus)
     - the left brand panel  -> your theme's .bg-primary
     - card background       -> your theme's .panel
     - text, labels, links, inputs, error alerts, muted text -> theme/Bootstrap
   This file only controls layout, spacing, sizes, radius, shadows and motion.
   The only colour values here are white and black-with-transparency (used
   for the panel pattern, shadows and subtle borders).
   ========================================================================== */

/* ---------- Page root ----------------------------------------------------- */
/* "#container.ln-root" outranks Nifty's own "#container" rules.             */
#container.ln-root {
  --ln-radius: 10px;
  --ln-radius-lg: 16px;

  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: transparent;           /* page background comes from your theme */
  font-family: inherit;              /* font comes from your theme */
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ln-root *,
.ln-root *::before,
.ln-root *::after {
  box-sizing: border-box;
}

/* ---------- Skip link (keyboard users) ---------------------------------- */
.ln-root .ln-skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .15s ease;
}
.ln-root .ln-skip:focus {
  transform: none;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ---------- Page shell: stacked on phones/tablets, split on desktop ------ */
.ln-root .ln-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Brand panel (background colour = .bg-primary from theme) ----- */
.ln-root .ln-brand-panel {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.5px);
  background-size: 22px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
}

.ln-root .ln-brand,
.ln-root .ln-brand:hover,
.ln-root .ln-brand:focus {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  color: #fff;
  text-decoration: none;
}
.ln-root a.ln-brand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 8px;
}

.ln-root .ln-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ln-radius);
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.ln-root .ln-mark svg {
  display: block;
  width: 24px;
  height: 24px;
}

.ln-root .ln-brand-name {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .2px;
}

/* Hero statement is desktop-only */
.ln-root .ln-hero {
  display: none;
  max-width: 420px;
  margin: auto 0;
  color: rgba(255, 255, 255, .92);
  font-size: 28px;
  font-weight: 300;
  line-height: 1.35;
}
.ln-root .ln-hero::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-bottom: 22px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .6);
}
.ln-root .ln-hero strong {
  color: #fff;
  font-weight: 600;
}

/* ---------- Form panel + card (card background = .panel from theme) ------ */
.ln-root .ln-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.ln-root .ln-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 36px 32px 32px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--ln-radius-lg);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .04),
    0 16px 40px -16px rgba(0, 0, 0, .18);
  animation: ln-rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

.ln-root .ln-card-head {
  margin-bottom: 24px;
}
.ln-root .ln-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.ln-root .ln-sub {
  margin: 0;
  font-size: 14px;
}

.ln-root .ln-footer {
  margin: 24px 0 0;
  font-size: 13px;
  text-align: center;
}

@keyframes ln-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Crispy form: layout normalisation ---------------------------- */
/* Flattens form-horizontal / grid column classes so the form always stacks. */
.ln-root .ln-form form {
  margin: 0;
}
.ln-root .ln-form .form-group {
  margin: 0 0 18px;
}
.ln-root .ln-form .form-horizontal .form-group,
.ln-root .ln-form .row {
  margin-left: 0;
  margin-right: 0;
}
/* The last block (the button row) sits flush with the card's bottom padding */
.ln-root .ln-form form > :last-child,
.ln-root .ln-form .form-horizontal .form-group:last-child {
  margin-bottom: 0;
}
.ln-root .ln-form [class*="col-"] {
  float: none;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Labels (size/weight only — colour comes from your theme) ----- */
.ln-root .ln-form label,
.ln-root .ln-form .control-label,
.ln-root .ln-form .col-form-label {
  display: block;
  margin: 0 0 6px;
  padding-top: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: left;
}
.ln-root .ln-form .form-horizontal .control-label {
  padding-top: 0;
  margin-bottom: 6px;
  text-align: left;
}
.ln-root .ln-form .asteriskField {
  margin-left: 2px;
}

/* ---------- Text inputs (shape only — border/focus colours are the theme's) */
.ln-root .ln-form .form-control,
.ln-root .ln-form input[type="text"],
.ln-root .ln-form input[type="email"],
.ln-root .ln-form input[type="password"],
.ln-root .ln-form input[type="tel"],
.ln-root .ln-form input[type="number"] {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--ln-radius);
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* ---------- Validation messages (colours: your theme's .has-error etc.) -- */
.ln-root .ln-form .help-block,
.ln-root .ln-form .form-text,
.ln-root .ln-form .invalid-feedback {
  display: block;
  margin: 6px 0 0;
  font-size: 13px;
}
.ln-root .ln-form .help-block strong,
.ln-root .ln-form .invalid-feedback strong {
  font-weight: 500;
}

/* Form-level errors (e.g. "Please enter a correct username and password") */
.ln-root .ln-form .alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--ln-radius);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.45;
}
.ln-root .ln-form .alert ul,
.ln-root .ln-form .alert ol {
  margin: 0;
  padding-left: 18px;
}
.ln-root .ln-form .alert p {
  margin: 0;
}

/* ---------- Checkbox ("Remember me", if the form has one) ---------------- */
.ln-root .ln-form .checkbox,
.ln-root .ln-form .form-check {
  position: relative;
  margin: 4px 0 18px;
}
.ln-root .ln-form .checkbox label,
.ln-root .ln-form .form-check-label {
  position: relative;
  display: inline-block;
  margin: 0;
  padding-left: 26px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.ln-root .ln-form .checkbox input[type="checkbox"],
.ln-root .ln-form .form-check-input {
  position: absolute;
  top: 3px;
  left: 0;
  width: 16px;
  height: 16px;
  margin: 0;
}
.ln-root .ln-form .form-check {
  padding-left: 0;
}
.ln-root .ln-form .form-check .form-check-input {
  left: 0;
}
.ln-root .ln-form .form-check .form-check-label {
  padding-left: 26px;
}

/* ---------- Primary button (shape only — colours = your .btn-primary) ---- */
.ln-root .ln-form .btn-primary,
.ln-root .ln-form input[type="submit"],
.ln-root .ln-form button[type="submit"] {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 4px 0 0;
  padding: 12px 20px;
  border-radius: var(--ln-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
  text-align: center;
  text-shadow: none;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .05s ease;
}
.ln-root .ln-form .btn-primary:active,
.ln-root .ln-form input[type="submit"]:active,
.ln-root .ln-form button[type="submit"]:active {
  transform: translateY(1px);
}

/* Submit in progress (class added by login.js; the button is never disabled,
   so its name/value are still posted exactly as before). */
.ln-root .ln-form .is-loading {
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  opacity: .85;
  cursor: progress;
  pointer-events: none;
}

/* ---------- Secondary buttons / links inside the form -------------------- */
.ln-root .ln-form .btn-link {
  display: inline-block;
  width: auto;
  min-height: 0;
  padding: 4px 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
.ln-root .ln-form a:not(.btn) {
  font-weight: 600;
  text-decoration: none;
}
.ln-root .ln-form a:not(.btn):hover,
.ln-root .ln-form .btn-link:hover {
  text-decoration: underline;
}
.ln-root .ln-form a:focus-visible,
.ln-root .ln-form .btn-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Password visibility toggle (injected by login.js) ------------ */
.ln-root .ln-pw-wrap {
  position: relative;
}
.ln-root .ln-form .ln-pw-wrap input[type] {
  padding-right: 50px;
}
.ln-root .ln-pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.ln-root .ln-pw-toggle:hover {
  background: rgba(0, 0, 0, .06);
  opacity: 1;
}
.ln-root .ln-pw-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 0;
  opacity: 1;
}
.ln-root .ln-pw-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
}
.ln-root .ln-pw-toggle .ln-eye-off { display: none; }
.ln-root .ln-pw-toggle[aria-pressed="true"] .ln-eye { display: none; }
.ln-root .ln-pw-toggle[aria-pressed="true"] .ln-eye-off { display: block; }

/* Caps Lock hint (text set by login.js; hidden while empty) */
.ln-root .ln-caps {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}
.ln-root .ln-caps:empty {
  display: none;
}

/* Touch screens: make the eye button a full 44px target */
@media (pointer: coarse) {
  .ln-root .ln-pw-toggle {
    right: 1px;
    width: 44px;
    height: 44px;
  }
  .ln-root .ln-form .ln-pw-wrap input[type] {
    padding-right: 52px;
  }
}

/* ---------- Desktop: split screen ---------------------------------------- */
@media (min-width: 992px) {
  .ln-root .ln-shell {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: none;
  }
  .ln-root .ln-brand-panel {
    padding: 48px 56px;
    border-bottom: 0;
  }
  .ln-root .ln-brand-name {
    font-size: 18px;
  }
  .ln-root .ln-hero {
    display: block;
  }
  .ln-root .ln-form-panel {
    padding: 48px 32px;
  }
}

/* ---------- Large tablets / small laptops --------------------------------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .ln-root .ln-brand-panel {
    padding: 40px 36px;
  }
  .ln-root .ln-hero {
    font-size: 24px;
  }
}

/* ---------- Phones -------------------------------------------------------- */
@media (max-width: 575.98px) {
  .ln-root .ln-form-panel {
    justify-content: flex-start;
    padding: 24px 14px 32px;
  }
  .ln-root .ln-card {
    padding: 26px 20px 24px;
    border-radius: 14px;
  }
  .ln-root .ln-title {
    font-size: 22px;
  }
  .ln-root .ln-brand-name {
    font-size: 15px;
  }
}

/* ---------- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .ln-root *,
  .ln-root *::before,
  .ln-root *::after {
    animation: none !important;
    transition: none !important;
  }
}