/* Dionysus — Keycloak login */

:root {
  --lv-cream: #0c0a0b;
  --lv-mist: #161214;
  --lv-blush: #2a1a22;
  --lv-rose: #c98ba3;
  --lv-rouge: #e891b0;
  --lv-rouge-hover: #d16b8d;
  --lv-pearl: #f9a7c1;
  --lv-champagne: #d4a8b8;
  --lv-ink: #f6eef2;
  --lv-muted: #b5a0a8;
  --lv-card: rgba(26, 22, 24, 0.94);
  --lv-radius: 1.35rem;
  --lv-rose-soft: rgba(232, 145, 176, 0.18);
  --lv-font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --lv-font-serif: "Bodoni Moda", Georgia, serif;
}

html {
  height: 100%;
  overflow: hidden;
}

html,
body {
  font-family: var(--lv-font-sans);
  color: var(--lv-ink);
  background: #120e0f;
}

.bg-primary-600,
.hover\:bg-primary-700:hover {
  background-color: var(--lv-rouge) !important;
}

.hover\:bg-primary-700:hover {
  background-color: var(--lv-rouge-hover) !important;
}

.text-primary-600,
.hover\:text-primary-500:hover,
a.text-primary-600 {
  color: var(--lv-rouge) !important;
}

.focus\:ring-primary-600:focus {
  --tw-ring-color: var(--lv-rouge) !important;
}

/* Stage — lock to viewport so the hero scale / tall logo don't create page scroll */
.tf-body {
  position: relative;
  isolation: isolate;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #120e0f;
  /* Override Tailwind sm:py-16 which forces vertical overflow on short screens */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.tf-hero,
.tf-hero-overlay,
.tf-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tf-hero {
  z-index: 0;
  background-color: #1a1415;
  background-image: url("../img/login-bg.jpg");
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  /* Slight zoom without expanding scrollable overflow */
  transform: scale(1.04);
  transform-origin: center center;
  filter: saturate(0.92) contrast(1.05);
}

.tf-hero-overlay {
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 55% at 50% 18%, rgba(232, 145, 176, 0.28), transparent 62%),
    radial-gradient(ellipse 55% 45% at 85% 80%, rgba(209, 107, 141, 0.22), transparent 60%),
    linear-gradient(
      165deg,
      rgba(18, 14, 15, 0.55) 0%,
      rgba(26, 20, 21, 0.72) 42%,
      rgba(12, 9, 10, 0.9) 100%
    );
}

.tf-hero-glow {
  z-index: 1;
  background:
    radial-gradient(circle at 20% 80%, rgba(252, 228, 236, 0.08), transparent 35%),
    radial-gradient(circle at 70% 15%, rgba(232, 208, 211, 0.12), transparent 40%);
  animation: lv-glow 10s ease-in-out infinite alternate;
}

@keyframes lv-glow {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

.tf-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 145, 176, 0.45) transparent;
}

.tf-shell {
  width: 100%;
  max-width: 26.5rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
}

.tf-shell:has(.lv-totp-setup) {
  max-width: 28.5rem;
}

/* Brand block above the form card */
.tf-brand {
  text-align: center;
  margin-bottom: 1.35rem;
  animation: lv-rise 0.7s ease-out both;
}

.tf-logo {
  height: auto;
  width: min(300px, 78%);
  max-width: 340px;
  max-height: 4.5rem;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.65rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.tf-brand-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 247, 245, 0.72);
}

.tf-brand-title {
  margin: 0.45rem 0 0;
  font-family: var(--lv-font-serif);
  font-size: clamp(1.55rem, 4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  color: #faf7f5;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.tf-brand-title em {
  font-style: italic;
  color: var(--lv-rouge);
  font-weight: 500;
}

/* Form card */
.tf-card {
  background: var(--lv-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--lv-radius);
  border: 1px solid rgba(250, 247, 245, 0.35);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  overflow: hidden;
  animation: lv-rise 0.75s ease-out 0.08s both;
}

@keyframes lv-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tf-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.35rem 0;
  min-height: 0.5rem;
}

.tf-card-header:empty {
  display: none;
}

.tf-card-body {
  padding: 0.75rem 1.5rem 1.6rem;
}

.tf-card-footer {
  padding: 0 1.5rem 1.25rem;
}

.tf-form-intro {
  margin: 0 0 1rem;
  text-align: center;
}

.tf-form-intro .tf-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lv-champagne);
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.tf-form-intro .tf-title {
  font-family: var(--lv-font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--lv-ink);
  margin: 0;
}

.tf-form-intro .tf-subtitle {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--lv-muted);
}

/* OTP challenge */
.lv-otp {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lv-otp-badge {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0.15rem auto 0.35rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: var(--lv-rouge);
  background: linear-gradient(145deg, rgba(232, 145, 176, 0.22), rgba(201, 139, 163, 0.08));
  border: 1px solid rgba(232, 145, 176, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.lv-otp-hint {
  margin: 0.15rem 0 0.35rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--lv-muted);
}

.lv-otp-devices {
  margin-bottom: 0.35rem;
}

.lv-otp-devices-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lv-champagne);
  font-weight: 600;
}

.lv-otp-device-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tf-card input.lv-otp-input,
.tf-card .lv-otp-input {
  text-align: center !important;
  letter-spacing: 0.42em !important;
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  min-height: 3.15rem !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* TOTP setup */
.lv-totp-setup {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lv-totp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lv-totp-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(250, 247, 245, 0.12);
}

.lv-totp-step-num {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(100deg, var(--lv-rose), var(--lv-rouge));
  box-shadow: 0 6px 14px rgba(158, 90, 99, 0.28);
}

.lv-totp-step-title {
  margin: 0 0 0.2rem;
  font-family: var(--lv-font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--lv-ink);
}

.lv-totp-step-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--lv-muted);
}

.lv-totp-apps {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  color: var(--lv-ink);
  font-size: 0.84rem;
}

.lv-totp-apps li {
  margin: 0.15rem 0;
}

.lv-totp-qr {
  margin: 0.75rem auto;
  width: fit-content;
  padding: 0.75rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.lv-totp-qr img {
  display: block;
  width: 168px;
  height: 168px;
}

.lv-totp-secret {
  margin: 0.55rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(232, 145, 176, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  color: var(--lv-pearl);
}

.tf-tabs {
  display: flex;
  gap: 0.55rem;
  padding: 0 1.5rem 0.35rem;
}

.tf-tab {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 20, 21, 0.18);
  color: var(--lv-ink);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tf-tab:hover {
  border-color: var(--lv-rouge);
  color: var(--lv-rouge);
}

.tf-tab.is-active {
  background: linear-gradient(90deg, var(--lv-rose) 0%, var(--lv-rouge) 100%);
  border-color: transparent;
  color: #ffffff;
}

.tf-footer {
  margin-top: 1.35rem;
  text-align: center;
  color: rgba(250, 247, 245, 0.7);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.55;
  animation: lv-rise 0.8s ease-out 0.16s both;
}

.tf-footer strong {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.14em;
}

/* Form controls — text-gray-* utilities are missing from dist CSS, so set color explicitly */
.tf-card input[type="text"],
.tf-card input[type="password"],
.tf-card input[type="email"],
.tf-card select,
.tf-card textarea {
  border-radius: 0.85rem !important;
  border-color: rgba(201, 160, 164, 0.55) !important;
  background: #ffffff !important;
  color: #1a1415 !important;
  -webkit-text-fill-color: #1a1415 !important;
  caret-color: #1a1415;
  min-height: 2.85rem;
}

.tf-card input::placeholder,
.tf-card textarea::placeholder {
  color: #6b5a60 !important;
  -webkit-text-fill-color: #6b5a60 !important;
  opacity: 1;
}

.tf-card input:-webkit-autofill,
.tf-card input:-webkit-autofill:hover,
.tf-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a1415 !important;
  caret-color: #1a1415;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out;
}

.tf-card input:focus,
.tf-card select:focus,
.tf-card textarea:focus {
  outline: none;
  border-color: var(--lv-rouge) !important;
  box-shadow: 0 0 0 3px var(--lv-rose-soft);
  color: #1a1415 !important;
  -webkit-text-fill-color: #1a1415 !important;
}

.tf-card button[type="submit"],
.tf-card .bg-primary-600 {
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.82rem !important;
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
  background: linear-gradient(100deg, var(--lv-rose) 0%, var(--lv-rouge) 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(158, 90, 99, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.tf-card button[type="submit"]:hover,
.tf-card .hover\:bg-primary-700:hover {
  background: linear-gradient(100deg, var(--lv-rouge) 0%, var(--lv-rouge-hover) 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(158, 90, 99, 0.34);
}

.tf-card,
.tf-card input,
.tf-card button,
.tf-card a,
.tf-card label {
  pointer-events: auto;
}

@media (max-width: 480px) {
  .tf-shell {
    padding: 0.85rem 1rem 1.15rem;
  }

  .tf-brand {
    margin-bottom: 0.9rem;
  }

  .tf-logo {
    width: min(240px, 72%);
    max-height: 3.5rem;
  }

  .tf-brand-title {
    font-size: 1.35rem;
  }

  .tf-brand-kicker {
    display: none;
  }

  .tf-card-body,
  .tf-card-footer,
  .tf-tabs {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .tf-footer {
    margin-top: 0.9rem;
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tf-hero-glow,
  .tf-brand,
  .tf-card,
  .tf-footer {
    animation: none;
  }
}

/* Hide social / identity-provider login blocks */
.kc-social-section,
#kc-social-providers,
.separate.text-secondary-600,
div.pt-2.separate {
  display: none !important;
}
