/* ================= SkillPulse login — "Modernist" port =================
   Source: owner-supplied Claude Design (Keycloak Login.dc.html, project
   599ee729) + its design-system tokens. Light ground, ink text, red-orange
   accent, Archivo-class 800 headings (system fallback — no external font
   CDN on these pages), radius 0, 2px dividers. Split layout: brand panel
   left (#kc-header hook), step content right. CSS-only — NO FTL overrides.
   FILENAME IS VERSIONED PER CHANGE (Cloudflare caches /auth/resources/*). */
:root {
  --sp-bg: #f3f2f2;
  --sp-surface: #eae9e9;
  --sp-text: #201e1d;
  --sp-muted: rgba(32, 30, 29, 0.65);
  --sp-faint: rgba(32, 30, 29, 0.45);
  --sp-divider: rgba(32, 30, 29, 0.4);
  --sp-accent: #ec3013;
  --sp-accent-600: #dd2b0f;
  --sp-accent-700: #ae1800;
  --sp-accent-900: #4d170e;
  --sp-accent-100: #fff2ef;
  --sp-font: "Archivo", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html.sp-html { height: 100%; }
body.sp-body {
  margin: 0;
  min-height: 100vh;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: var(--sp-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(236, 48, 19, 0.3); }
a { color: var(--sp-accent-700); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--sp-accent-900); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

/* ---- split layout: brand panel (kc-header) left, content right ---- */
.sp-login {
  display: grid;
  grid-template-columns: minmax(340px, 38%) 1fr;
  min-height: 100vh;
  width: 100%;
  margin: 0;
}
.sp-header {
  grid-row: 1;
  grid-column: 1;
  background: var(--sp-accent-700);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  min-height: 100vh;
}
.sp-header::before {
  /* Owner ruling 2026-08-21: never name the IdP product on a public page —
     the string "KEYCLOAK" here handed CVE-shoppers the exact software
     behind the login, defeating this theme's own stated purpose. */
  content: "SKILLPULSE · SECURE SIGN-IN";
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}
.sp-wordmark {
  font-weight: 800;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: auto 0 0;
}
.sp-header::after {
  content: "One identity across every workspace. Sign in once — we route you to whatever gets you in fastest: a passkey, single sign-on, or your password.";
  display: block;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 15px;
  line-height: 1.55;
  max-width: 36ch;
  opacity: 0.92;
}

/* ---- right column: naked content, no card chrome ---- */
.sp-card {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  justify-self: center;
  width: min(400px, 88%);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 40px 0;
  animation: sp-fade-up 0.35s ease;
}
@keyframes sp-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#kc-page-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--sp-text);
  text-align: left;
}
.sp-card-header { margin-bottom: 24px; }
.sp-locale, #kc-locale { display: none; }

/* ---- forms ---- */
.sp-group { margin-bottom: 16px; }
.sp-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(32, 30, 29, 0.7);
}
.sp-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--sp-text);
  caret-color: var(--sp-accent);
  background: var(--sp-surface);
  border: 1px solid var(--sp-divider);
  border-radius: 0;
  transition: border-color 0.15s;
}
.sp-input:hover { border-color: rgba(32, 30, 29, 0.45); }
.sp-input:focus-visible { border-color: var(--sp-accent); outline-offset: 0; }
.sp-input[aria-invalid="true"] { border-color: var(--sp-accent-700); }
.sp-input-group { display: flex; }
.sp-input-group .sp-input { flex: 1; }
.sp-pw-toggle { display: none; }
.sp-input-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--sp-accent-700);
}
.sp-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 22px;
  font-size: 13px;
}
.sp-setting .checkbox label { color: var(--sp-muted); font-weight: 400; }
.sp-setting input[type="checkbox"] { accent-color: var(--sp-accent); margin-right: 6px; }

/* ---- buttons ---- */
.sp-btn {
  font-family: var(--sp-font);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 0;
}
.sp-btn-primary {
  width: 100%;
  padding: 13px 16px;
  color: var(--sp-bg);
  background: var(--sp-accent);
  border: none;
  text-align: left;
  transition: background 0.15s;
}
.sp-btn-primary:hover { background: var(--sp-accent-600); }
.sp-btn-primary:active { background: var(--sp-accent-700); }
.sp-btn-default {
  width: 100%;
  padding: 12px 16px;
  color: var(--sp-text);
  background: transparent;
  border: 1px solid var(--sp-divider);
  text-align: left;
}
.sp-btn-default:hover { background: rgba(32, 30, 29, 0.07); }

/* ---- alerts ---- */
.sp-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  border: 2px solid var(--sp-accent-700);
  background: var(--sp-accent-100);
  color: var(--sp-accent-900);
  border-radius: 0;
}
.sp-alert .pficon, .sp-alert span[class^="pficon"] { display: none; }
.alert-error.sp-alert { border-color: var(--sp-accent-700); background: var(--sp-accent-100); color: var(--sp-accent-900); }
.alert-warning.sp-alert { border-color: #b45309; background: #fef3c7; color: #78350f; }
.alert-success.sp-alert { border-color: #15803d; background: #dcfce7; color: #14532d; }
.alert-info.sp-alert { border-color: rgba(32,30,29,.5); background: var(--sp-surface); color: var(--sp-text); }

.sp-info, #kc-info { margin-top: 16px; font-size: 13px; color: var(--sp-muted); text-align: left; }
#kc-registration-container, .sp-signup { margin-top: 20px; text-align: left; font-size: 13px; color: var(--sp-muted); }
#kc-form-buttons { margin-top: 8px; }

/* Hide "Try another way" ONLY on pages that carry the combined
   username+password form; on the password-only / webauthn pages it is the
   switch path and stays visible, restyled as a ghost button. */
body:has(#kc-form-login input[name="username"]):has(#kc-form-login input[name="password"]) [id*="try-another-way"],
body:has(#kc-form-login input[name="username"]):has(#kc-form-login input[name="password"]) a[href*="tryAnotherWay"] { display: none; }
a[href*="tryAnotherWay"], #try-another-way {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 4px;
  font-weight: 800;
  font-size: 14px;
  color: var(--sp-accent);
  text-decoration: none;
}
a[href*="tryAnotherWay"]:hover, #try-another-way:hover { background: rgba(236, 48, 19, 0.1); color: var(--sp-accent); }

/* ---- authenticator picker (select-authenticator page) ---- */
#kc-select-credential-form > div { display: flex; flex-direction: column; gap: 10px; }
#kc-select-credential-form button[name="authenticationExecution"] {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  font: inherit; text-align: left;
  color: var(--sp-text);
  background: var(--sp-surface);
  border: 1px solid var(--sp-divider);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s;
}
#kc-select-credential-form button[name="authenticationExecution"]:hover { border-color: var(--sp-accent); }
#kc-select-credential-form button i { display: none; }
#kc-select-credential-form button > div:nth-child(2) > div:first-child {
  font-weight: 800; font-size: 15px; margin-bottom: 2px;
}
#kc-select-credential-form button > div:nth-child(2) > div:last-child {
  font-size: 13px; color: var(--sp-muted);
}

/* ---- responsive: stack panel on small screens ---- */
@media (max-width: 780px) {
  .sp-login { grid-template-columns: 1fr; }
  .sp-header { grid-column: 1; min-height: 0; padding: 24px; }
  .sp-header::after { display: none; }
  .sp-wordmark { font-size: 32px; margin: 12px 0 0; }
  .sp-card { grid-column: 1; grid-row: 2; padding: 32px 0; }
}
