/* ==========================================================================
   Crescent Air -- sign-in experience
   A split console rather than a centred box: the brand panel carries a
   single large crescent mark bleeding off the edge, and the form sits on a
   plain working surface beside it.
   ========================================================================== */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* --- Brand panel --------------------------------------------------------- */

.auth__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-8);
  padding: var(--s-8) var(--s-9);
  background: var(--c-ink-900);
  color: var(--c-ink-200);
  overflow: hidden;
}

/* A faint engineered grid, the texture of a wiring diagram. Kept at very
   low contrast so it never competes with the type. */
.auth__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* The crescent, oversized and cropped by the panel edge. */
.auth__mark {
  position: absolute;
  right: -160px;
  bottom: -120px;
  width: 620px;
  height: 620px;
  color: var(--c-cool-600);
  opacity: 0.16;
  pointer-events: none;
}

.auth__panel > * {
  position: relative;
  z-index: var(--z-base);
}

/* Re-asserted after the rule above, which would otherwise pull the mark
   into the flex flow and push the panel content down the page. */
.auth__panel > .auth__mark {
  position: absolute;
  z-index: 0;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.auth__brand-name {
  font-size: var(--fs-18);
  font-weight: var(--fw-semibold);
  color: var(--c-white);
  letter-spacing: var(--ls-tight);
}

.auth__brand-line {
  font-size: var(--fs-12);
  color: #7b91a8;
}

.auth__pitch {
  max-width: 34ch;
}

.auth__headline {
  font-size: var(--fs-30);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--c-white);
}

.auth__lede {
  margin-top: var(--s-3);
  font-size: var(--fs-14);
  line-height: var(--lh-relaxed);
  color: #93a8bd;
}

/* Operational facts, not marketing claims. */
.auth__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth__fact-value {
  font-size: var(--fs-18);
  font-weight: var(--fw-semibold);
  color: var(--c-white);
  font-variant-numeric: tabular-nums;
}

.auth__fact-label {
  font-size: var(--fs-12);
  color: #7b91a8;
}

.auth__licence {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-12);
  color: #6d829a;
}

/* --- Form side ----------------------------------------------------------- */

.auth__form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-8) var(--s-7);
  background: var(--surface-card);
}

.auth__form {
  width: 100%;
  max-width: 380px;
}

.auth__form-head {
  margin-bottom: var(--s-6);
}

.auth__title {
  font-size: var(--fs-24);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

.auth__subtitle {
  margin-top: var(--s-2);
  font-size: var(--fs-14);
  color: var(--text-secondary);
}

.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-4) 0 var(--s-5);
}

.auth__submit {
  width: 100%;
}

.auth__foot {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-12);
  color: var(--text-muted);
}

.auth__alert {
  margin-bottom: var(--s-5);
}

/* Password field with a reveal toggle. */
.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-muted);
}

.password-toggle:hover {
  background: var(--c-ink-100);
  color: var(--text-primary);
}

/* Development credentials panel. Rendered only when APP_ENV is local, so it
   can never appear on the Plesk deployment. */
.auth__devbox {
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  font-size: var(--fs-12);
  color: var(--text-secondary);
}

.auth__devbox strong {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--text-primary);
}

.auth__devbox dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px var(--s-3);
  margin: 0;
}

.auth__devbox dt {
  color: var(--text-muted);
}

.auth__devbox dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .auth__panel {
    padding: var(--s-7);
  }

  .auth__headline {
    font-size: var(--fs-24);
  }

  .auth__mark {
    width: 460px;
    height: 460px;
    right: -140px;
  }
}

/* On a phone the panel becomes a compact masthead and the form takes the
   rest of the screen; nothing is cut off and nothing scrolls sideways. */
@media (max-width: 860px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
  }

  .auth__panel {
    gap: var(--s-5);
    padding: var(--s-6) var(--s-5);
  }

  .auth__pitch,
  .auth__facts {
    display: none;
  }

  .auth__mark {
    width: 320px;
    height: 320px;
    right: -120px;
    bottom: -150px;
  }

  .auth__form-side {
    padding: var(--s-7) var(--s-5) var(--s-8);
    align-items: flex-start;
  }
}
