/* Login pages in the look of the website: the purple-to-magenta gradient,
   one white card with the logo, the system font (no web fonts, nothing
   loaded from elsewhere). Replaces the parent theme's css/login.css;
   PatternFly underneath stays for forms and alerts. */

:root {
  --ia-purple: #5e239d;
  --ia-purple-dark: #4a1b7d;
  --ia-magenta: #b70468;
  --ia-text: #1c2733;
  --ia-muted: #5a6b7c;
  --ia-field: #c6d0da;
  --ia-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --pf-global--FontFamily--sans-serif: var(--ia-font);
  --pf-global--FontFamily--heading--sans-serif: var(--ia-font);
}

html.login-pf,
.login-pf body {
  min-height: 100%;
  background: #4a1b7d;
}

.login-pf body {
  margin: 0;
  background: linear-gradient(135deg, #3d1569 0%, var(--ia-purple) 42%, var(--ia-magenta) 100%) fixed;
  color: var(--ia-text);
  font-family: var(--ia-font);
  font-size: 16px;
  line-height: 1.5;
}

.login-pf body,
.login-pf input,
.login-pf button {
  font-family: var(--ia-font);
}

/* the page: one centred card; room at the bottom for the privacy link */
.login-pf-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 32px 16px 72px;
}

.login-pf-page .card-pf {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 36px 36px 30px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(25, 4, 45, 0.35);
}

.ia-logo {
  margin: 0 0 26px;
  text-align: center;
}

.ia-logo img {
  display: inline-block;
  width: 224px;
  max-width: 100%;
  height: auto;
}

.login-pf-header {
  margin: 0;
  padding: 0;
  border: 0;
}

h1#kc-page-title {
  margin: 0 0 20px;
  padding: 0;
  color: var(--ia-text);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

/* --- fields and buttons -------------------------------------------------- */

#kc-content-wrapper .form-group,
#kc-content-wrapper .pf-c-form__group {
  margin: 0 0 16px;
}

/* the grid columns of the parent's forms take the full card width */
#kc-content-wrapper [class*="col-"] {
  float: none;
  width: auto;
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
}

.login-pf .pf-c-form__label,
.login-pf .pf-c-form__label-text {
  display: block;
  margin: 0 0 6px;
  color: var(--ia-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.login-pf input.pf-c-form-control {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--ia-field);
  border-radius: 8px;
  background: #fff;
  color: var(--ia-text);
  font-size: 16px; /* 16px: phones do not zoom into the field */
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-pf input.pf-c-form-control:focus {
  border-color: var(--ia-purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(94, 35, 157, 0.16);
}

.login-pf input.pf-c-form-control[aria-invalid="true"] {
  border-color: #b3392f;
}

.login-pf input.ia-code {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.25em;
  text-align: center;
}

.login-pf .pf-c-form__helper-text.pf-m-error {
  display: block;
  margin-top: 6px;
  color: #a3261c;
  font-size: 0.85rem;
}

#kc-form-buttons {
  margin: 22px 0 0;
}

.login-pf .pf-c-button.pf-m-primary {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--ia-purple);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.login-pf .pf-c-button.pf-m-primary:hover,
.login-pf .pf-c-button.pf-m-primary:focus {
  background: var(--ia-purple-dark);
}

.login-pf .pf-c-button.pf-m-primary::after {
  border: 0;
}

.login-pf .pf-c-button:focus-visible,
.ia-link-button:focus-visible,
.login-pf-page a:focus-visible {
  outline: 2px solid var(--ia-purple);
  outline-offset: 2px;
}

/* "Resend code": a button of the form that looks like a link */
.ia-link-button {
  display: block;
  margin: 14px auto 0;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--ia-purple);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ia-link-button:hover {
  color: var(--ia-purple-dark);
}

/* waiting after a code was sent (countdown in the label) */
.ia-link-button:disabled {
  color: var(--ia-muted);
  cursor: default;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

/* --- the address the code went to ---------------------------------------- */

#kc-username {
  margin: -6px 0 22px;
  color: var(--ia-muted);
  font-size: 0.9rem;
  text-align: center;
  overflow-wrap: anywhere;
}

#kc-attempted-username {
  color: var(--ia-text);
  font-weight: 600;
}

#reset-login {
  display: block;
  margin-top: 4px;
  color: var(--ia-purple);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#reset-login:hover {
  color: var(--ia-purple-dark);
}

/* --- messages: one line of text with its icon, no box --------------------- */

.login-pf .pf-c-alert {
  display: flex;
  gap: 6px;
  align-items: baseline;
  justify-content: center;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ia-text);
  font-size: 0.9rem;
  text-align: center;
}

.login-pf .pf-c-alert::before {
  display: none;
}

.login-pf .pf-c-alert.pf-m-danger { color: #a3261c; }
.login-pf .pf-c-alert.pf-m-success { color: #2e7d4f; }
.login-pf .pf-c-alert.pf-m-warning { color: #7a5a00; }

.login-pf .pf-c-alert__icon {
  font-size: 0.95rem;
}

.login-pf .pf-c-alert.pf-m-danger .pf-c-alert__icon { color: #b3392f; }
.login-pf .pf-c-alert.pf-m-success .pf-c-alert__icon { color: #2e7d4f; }
.login-pf .pf-c-alert.pf-m-warning .pf-c-alert__icon { color: #a66a00; }
.login-pf .pf-c-alert.pf-m-info .pf-c-alert__icon { color: var(--ia-muted); }

.login-pf .pf-c-alert__title,
.login-pf .kc-feedback-text {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
}

/* --- other pages (sign out, expired page, errors, info) ------------------- */

#kc-content-wrapper p,
.login-pf .instruction {
  margin: 0 0 12px;
  color: var(--ia-text);
  font-size: 0.95rem;
  text-align: center;
}

#kc-content-wrapper a {
  color: var(--ia-purple);
}

#kc-content-wrapper .ia-back {
  margin: 20px 0 0;
}

#kc-content-wrapper .ia-back a {
  display: block;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--ia-purple);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

#kc-content-wrapper .ia-back a:hover {
  background: var(--ia-purple-dark);
}

#kc-info-message {
  margin-top: 14px;
  text-align: center;
  font-size: 0.9rem;
}

#kc-info,
.login-pf-signup {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.clearfix::after {
  display: block;
  clear: both;
  content: "";
}

/* --- below the card ------------------------------------------------------- */

.ia-access {
  max-width: 420px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  text-align: center;
}

.ia-access a {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ia-access a:hover {
  color: #fff;
}

/* the privacy link nginx adds at the bottom (grey on white by default) */
body > div[style*="position:fixed"] > a[href="/privacy"] {
  color: rgba(255, 255, 255, 0.72) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* --- phones --------------------------------------------------------------- */

@media (max-width: 480px) {
  .login-pf-page {
    justify-content: flex-start;
    padding: 20px 12px 64px;
  }

  .login-pf-page .card-pf {
    padding: 28px 22px 24px;
    border-radius: 14px;
  }

  .ia-logo {
    margin-bottom: 22px;
  }

  .ia-logo img {
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-pf input.pf-c-form-control,
  .login-pf .pf-c-button.pf-m-primary {
    transition: none;
  }
}
