/**
 * Rose-Pine Theme — Welcome Page
 *
 * Keycloak 26's welcome page uses PatternFly 5 login-template classes
 * (pf-v5-c-login, pf-v5-c-brand, pf-v5-c-login__main, etc.). It respects
 * prefers-color-scheme via an inline script that toggles `pf-v5-theme-dark`
 * on <html>. So we key our dark palette off that class instead of our own
 * data-theme attribute — no extra JS needed.
 */

/* ============================================================================
   ROSE-PINE PALETTE — LIGHT (Dawn) default
   ============================================================================ */
:root {
  --rp-base: #faf4ed;
  --rp-surface: #fffaf3;
  --rp-overlay: #f2e9e1;
  --rp-muted: #9893a5;
  --rp-subtle: #797593;
  --rp-text: #575279;
  --rp-love: #b4637a;
  --rp-gold: #ea9d34;
  --rp-rose: #d7827e;
  --rp-foam: #56949f;
  --rp-iris: #907aa9;
}

html.pf-v5-theme-dark {
  --rp-base: #191724;
  --rp-surface: #1f1d2e;
  --rp-overlay: #26233a;
  --rp-muted: #6e6a86;
  --rp-subtle: #908caa;
  --rp-text: #e0def4;
  --rp-love: #eb6f92;
  --rp-gold: #f6c177;
  --rp-rose: #ebbcba;
  --rp-foam: #9ccfd8;
  --rp-iris: #c4a7e7;
}

/* ============================================================================
   BODY + BACKGROUND
   ============================================================================ */
html,
body {
  background: var(--rp-base) !important;
  color: var(--rp-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* PF5 draws a giant background image — hide it and let our color show */
.pf-v5-c-background-image,
.pf-v5-c-background-image::before,
.pf-v5-c-background-image::after {
  display: none !important;
}

/* ============================================================================
   LOGIN-TEMPLATE CONTAINER (the "welcome card")
   ============================================================================ */
.pf-v5-c-login {
  background: transparent;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.pf-v5-c-login__container {
  background: transparent;
  max-width: 36rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* PF5 applies a grid constraint by default; flatten it */
  grid-template-columns: none;
  grid-template-rows: none;
  grid-template-areas: none;
}

/* PF5 sets max-inline-size on the main; override it */
.pf-v5-c-login__main {
  max-inline-size: 100%;
}

/* ============================================================================
   BRAND — replace Keycloak logo with gradient wordmark
   ============================================================================ */
.pf-v5-c-login__header {
  text-align: center;
}

.pf-v5-c-brand {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--rp-foam) 0%, var(--rp-gold) 50%, var(--rp-love) 100%);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--rp-gold) 35%, transparent);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--rp-base);
  position: relative;
}

/* Hide the default Keycloak logo image and show a text brand instead */
.pf-v5-c-brand img,
.pf-v5-c-brand svg {
  display: none !important;
}

.pf-v5-c-brand::after {
  content: 'Keycloak';
  display: inline-block;
  color: var(--rp-base);
}

/* ============================================================================
   MAIN CONTENT CARD
   ============================================================================ */
.pf-v5-c-login__main {
  background: var(--rp-surface);
  border-radius: 1.5rem;
  border: 1px solid var(--rp-overlay);
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px color-mix(in srgb, var(--rp-base) 30%, transparent);
  color: var(--rp-text);
}

.pf-v5-c-login__main-header,
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-footer {
  background: transparent;
  color: var(--rp-text);
}

/* Headings inside the welcome card */
.pf-v5-c-login__main h1,
.pf-v5-c-login__main h2,
.pf-v5-c-login__main .pf-v5-c-title {
  color: var(--rp-text);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

/* Body copy */
.pf-v5-c-login__main p,
.pf-v5-c-login__main li {
  color: var(--rp-text);
  line-height: 1.6;
}

/* Inline code (e.g. bootstrap-admin) */
.pf-v5-c-login__main code,
.pf-v5-c-login__main kbd {
  background: var(--rp-overlay);
  color: var(--rp-foam);
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ============================================================================
   LINKS
   ============================================================================ */
a {
  color: var(--rp-foam);
  text-decoration: none;
}
a:hover {
  color: var(--rp-rose);
  text-decoration: underline;
}

/* ============================================================================
   BUTTONS (if the welcome page renders any)
   ============================================================================ */
.pf-v5-c-button,
button,
input[type="submit"] {
  background: linear-gradient(135deg, var(--rp-foam) 0%, var(--rp-gold) 100%);
  color: var(--rp-base);
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.pf-v5-c-button:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
