:root {
  --liberator-bg: #06080c;
  --liberator-panel: transparent;
  --liberator-text: #ffffff;
  --liberator-muted: #9aa0aa;
  --liberator-border: #2a2f38;
  --liberator-input-bg: #0b1017;
  --liberator-input-bg-focus: #0f1520;
  --liberator-accent: #22b8cf;
  --liberator-gradient-start: #22b8cf;
  --liberator-gradient-mid: #15aabf;
  --liberator-gradient-end: #0c8599;
  --liberator-ring: rgba(34, 184, 207, 0.35);
}

html,
body,
body.login-pf,
.login-pf-page {
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 20% 15%, #0d1520 0%, var(--liberator-bg) 40%) no-repeat,
    var(--liberator-bg) !important;
  color: var(--liberator-text);
  font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}

.login-pf-page,
#kc-container,
#kc-container-wrapper,
#kc-content-wrapper,
#kc-content {
  background: transparent !important;
}

.login-pf-page .login-pf-page-header,
.login-pf-page .login-pf-brand,
.login-pf-page .pf-c-background-image,
.login-pf-page .pf-c-background-image::before,
.login-pf-page .pf-c-background-image::after,
.login-pf-page::before,
.login-pf-page::after,
#kc-container::before,
#kc-container::after,
#kc-header {
  display: none !important;
  content: none !important;
  background: none !important;
}

.login-pf-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card-pf,
.login-pf-page .card-pf {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  transform: translateY(-22px);
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--liberator-panel);
}

#kc-header-wrapper {
  padding: 0;
  margin: 0 0 1.2rem 0;
  text-align: center;
}

.liberator-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.liberator-brand-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: saturate(1.08);
}

.liberator-auth-title {
  margin: 0;
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f3f5f7;
  text-align: center;
}

.liberator-auth-subtitle {
  margin: 0.5rem 0 0 0;
  font-size: 0.77rem;
  color: var(--liberator-muted);
  text-align: center;
}

#kc-form {
  margin-top: 0;
}

#kc-form-wrapper {
  margin: 0;
}

#kc-info,
#kc-info-wrapper,
.login-pf-page .login-pf-signup {
  display: block !important;
  width: 100%;
  max-width: 560px;
  margin: 2rem auto 0;
  text-align: center;
  background: transparent !important;
}

.liberator-social-block {
  margin: 0 0 1rem 0;
}

.liberator-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.6rem;
}

.liberator-social-item {
  flex: 1;
}

.liberator-social-btn {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--liberator-border);
  border-radius: 8px;
  background: #0a0d12;
  color: #e9ecef;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.liberator-social-btn:hover {
  border-color: #3a404a;
  background: #0d1118;
}

.liberator-divider-wrap {
  position: relative;
  margin: 1rem 0 1rem;
  text-align: center;
}

.liberator-divider-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #252b34;
}

.liberator-divider-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 0.6rem;
  background: var(--liberator-bg);
  color: #8b929e;
  font-size: 0.72rem;
}

#kc-form-login .form-group {
  margin-bottom: 0.8rem;
}

#kc-form-login label {
  color: #f1f3f5;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#kc-form-login .form-control,
#kc-form-login input[type='text'],
#kc-form-login input[type='password'],
#kc-form-login input[type='email'],
#kc-form-login input[type='username'] {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--liberator-border) !important;
  background-color: var(--liberator-input-bg) !important;
  color: #f8f9fa !important;
  font-size: 0.84rem;
  padding: 0.5rem 0.75rem;
}

#kc-form-login .form-control::placeholder,
#kc-form-login input::placeholder {
  color: #7f8794;
}

#kc-form-login .form-control:focus,
#kc-form-login input:focus {
  background-color: var(--liberator-input-bg-focus) !important;
  border-color: #22b8cf !important;
  box-shadow: 0 0 0 3px var(--liberator-ring) !important;
}

#kc-form-login input:-webkit-autofill,
#kc-form-login input:-webkit-autofill:hover,
#kc-form-login input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8f9fa !important;
  -webkit-box-shadow: 0 0 0 1000px var(--liberator-input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--liberator-input-bg) inset !important;
  border: 1px solid var(--liberator-border) !important;
}

.liberator-error {
  display: inline-block;
  margin-top: 0.3rem;
  color: #ff7b7b;
}

#kc-login.liberator-login-btn {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--liberator-gradient-start), var(--liberator-gradient-mid) 55%, var(--liberator-gradient-end));
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#kc-login.liberator-login-btn:hover,
#kc-login.liberator-login-btn:focus {
  filter: brightness(1.05);
}

.liberator-forgot-wrap {
  margin-top: 0.9rem;
  text-align: center;
}

.liberator-forgot-wrap a {
  color: #e9edf2;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.liberator-forgot-wrap a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.liberator-terms {
  margin-top: 2rem;
  text-align: center;
  color: #7e8794;
  font-size: 0.66rem;
  line-height: 1.5;
  white-space: nowrap;
}

.liberator-terms a {
  color: #c7cdd6;
  text-decoration: none;
}

.liberator-terms a:hover {
  text-decoration: underline;
}

@media (max-width: 420px) {
  .card-pf,
  .login-pf-page .card-pf {
    max-width: 100%;
    transform: translateY(-10px);
  }

  .liberator-social-list {
    flex-direction: column;
  }
}
