/*
 * MyVoxspire sign-in (Figma «Вход — …», same layout as src/components/auth/auth-screen.tsx):
 * full-bleed photo, the voxspire systems logo on it, the dark glass panel with the form on the right.
 * Loaded after the geostat theme's styles.css and overrides it. Tokens mirror src/app/globals.css.
 * Pictures come from the site: Keycloak is served from another domain (stepgis.com/auth).
 */
:root {
  --vx-photo: url("https://voxspiresystems.com/images/auth/mountain-lake-dusk.jpg");
  --vx-logo: url("https://voxspiresystems.com/brand/voxspire-systems.svg");
  --vx-fg: #ffffff;
  --vx-fg-2: #cccccc;
  --vx-muted: #8d8f95;
  --vx-page: #000000;
  --vx-line: #262626;
  --vx-line-strong: #404040;
  --vx-danger: #e5484d;
}

.login-pf body {
  color: var(--vx-fg);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 22%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.5) 100%),
    var(--vx-photo) center / cover no-repeat fixed,
    var(--vx-page);
}

/* Desktop: logo on the photo (left), form panel on the right edge */
.login-pf-page {
  display: flex;
  min-height: 100vh;
  padding: 0;
}

#kc-header {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 40px 20px;
}
#kc-header::after {
  content: none;
}
#kc-header-wrapper {
  width: min(445px, calc(100vw - 40px));
  height: 56px;
  background: var(--vx-logo) no-repeat center / contain;
  filter: drop-shadow(0 2px 24px rgba(0, 0, 0, 0.45));
}

.card-pf {
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  width: 520px;
  min-height: 100vh;
  margin: 0;
  padding: 56px;
  border: 0;
  border-left: 1px solid var(--vx-line);
  border-radius: 0;
  background: rgba(16, 16, 16, 0.85);
  box-shadow: none;
  backdrop-filter: blur(8px);
  color: var(--vx-fg);
}

#kc-page-title {
  margin: 0 0 24px;
  color: var(--vx-fg);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

/* Labels: Mono 12 (t-mono-label) */
.pf-c-form__label-text,
.control-label,
#kc-form label {
  color: var(--vx-fg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 400;
}

/* Fields: black box, 1px #404040, radius 4; focus = white border; error = #E5484D */
.pf-c-form-control,
input[type="text"],
input[type="email"],
input[type="password"] {
  min-height: 46px;
  border: 1px solid var(--vx-line-strong);
  border-radius: 4px;
  background-color: var(--vx-page);
  color: var(--vx-fg);
  font-size: 14px;
}
.pf-c-form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--vx-fg);
  box-shadow: none;
}
.pf-c-form-control[aria-invalid="true"] {
  border-color: var(--vx-danger);
}
.kc-feedback-text,
#input-error,
.pf-c-form__helper-text.pf-m-error {
  color: var(--vx-danger);
}
.geostat-password-toggle {
  color: var(--vx-muted);
}
.geostat-password-toggle:hover,
.geostat-password-toggle:focus {
  color: var(--vx-fg);
}

/* Primary button: white, black text, 46px, radius 4 (Figma «Кнопка» Primary) */
.pf-c-button.pf-m-primary,
input.pf-c-button.pf-m-primary,
#kc-login {
  min-height: 46px;
  border: 1px solid var(--vx-fg);
  border-radius: 4px;
  background: var(--vx-fg);
  color: #101010;
  font-weight: 500;
  --pf-c-button--m-primary--BackgroundColor: var(--vx-fg);
  --pf-c-button--m-primary--hover--BackgroundColor: var(--vx-fg-2);
  --pf-c-button--m-primary--focus--BackgroundColor: var(--vx-fg-2);
  --pf-c-button--m-primary--active--BackgroundColor: var(--vx-muted);
}
.pf-c-button.pf-m-primary:hover,
input.pf-c-button.pf-m-primary:hover,
#kc-login:hover {
  border-color: var(--vx-fg-2);
  background: var(--vx-fg-2);
  box-shadow: none;
  transform: none;
}

/* Links and supporting text */
a,
#kc-registration a,
#kc-form-options a {
  color: var(--vx-fg);
  font-weight: 500;
}
a:hover {
  color: var(--vx-muted);
}
#kc-info-wrapper,
#kc-form-options,
.instruction,
.checkbox label,
#kc-registration {
  color: var(--vx-muted);
}
/* PatternFly pulls the «New user? Register» row out with negative margins and a top rule;
   inside the edge-to-edge panel that overflows the phone width */
#kc-info,
.login-pf-signup {
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}
#kc-info-wrapper {
  padding: 0;
  border-radius: 0;
  background: transparent;
}
#kc-social-providers {
  border-top-color: var(--vx-line);
}
#kc-social-providers .pf-c-button,
#kc-social-providers a {
  border: 1px solid var(--vx-fg);
  border-radius: 4px;
  background: transparent;
  color: var(--vx-fg);
}
.alert {
  border-radius: 4px;
}

/* Tablet and phone (as on the site): photo band with the logo on top, the form below */
@media (max-width: 1279px) {
  .login-pf-page {
    flex-direction: column;
  }
  #kc-header {
    flex: none;
    height: 193px;
    padding: 40px 20px 0;
  }
  .card-pf {
    flex: 1;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    padding: 56px max(40px, calc(50% - 240px)) 64px;
    border-left: 0;
    border-top: 1px solid var(--vx-line);
  }
}
@media (max-width: 767px) {
  #kc-header {
    height: 140px;
  }
  #kc-header-wrapper {
    height: 40px;
  }
  .card-pf {
    width: 100%;
    padding: 36px 20px 48px;
    border-radius: 0;
  }
}
