:root {
  --yc-login-card-bg: rgba(11, 18, 27, 0.9);
  --yc-login-card-border: rgba(245, 187, 34, 0.58);
  --yc-login-card-shadow: 0 24px 54px rgba(1, 6, 12, 0.44);
  --yc-login-text: #f8fafc;
  --yc-login-muted: rgba(248, 250, 252, 0.78);
  --yc-login-field-bg: rgba(13, 20, 30, 0.76);
  --yc-login-field-border: rgba(255, 255, 255, 0.16);
  --yc-login-field-focus: rgba(255, 199, 58, 0.56);
  --yc-login-field-ring: rgba(255, 199, 58, 0.42);
  --yc-login-accent: #ffc73a;
  --yc-login-accent-strong: #f0b300;
  --yc-login-divider: rgba(255, 255, 255, 0.14);
  --yc-login-help-icon: rgba(255, 255, 255, 0.65);
  --yc-login-error: #ff8d7a;
  --yc-login-shell-pad-block: clamp(16px, 3vh, 40px);
  --yc-login-shell-pad-inline: clamp(32px, 7vw, 118px);
}

html,
body,
body#keycloak-bg {
  min-height: 100svh;
  background:
    linear-gradient(90deg, rgba(5, 10, 18, 0.92) 0%, rgba(5, 10, 18, 0.78) 22%, rgba(5, 10, 18, 0.46) 44%, rgba(5, 10, 18, 0.2) 64%, rgba(5, 10, 18, 0.06) 100%),
    url("../img/hk-night-e2-bg-hq.avif") center center / cover no-repeat fixed;
}

body#keycloak-bg {
  color: var(--yc-login-text);
}

.pf-v5-c-login {
  min-height: 100svh;
}

.pf-v5-c-login__container {
  min-height: 100svh;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: var(--yc-login-shell-pad-block) var(--yc-login-shell-pad-inline);
}

.pf-v5-c-login__main {
  width: min(528px, 100%);
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

#kc-header,
.pf-v5-c-login__main-header,
.pf-v5-c-login__main-footer {
  display: none;
}

.pf-v5-c-login__main-body {
  display: grid;
  place-items: center;
  color: var(--yc-login-text);
}

.pf-v5-c-alert {
  border-radius: 14px;
  margin-bottom: 20px;
}

body:has(.yc-login-page--reauth) .pf-v5-c-login__main-body > .pf-v5-c-form.pf-v5-u-w-100.pf-v5-u-mb-md-on-md,
body:has(.yc-login-page--reauth) .pf-v5-c-login__main-body > .pf-v5-c-alert.pf-m-inline.pf-v5-u-mb-md.pf-m-info {
  display: none;
}

.yc-login-page,
.yc-login-card,
.yc-login-card__body {
  width: 100%;
}

.yc-login-card {
  padding: 30px 38px 32px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(14, 21, 31, 0.92) 0%, rgba(11, 17, 25, 0.9) 100%);
  border: 1px solid var(--yc-login-card-border);
  box-shadow: var(--yc-login-card-shadow);
  backdrop-filter: blur(12px);
}

.yc-login-card__body {
  display: flex;
  flex-direction: column;
  min-height: 606px;
}

.yc-login-brandmark {
  width: 312px;
  max-width: 100%;
  height: 76px;
  margin: 0 auto 18px;
  background: url("../img/yuecar-logo-e2-transparent.webp") calc(50% - 22px) center / contain no-repeat;
}

.yc-login-copy {
  margin-bottom: 28px;
  text-align: center;
}

.yc-login-page--reauth .yc-login-copy {
  margin-bottom: 22px;
}

.yc-login-title {
  max-width: none;
  margin: 0 auto;
  color: var(--yc-login-text);
  font-size: clamp(2rem, 2.45vw, 2.18rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.yc-login-subtitle {
  margin: 10px 0 0;
  color: var(--yc-login-muted);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.yc-login-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
}

.yc-login-reauth {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.yc-login-reauth__account,
.yc-login-reauth__message {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.yc-login-reauth__account {
  padding: 14px 16px 15px;
}

.yc-login-reauth__label {
  margin: 0 0 10px;
  color: rgba(248, 250, 252, 0.68);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.yc-login-reauth__account-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yc-login-reauth__value {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--yc-login-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-login-reauth__reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 199, 58, 0.32);
  border-radius: 999px;
  background: rgba(255, 199, 58, 0.08);
  color: var(--yc-login-accent);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.yc-login-reauth__reset:hover,
.yc-login-reauth__reset:focus {
  color: #ffe08a;
  border-color: rgba(255, 199, 58, 0.48);
  background: rgba(255, 199, 58, 0.14);
  text-decoration: none;
  outline: 0;
}

.yc-login-reauth__message {
  margin: 0;
  padding: 12px 16px;
  color: rgba(248, 250, 252, 0.88);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.5;
}

.yc-login-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yc-login-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.yc-login-field-group {
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--yc-login-field-border);
  border-radius: 14px;
  background: var(--yc-login-field-bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.yc-login-field-group:focus-within {
  border-color: var(--yc-login-field-focus);
  box-shadow: 0 0 0 1px var(--yc-login-field-ring);
  background: rgba(13, 20, 30, 0.86);
}

.yc-login-field-group.is-error {
  border-color: rgba(255, 141, 122, 0.9);
}

.yc-login-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  flex: 0 0 46px;
  color: rgba(255, 255, 255, 0.68);
}

.yc-login-field-icon svg,
.yc-login-support__icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.yc-login-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--yc-login-text);
  font-size: 1rem;
  font-weight: 500;
  box-shadow: none;
}

.yc-login-input::placeholder {
  color: rgba(245, 247, 251, 0.44);
}

.yc-login-input:-webkit-autofill,
.yc-login-input:-webkit-autofill:hover,
.yc-login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--yc-login-text);
  -webkit-box-shadow: 0 0 0 100px rgba(13, 20, 30, 0.92) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.yc-login-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-right: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.yc-login-password-toggle:hover,
.yc-login-password-toggle:focus {
  color: var(--yc-login-text);
  background: rgba(255, 255, 255, 0.05);
  outline: 0;
}

.yc-login-field-error {
  margin: 0 4px;
  color: var(--yc-login-error);
  font-size: 0.9rem;
}

.yc-login-actions {
  margin-top: 6px;
}

.yc-login-submit {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffcf40 0%, #f4b800 100%);
  color: #11161f;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 24px rgba(240, 179, 0, 0.22);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.yc-login-submit:hover,
.yc-login-submit:focus {
  filter: brightness(1.04);
  transform: translateY(-1px);
  outline: 0;
}

.yc-login-utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  margin-top: 2px;
  color: var(--yc-login-muted);
}

.yc-login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--yc-login-muted);
  font-size: 0.98rem;
  cursor: pointer;
}

.yc-login-checkbox input {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.yc-login-checkbox input:checked {
  border-color: var(--yc-login-accent);
  background: linear-gradient(180deg, #ffcf40 0%, #f4b800 100%);
}

.yc-login-checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #151b24;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.yc-login-checkbox input:focus {
  outline: 0;
  box-shadow: 0 0 0 2px rgba(255, 199, 58, 0.14);
}

.yc-login-link,
.login-pf a.yc-login-link {
  color: var(--yc-login-accent);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
}

.yc-login-link:hover,
.login-pf a.yc-login-link:hover {
  color: #ffd666;
  text-decoration: none;
}

.yc-login-support {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--yc-login-divider);
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.96rem;
}

.yc-login-support__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--yc-login-help-icon);
}

@media (max-width: 900px) {
  html,
  body,
  body#keycloak-bg {
    background-position: 66% center;
  }

  .pf-v5-c-login__container {
    padding: clamp(12px, 2.4vh, 28px) 18px;
  }

  .pf-v5-c-login__main {
    width: min(520px, 100%);
    transform: none;
  }

  .yc-login-card__body {
    min-height: auto;
  }
}

@media (max-width: 540px) {
  .pf-v5-c-login__main {
    width: min(392px, calc(100vw - 28px));
  }

  .yc-login-card {
    padding: 24px 20px 22px;
    border-radius: 22px;
  }

  .yc-login-brandmark {
    width: 244px;
    height: 60px;
    margin-bottom: 14px;
  }

  .yc-login-copy {
    margin-bottom: 22px;
  }

  .yc-login-reauth__account-row {
    flex-wrap: wrap;
  }

  .yc-login-reauth__reset {
    width: 100%;
    justify-content: center;
  }

  .yc-login-title {
    max-width: 100%;
    font-size: 1.56rem;
    white-space: normal;
  }

  .yc-login-subtitle {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  .yc-login-field-group {
    min-height: 58px;
  }

  .yc-login-submit {
    min-height: 54px;
  }

  .yc-login-utility-row {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .yc-login-support {
    font-size: 0.92rem;
  }
}
