/*
 * The Vendora login theme (DEC-047, VND-143): the storefront's palette and type (DEC-053) around
 * Keycloak's own forms. PatternFly's classes stay on the controls; this file restyles them inside
 * the card, so every page Keycloak renders — sign-in, codes, set-up, reset, errors — belongs to the
 * same design without a template of its own.
 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --vd-forest: #004438;
  --vd-pine: #00382e;
  --vd-amber: #f8b808;
  --vd-marigold: #e08800;
  --vd-ivory: #f5f2ea;
  --vd-cream: #fbfaf6;
  --vd-mist: #edf3ef;
  --vd-mint: #cfe4da;
  --vd-stone: #d7e0da;
  --vd-line: #7d8c85;
  --vd-ink: #13201b;
  --vd-graphite: #4b5953;
  --vd-danger: #a3261e;
  --vd-success: #2f6b3f;
  --vd-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --vd-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --vd-radius: 14px;
  --vd-radius-l: 22px;
}

html.vd-html,
body.vd-body {
  height: 100%;
  margin: 0;
  background: var(--vd-cream);
  color: var(--vd-ink);
  font: 400 16px/1.5 var(--vd-font);
  -webkit-font-smoothing: antialiased;
}
body.vd-body {
  background-image: none;
}
.vd-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
}

/* The brand panel */
.vd-brand {
  background: var(--vd-forest);
  color: #fff;
}
.vd-brand-inner {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}
.vd-lockup {
  display: grid;
  justify-items: end;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}
.vd-lockup img {
  display: block;
  height: 30px;
  width: auto;
}
.vd-lockup span {
  margin-top: -3px;
  font: 500 8px/1 var(--vd-font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 82%);
}
.vd-lockup-small span {
  color: var(--vd-graphite);
}
.vd-eyebrow {
  font: 800 11.5px/1.3 var(--vd-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vd-amber);
}
.vd-brand-copy {
  display: grid;
  gap: 8px;
}
.vd-brand-copy h2 {
  margin: 0;
  font: 800 clamp(24px, 2.6vw, 34px) / 1.1 var(--vd-font);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.vd-brand-copy p {
  max-width: 420px;
  margin: 0;
  color: var(--vd-mint);
  font-size: 15px;
}
.vd-brand-photo {
  display: none;
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--vd-radius-l);
}
.vd-brand-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  animation: vd-settle 0.8s var(--vd-ease) both;
}
.vd-brand-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgb(0 68 56 / 85%) 100%);
}
.vd-brand-facts {
  display: none;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  font-weight: 600;
}
.vd-brand-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vd-fact-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: var(--vd-amber);
}
.vd-fact-icon svg,
.vd-secure svg {
  width: 18px;
  height: 18px;
  stroke: currentcolor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vd-brand-foot {
  display: none;
  margin: 0;
  color: var(--vd-mint);
  font-size: 12.5px;
}

/* The card */
.vd-main {
  display: grid;
  align-content: start;
  padding: 20px 16px 32px;
}
.vd-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  animation: vd-rise 0.45s var(--vd-ease) both;
}
.vd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.vd-lockup-small {
  display: none;
}
.vd-lang {
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--vd-stone);
  border-radius: 999px;
  background: #fff;
}
.vd-lang a {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--vd-graphite);
  font: 700 11.5px/1 var(--vd-font);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.vd-lang a[aria-current='true'] {
  background: var(--vd-forest);
  color: #fff;
}
.vd-card-header {
  margin-bottom: 8px;
}
.vd-card h1#kc-page-title {
  margin: 0;
  font: 800 clamp(24px, 3vw, 30px) / 1.12 var(--vd-font);
  letter-spacing: -0.02em;
  color: var(--vd-forest);
  text-wrap: balance;
}
.vd-intro,
.vd-aside-note,
.instruction,
#kc-info-wrapper,
.vd-card .pf-v5-c-login__main-footer-band {
  margin: 0 0 16px;
  color: var(--vd-graphite);
  font-size: 14.5px;
}
.vd-aside-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--vd-stone);
}
.vd-card-body {
  padding: 0;
}

/* Forms: Keycloak's PatternFly markup, Vendora's look */
.vd-card .pf-v5-c-form {
  display: grid;
  gap: 16px;
}
.vd-card .pf-v5-c-form__group {
  display: grid;
  gap: 6px;
  margin: 0;
}
.vd-card .pf-v5-c-form__label-text,
.vd-card .pf-v5-c-form__label {
  font: 600 14px/1.3 var(--vd-font);
  color: var(--vd-ink);
}
.vd-card .pf-v5-c-form__label-required,
.vd-card .pf-v5-c-check__label-required {
  color: var(--vd-danger);
}
.vd-card .pf-v5-c-form-control {
  --pf-v5-c-form-control--BorderColor: var(--vd-line);
  --pf-v5-c-form-control--after--BorderBottomColor: transparent;
  --pf-v5-c-form-control--hover--after--BorderBottomColor: transparent;
  --pf-v5-c-form-control--focus--after--BorderBottomColor: transparent;
  border-radius: 10px;
  border: 1px solid var(--vd-line);
  background: #fff;
  box-shadow: none;
  transition:
    border-color 0.18s var(--vd-ease),
    box-shadow 0.18s var(--vd-ease);
}
.vd-card .pf-v5-c-form-control::after {
  display: none;
}
.vd-card .pf-v5-c-form-control input,
.vd-card .pf-v5-c-form-control select,
.vd-card .pf-v5-c-form-control textarea {
  min-height: 48px;
  padding: 10px 14px;
  font: 400 16px/1.4 var(--vd-font);
  color: var(--vd-ink);
}
.vd-card .pf-v5-c-form-control:focus-within {
  border-color: var(--vd-forest);
  box-shadow: 0 0 0 3px var(--vd-mint);
}
.vd-card .pf-v5-c-form-control.pf-m-error {
  border-color: var(--vd-danger);
}
.vd-card .pf-v5-c-form-control.pf-m-readonly {
  background: var(--vd-mist);
}
.vd-card .pf-v5-c-form-control__icon.pf-m-status {
  color: var(--vd-danger);
}
.vd-card .pf-v5-c-helper-text__item-text {
  font-size: 13px;
  color: var(--vd-graphite);
}
.vd-card .pf-v5-c-helper-text__item.pf-m-error .pf-v5-c-helper-text__item-text,
.vd-card .kc-feedback-text.pf-m-error,
.vd-card span[id^='input-error'] {
  color: var(--vd-danger);
  font-weight: 600;
}
.vd-card .pf-v5-c-input-group {
  gap: 0;
}
.vd-card .pf-v5-c-input-group__item.pf-m-fill .pf-v5-c-form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.vd-card .pf-v5-c-button.pf-m-control {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--vd-line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #fff;
  color: var(--vd-graphite);
}
.vd-card .pf-v5-c-button.pf-m-control::after {
  display: none;
}
.vd-card .pf-v5-c-check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vd-card .pf-v5-c-check__input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--vd-forest);
}
.vd-card .pf-v5-c-check__label {
  font-size: 14.5px;
  color: var(--vd-ink);
}
.vd-card .pf-v5-c-form__actions {
  margin: 0;
  padding: 0;
}
.vd-card .pf-v5-c-button.pf-m-primary,
.vd-card input.pf-v5-c-button.pf-m-primary,
.vd-card .pf-v5-c-button.pf-m-primary.pf-m-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid var(--vd-amber);
  border-radius: 10px;
  background: var(--vd-amber);
  color: var(--vd-ink);
  font: 700 15px/1 var(--vd-font);
  cursor: pointer;
  transition:
    background 0.18s var(--vd-ease),
    border-color 0.18s var(--vd-ease),
    transform 0.18s var(--vd-ease);
}
.vd-card .pf-v5-c-button.pf-m-primary:hover,
.vd-card .pf-v5-c-button.pf-m-primary:focus-visible {
  background: var(--vd-marigold);
  border-color: var(--vd-marigold);
}
.vd-card .pf-v5-c-button.pf-m-primary:active {
  transform: translateY(1px);
}
.vd-card .pf-v5-c-button.pf-m-primary:disabled,
.vd-card form.vd-submitting .pf-v5-c-button.pf-m-primary {
  opacity: 0.7;
  cursor: progress;
}
.vd-card form.vd-submitting .pf-v5-c-button.pf-m-primary::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 2px solid rgb(19 32 27 / 30%);
  border-top-color: var(--vd-ink);
  border-radius: 999px;
  animation: vd-spin 0.8s linear infinite;
}
.vd-card .pf-v5-c-button.pf-m-secondary,
.vd-card a.pf-v5-c-button.pf-m-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 1.5px solid var(--vd-forest);
  border-radius: 10px;
  background: transparent;
  color: var(--vd-forest);
  font: 700 15px/1 var(--vd-font);
  text-decoration: none;
}
.vd-card .pf-v5-c-button.pf-m-link,
.vd-card a:not(.pf-v5-c-button) {
  color: var(--vd-forest);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vd-card .vd-lang a {
  color: var(--vd-graphite);
  text-decoration: none;
}
.vd-card .vd-lang a[aria-current='true'] {
  background: var(--vd-forest);
  color: #fff;
}
.vd-card .pf-v5-c-button.pf-m-link {
  padding: 0;
  border: 0;
  background: none;
  font: 700 14.5px/1 var(--vd-font);
  cursor: pointer;
}
.vd-restart {
  margin-top: 16px;
}
.vd-card :focus-visible {
  outline: 3px solid var(--vd-forest);
  outline-offset: 2px;
}

/* Codes: six digits, spaced, one input (paste and autofill keep working) */
.vd-code input,
.vd-code-field .pf-v5-c-form-control input {
  font: 700 26px/1 var(--vd-font);
  letter-spacing: 0.42em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Codes, one box per digit (DEC-065, code-boxes.js): typing moves on, the sixth digit sends */
.vd-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
}
.vd-box {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0;
  border: 1px solid var(--vd-line);
  border-radius: 10px;
  background: #fff;
  color: var(--vd-ink);
  font: 700 26px/1 var(--vd-font);
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--vd-forest);
  transition:
    border-color 0.18s var(--vd-ease),
    box-shadow 0.18s var(--vd-ease);
}
.vd-box:focus {
  border-color: var(--vd-forest);
  box-shadow: 0 0 0 3px rgba(0, 68, 56, 0.16);
  outline: none;
}
.vd-boxes-sending .vd-box {
  border-color: var(--vd-forest);
  background: var(--vd-mist);
}
.pf-v5-c-form__group:has([aria-invalid='true']) .vd-box {
  border-color: var(--vd-danger);
}

/* Messages */
.vd-card .pf-v5-c-alert {
  display: flex;
  gap: 10px;
  align-items: start;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 0;
  border-left: 4px solid var(--vd-graphite);
  border-radius: 10px;
  background: var(--vd-mist);
  box-shadow: none;
  font-size: 14.5px;
}
.vd-card .pf-v5-c-alert.pf-m-danger {
  border-left-color: var(--vd-danger);
  background: #fbebe8;
  color: #7a1b14;
}
.vd-card .pf-v5-c-alert.pf-m-success {
  border-left-color: var(--vd-success);
}
.vd-card .pf-v5-c-alert.pf-m-warning {
  border-left-color: var(--vd-marigold);
  background: #fff4d2;
}
.vd-card .pf-v5-c-alert__icon {
  display: none;
}
.vd-card .pf-v5-c-alert__title {
  margin: 0;
  font-weight: 600;
}

/* Lists on the TOTP set-up and the recovery pages */
.vd-card ol,
.vd-card ul.pf-v5-c-list {
  padding-left: 20px;
  color: var(--vd-graphite);
  font-size: 14.5px;
}
.vd-card #kc-totp-secret-qr-code {
  display: block;
  margin: 10px 0;
  border: 1px solid var(--vd-stone);
  border-radius: 10px;
}
.vd-card #kc-totp-secret-key {
  font:
    600 15px/1.4 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  word-break: break-all;
}

/* The foot of the card */
.vd-card-foot {
  margin-top: 26px;
}
.vd-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--vd-stone);
  color: var(--vd-graphite);
  font-size: 13px;
}
.vd-secure svg {
  color: var(--vd-success);
}

/* Keycloak's defaults that do not belong here */
.vd-body .pf-v5-c-login__header,
.vd-body #kc-header,
.vd-body .pf-v5-c-login__main-header-utilities {
  display: none;
}

/* Motion */
@keyframes vd-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes vd-settle {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
}
@keyframes vd-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .vd-body *,
  .vd-body *::before,
  .vd-body *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Tablets: a taller brand strip with the facts */
@media (min-width: 768px) {
  .vd-brand-inner {
    padding: 24px 28px;
  }
  .vd-brand-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .vd-brand-facts li {
    display: grid;
    align-content: start;
    gap: 6px;
  }
  .vd-main {
    padding: 36px 24px 40px;
  }
}

/* Desktop: the split screen, 42 / 58 */
@media (min-width: 1024px) {
  .vd-shell {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    grid-template-rows: none;
    /* The column stays forest below a sticky panel on a page taller than the screen. */
    background: linear-gradient(90deg, var(--vd-forest) 42%, var(--vd-ivory) 42%);
  }
  .vd-brand {
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .vd-brand-inner {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 22px;
    height: 100%;
    padding: 32px 36px;
  }
  .vd-lockup img {
    height: 34px;
  }
  .vd-brand-photo {
    display: block;
    min-height: 200px;
  }
  .vd-brand-facts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .vd-brand-facts li {
    display: flex;
    gap: 10px;
  }
  .vd-brand-foot {
    display: block;
  }
  .vd-main {
    align-content: center;
    padding: 48px 40px;
  }
  .vd-card {
    max-width: 460px;
  }
  .vd-lockup-small {
    display: none;
  }
}
/* Below the split: the small lockup lives in the card */
@media (max-width: 1023px) {
  .vd-lockup-small {
    display: grid;
  }
  .vd-lockup-small img {
    height: 26px;
  }
  .vd-brand .vd-lockup {
    display: none;
  }
}
@media (min-width: 1440px) {
  .vd-brand-inner {
    padding: 40px 48px;
  }
  .vd-brand-copy p {
    font-size: 16px;
  }
}
