:root {
  --aster-primary: #0a2e5c;
  --aster-primary-light: #1a4a8a;
  --aster-primary-dark: #061e3d;
  --aster-accent: #c9a227;
  --aster-accent-hover: #e8c84a;
  --aster-text: #1a1a2e;
  --aster-muted: #5a6270;
  --aster-border: #dde2ea;
  --aster-bg: #f4f6f9;
  --aster-white: #ffffff;
  --aster-danger: #c0392b;
  --aster-success: #1a7f4b;
  --aster-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --aster-serif: Georgia, "Times New Roman", serif;
}

html, body {
  height: 100%;
  margin: 0;
}

body.aster-login-page {
  font-family: var(--aster-font);
  color: var(--aster-text);
  background: var(--aster-bg);
}

.login-pf,
.login-pf body {
  background: transparent;
}

.card-pf {
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 0;
  max-width: none;
}

#kc-header,
#kc-header-wrapper,
.login-pf-header {
  display: none !important;
}

.aster-shell {
  display: flex;
  min-height: 100vh;
}

.aster-brand-panel {
  position: relative;
  flex: 0 0 44%;
  max-width: 560px;
  background:
    linear-gradient(160deg, rgba(6, 30, 61, 0.96) 0%, rgba(10, 46, 92, 0.92) 45%, rgba(26, 74, 138, 0.88) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.aster-brand-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(201, 162, 39, 0.12), transparent 45%);
  pointer-events: none;
}

.aster-brand-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.aster-brand-logo svg {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
}

.aster-brand-title {
  font-family: var(--aster-serif);
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 12px;
  font-weight: 700;
}

.aster-brand-tagline {
  margin: 0 0 32px;
  opacity: 0.88;
  font-size: 1rem;
  line-height: 1.6;
}

.aster-brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aster-brand-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  opacity: 0.9;
}

.aster-brand-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aster-accent);
}

.aster-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.aster-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: var(--aster-white);
  border-bottom: 1px solid var(--aster-border);
  flex-wrap: wrap;
}

.aster-idp-badge {
  display: inline-block;
  background: var(--aster-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 10px;
}

.aster-idp-info {
  font-size: 0.8125rem;
  color: var(--aster-muted);
}

.aster-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.aster-locale {
  display: flex;
  gap: 8px;
}

.aster-locale-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--aster-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.aster-locale-link.active,
.aster-locale-link:hover {
  color: var(--aster-primary);
  background: var(--aster-bg);
}

.aster-help-link {
  font-size: 0.8125rem;
  color: var(--aster-primary-light);
  text-decoration: none;
  font-weight: 600;
}

.aster-help-link:hover {
  color: var(--aster-accent);
}

.aster-form-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 24px;
}

.aster-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--aster-white);
  border: 1px solid var(--aster-border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(10, 46, 92, 0.08);
  padding: 36px 32px 28px;
}

.aster-form-header h2 {
  font-family: var(--aster-serif);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--aster-primary-dark);
}

.aster-required-note {
  font-size: 0.8125rem;
  color: var(--aster-muted);
  margin: 0 0 8px;
}

.aster-user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--aster-bg);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.aster-user-chip a {
  color: var(--aster-primary-light);
  text-decoration: none;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.aster-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--aster-text);
}

.aster-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.aster-label-row .aster-label {
  margin-bottom: 0;
}

.aster-link-muted {
  font-size: 0.8125rem;
  color: var(--aster-primary-light);
  text-decoration: none;
  white-space: nowrap;
}

.aster-link-muted:hover {
  color: var(--aster-accent);
  text-decoration: underline;
}

.aster-input,
.form-control {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: var(--aster-font);
  border: 1px solid var(--aster-border);
  border-radius: 8px;
  background: var(--aster-white);
  color: var(--aster-text);
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.aster-input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--aster-primary-light);
  box-shadow: 0 0 0 3px rgba(26, 74, 138, 0.12);
}

.has-error .aster-input {
  border-color: var(--aster-danger);
}

.aster-field-error {
  display: block;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--aster-danger);
}

.aster-remember {
  margin-bottom: 24px;
}

.aster-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--aster-muted);
  cursor: pointer;
}

.aster-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--aster-primary);
}

.aster-submit-row {
  margin-bottom: 0;
}

.aster-btn-primary,
.btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--aster-accent) !important;
  background-image: none !important;
  color: var(--aster-primary-dark) !important;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--aster-font);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: none;
}

.aster-btn-primary:hover,
.btn-primary:hover {
  background: var(--aster-accent-hover) !important;
}

.aster-btn-primary:active,
.btn-primary:active {
  transform: translateY(1px);
}

.aster-alert {
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  font-size: 0.875rem;
}

.alert-error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #922b21;
}

.alert-warning {
  background: #fef9e7;
  border: 1px solid #f7dc6f;
  color: #7d6608;
}

.alert-success {
  background: #eaf6ef;
  border: 1px solid #a9dfbf;
  color: #1e8449;
}

.alert-info {
  background: #eef4fb;
  border: 1px solid #aed6f1;
  color: var(--aster-primary);
}

.aster-info,
#kc-registration-container {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--aster-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--aster-muted);
}

.aster-info a,
#kc-registration-container a {
  color: var(--aster-primary-light);
  font-weight: 600;
  text-decoration: none;
  margin-left: 6px;
}

.aster-social {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--aster-border);
}

.aster-social-label {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--aster-muted);
  margin: 0 0 14px;
}

.aster-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.aster-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--aster-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--aster-text);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--aster-white);
  transition: border-color 0.2s, background 0.2s;
}

.aster-social-btn:hover {
  border-color: var(--aster-primary-light);
  background: var(--aster-bg);
}

.aster-alt-login {
  margin-top: 16px;
  text-align: center;
}

.aster-alt-login a {
  font-size: 0.875rem;
  color: var(--aster-primary-light);
}

.aster-form-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--aster-muted);
  line-height: 1.8;
}

.aster-form-footer a {
  color: var(--aster-primary-light);
  text-decoration: none;
}

.aster-form-footer a:hover {
  text-decoration: underline;
}

.aster-form-footer span {
  margin: 0 6px;
}

.aster-text-block {
  font-size: 0.9375rem;
  color: var(--aster-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.aster-back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--aster-primary-light);
  text-decoration: none;
}

.aster-back-link:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .aster-shell {
    flex-direction: column;
  }

  .aster-brand-panel {
    flex: none;
    max-width: none;
    min-height: 220px;
    padding: 32px 24px;
  }

  .aster-brand-logo svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .aster-brand-title {
    font-size: 1.375rem;
  }

  .aster-brand-features {
    display: none;
  }

  .aster-topbar {
    padding: 12px 16px;
  }

  .aster-form-area {
    padding: 24px 16px;
  }

  .aster-login-card {
    padding: 28px 20px 22px;
  }
}

@media (max-width: 480px) {
  .aster-idp-info {
    display: none;
  }
}
