/* ─── AlpID Theme — Alpinux LUG ──────────────────────────────────────────── */

:root {
  --alpid-blue:       #1a6bbf;
  --alpid-blue-dark:  #0f4e8f;
  --alpid-blue-light: #e8f1fb;
  --alpid-accent:     #e8820c;
  --alpid-text:       #1a1a1a;
  --alpid-muted:      #6b7280;
  --alpid-border:     #d1d5db;
  --alpid-bg:         #f3f6fb;
  --alpid-white:      #ffffff;
  --alpid-shadow:     0 4px 24px rgba(26,107,191,.13);
}

/* ─── Global ─────────────────────────────────────────────────────────────── */
body {
  background: var(--alpid-bg) !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  color: var(--alpid-text) !important;
}

/* ─── Login page wrapper ─────────────────────────────────────────────────── */
.pf-v5-c-login {
  background: var(--alpid-bg) !important;
}

.pf-v5-c-login__main {
  box-shadow: var(--alpid-shadow) !important;
  border-radius: 12px !important;
  background: var(--alpid-white) !important;
  border: 1px solid var(--alpid-border) !important;
  overflow: hidden;
}

/* ─── Header / Logo ──────────────────────────────────────────────────────── */
.pf-v5-c-login__header {
  background: var(--alpid-blue) !important;
  padding: 1.8rem 2rem 1.4rem !important;
  text-align: center;
}

/* Hide the default KC logo image if present */
.pf-v5-c-login__header img,
.pf-v5-c-brand {
  display: none !important;
}

/* Inject AlpID logo as CSS pseudo-element on header */
.pf-v5-c-login__header::before {
  content: 'Alp';
  display: block;
  font-size: 2.6rem;
  font-weight: 300;
  color: rgba(255,255,255,.9);
  letter-spacing: .06em;
  line-height: 1;
}

.pf-v5-c-login__header::after {
  content: 'ID';
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--alpid-white);
  letter-spacing: .06em;
  margin-top: -.5rem;
  line-height: 1;
}

/* If header has both ::before and ::after we want them on same line — use flex */
.pf-v5-c-login__header {
  display: flex !important;
  flex-direction: column;
  align-items: center;
}

/* ─── Title ──────────────────────────────────────────────────────────────── */
#kc-page-title,
.pf-v5-c-title {
  color: var(--alpid-blue-dark) !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-bottom: 1.2rem !important;
}

/* ─── Form container ─────────────────────────────────────────────────────── */
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-footer {
  padding-left: 2rem !important;
  padding-right: 2rem !important;
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.pf-v5-c-form-control,
input[type="text"],
input[type="password"],
input[type="email"] {
  border: 1.5px solid var(--alpid-border) !important;
  border-radius: 6px !important;
  padding: .55rem .8rem !important;
  font-size: .97rem !important;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  box-sizing: border-box;
}

.pf-v5-c-form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--alpid-blue) !important;
  box-shadow: 0 0 0 3px rgba(26,107,191,.15) !important;
  outline: none !important;
}

/* ─── Primary button ─────────────────────────────────────────────────────── */
.pf-v5-c-button.pf-m-primary,
#kc-login,
input[type="submit"] {
  background: var(--alpid-blue) !important;
  border: none !important;
  color: var(--alpid-white) !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: .97rem !important;
  padding: .65rem 1.4rem !important;
  cursor: pointer !important;
  transition: background .15s, transform .1s;
  width: 100%;
}

.pf-v5-c-button.pf-m-primary:hover,
#kc-login:hover {
  background: var(--alpid-blue-dark) !important;
  transform: translateY(-1px);
}

/* ─── Secondary / link buttons ───────────────────────────────────────────── */
.pf-v5-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-link,
a.pf-v5-c-button {
  color: var(--alpid-blue) !important;
  border-color: var(--alpid-blue) !important;
}

/* ─── Links ──────────────────────────────────────────────────────────────── */
a {
  color: var(--alpid-blue) !important;
}
a:hover {
  color: var(--alpid-blue-dark) !important;
}

/* ─── Alert / error ──────────────────────────────────────────────────────── */
.pf-v5-c-alert.pf-m-danger,
#kc-error-message {
  background: #fff0f0 !important;
  border-left: 4px solid #c0392b !important;
  border-radius: 6px !important;
  padding: .7rem 1rem !important;
  color: #c0392b !important;
  font-size: .9rem;
}

.pf-v5-c-alert.pf-m-warning {
  background: #fff8e6 !important;
  border-left: 4px solid var(--alpid-accent) !important;
  border-radius: 6px !important;
}

/* ─── Footer / copyright — hide Keycloak mentions ───────────────────────── */
.pf-v5-c-login__footer,
.pf-v5-c-list.pf-m-inline {
  display: none !important;
}

/* ─── Remember me checkbox area ─────────────────────────────────────────── */
#kc-form-options {
  margin-bottom: .6rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .pf-v5-c-login__main {
    border-radius: 0 !important;
    border: none !important;
  }
  .pf-v5-c-login__main-body,
  .pf-v5-c-login__main-footer {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
  }
}
