/* StepGIS login theme: the same quiet, field-instrument visual language as the app landing page. */
:root {
  --stepgis-accent: #0e7490;
  --stepgis-accent-hover: #155e75;
  --stepgis-accent-soft: #ecfeff;
  --stepgis-ink: #0f172a;
  --stepgis-muted: #64748b;
  --stepgis-line: #cbd5e1;
  --stepgis-orange: #f97316;
}

html,
body,
.login-pf body {
  min-height: 100%;
}

/* Pale survey-grid background with restrained cyan/orange geology accents. */
.login-pf body {
  color: var(--stepgis-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background-color: #f8fafc;
  background-image:
    radial-gradient(
      circle at 86% 12%,
      rgba(14, 116, 144, 0.14),
      transparent 31rem
    ),
    radial-gradient(
      circle at 8% 92%,
      rgba(249, 115, 22, 0.09),
      transparent 25rem
    ),
    linear-gradient(rgba(14, 116, 144, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 116, 144, 0.055) 1px, transparent 1px);
  background-size:
    auto,
    auto,
    32px 32px,
    32px 32px;
}

.login-pf-page {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 48px 20px;
}

/* Use the exact product lockup already served by the frontend on this domain. */
#kc-header {
  margin-bottom: 22px;
  text-align: center;
}

#kc-header-wrapper {
  width: 230px;
  height: 70px;
  margin: 0 auto;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  background: url("/stepgis-logo-lockup.png") no-repeat center;
  background-size: contain;
}

#kc-header::after {
  display: block;
  margin-top: 10px;
  color: var(--stepgis-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  content: "Geological data platform";
}

/* Login card */
.card-pf {
  width: min(440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
}

#kc-page-title {
  margin: 0 0 24px;
  color: var(--stepgis-ink);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.pf-c-form__label-text,
.control-label {
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

/* Inputs */
.pf-c-form-control,
input[type="text"],
input[type="email"],
input[type="password"] {
  min-height: 44px;
  border: 1px solid var(--stepgis-line);
  border-radius: 9px;
  /* background-color only: the shorthand would reset PatternFly's
     no-repeat/position for the aria-invalid warning icon and tile it. */
  background-color: #ffffff;
  color: var(--stepgis-ink);
  box-shadow: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.pf-c-form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--stepgis-accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.16);
  outline: none;
}

/* Error state: PatternFly draws a single warning icon at the right edge of an
   aria-invalid field; brand the border red to match. */
.pf-c-form-control[aria-invalid="true"] {
  border-color: #dc2626;
}

/* In the password field the icon would land under the eye toggle — shift it
   left and widen the padding so both stay visible. */
.geostat-password-wrapper > input[aria-invalid="true"] {
  padding-right: 72px;
  background-position: calc(100% - 46px) center;
}

/* The realm enables ru/en internationalization, which renders a locale
   dropdown in the card header; hide the picker (auto-detection still works). */
#kc-locale {
  display: none;
}

/* Primary action */
.pf-c-button.pf-m-primary,
input.pf-c-button.pf-m-primary,
#kc-login {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--stepgis-accent);
  color: #ffffff;
  font-weight: 700;
  --pf-c-button--m-primary--BackgroundColor: var(--stepgis-accent);
  --pf-c-button--m-primary--hover--BackgroundColor: var(--stepgis-accent-hover);
  --pf-c-button--m-primary--focus--BackgroundColor: var(--stepgis-accent-hover);
  --pf-c-button--m-primary--active--BackgroundColor: var(
    --stepgis-accent-hover
  );
  transition:
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.pf-c-button.pf-m-primary:hover,
input.pf-c-button.pf-m-primary:hover,
#kc-login:hover {
  background: var(--stepgis-accent-hover);
  box-shadow: 0 8px 22px rgba(14, 116, 144, 0.24);
  transform: translateY(-1px);
}

/* Show/hide password toggle (injected by password-toggle.js). */
.geostat-password-wrapper {
  position: relative;
  display: block;
}

.geostat-password-wrapper > input {
  padding-right: 44px;
}

.geostat-password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: 44px;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--stepgis-muted);
  cursor: pointer;
}

.geostat-password-toggle:hover,
.geostat-password-toggle:focus {
  color: var(--stepgis-accent);
  outline: none;
}

/* Social login */
#kc-social-providers {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
}

/* The parent theme renders its own <hr> inside this section; our border-top
   above already draws the separator, so the stock one doubles it. */
#kc-social-providers hr {
  display: none;
}

#kc-social-providers .pf-c-button,
#kc-social-providers a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--stepgis-line);
  border-radius: 9px;
  background: #ffffff;
  color: #334155;
}

#social-google i.kc-social-provider-logo {
  display: inline-block;
  width: 18px;
  height: 18px;
  /* The parent theme floats the logo out of the row (float: left) and nudges
     the label (position: relative); neutralize both so the flex row centers. */
  float: none;
  vertical-align: middle;
  background: url(../img/google.svg) no-repeat center;
  background-size: contain;
}

#kc-social-providers .kc-social-provider-name {
  position: static;
}

#social-google i.kc-social-provider-logo::before {
  content: "";
}

/* Links and supporting text */
a,
#kc-registration a,
#kc-form-options a {
  color: var(--stepgis-accent);
  font-weight: 600;
}

a:hover {
  color: var(--stepgis-accent-hover);
}

#kc-info-wrapper,
#kc-form-options,
.instruction {
  color: var(--stepgis-muted);
}

#kc-info-wrapper {
  border-radius: 0 0 14px 14px;
  background: var(--stepgis-accent-soft);
}

.alert {
  border-radius: 9px;
}

@media (max-width: 520px) {
  .login-pf-page {
    padding: 28px 12px;
  }

  #kc-header-wrapper {
    width: 190px;
    height: 58px;
  }

  .card-pf {
    width: 100%;
    padding: 24px 20px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
