:root {
  color-scheme: light;
  --bg-base: #f8f9fc;
  --bg-card: #ffffff;
  --text-primary: #1e1b4b;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --input-bg: #f9fafb;
  --input-border: #d1d5db;
  --input-focus: #4f46e5;
  --btn-gradient: linear-gradient(135deg, #4f46e5, #7c3aed, #a855f7);
  --error-bg: #fef2f2;
  --error-border: #fca5a5;
  --error-text: #991b1b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --link: #4f46e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 15% 15%, rgba(79,70,229,.18), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(255,90,138,.13), transparent 38%),
    linear-gradient(180deg, #f8f9ff 0%, #eef2ff 100%);
  min-height: 100vh;
}

/* ── Keyframe animations ──────────────────────────────────────── */
@keyframes prysm-brand-shift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

@keyframes prysm-float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-18px) scale(1.04); }
}

@keyframes prysm-blob2 {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(14px) scale(0.95); }
}

@keyframes prysm-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes prysm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes prysm-slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes prysm-pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.28); }
  50%       { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
}

/* ── Legacy shell (fallback for non-split pages) ─────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(79,70,229,.18), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(255,90,138,.13), transparent 38%),
    linear-gradient(180deg, #f8f9ff 0%, #eef2ff 100%);
}

.auth-panel {
  width: min(460px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ── Split layout (central login) — now single centered card ─── */
.auth-split {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Left brand panel — hidden (layout is now single centered card) */
.auth-brand-panel {
  display: none !important;
}

.auth-brand-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
}

.auth-brand-blob--1 {
  width: 360px;
  height: 360px;
  background: rgba(99,102,241,.22);
  top: -80px;
  left: -80px;
  animation: prysm-float 7s ease-in-out infinite;
}

.auth-brand-blob--2 {
  width: 260px;
  height: 260px;
  background: rgba(124,58,237,.2);
  bottom: -60px;
  right: 30px;
  animation: prysm-blob2 9s ease-in-out infinite;
}

.auth-brand-blob--3 {
  width: 200px;
  height: 200px;
  background: rgba(255,90,138,.1);
  top: 45%;
  right: -50px;
  animation: prysm-float 12s ease-in-out infinite reverse;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  animation: prysm-fade-up .7s ease both;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.auth-brand-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(196,181,253,1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Logo gradient on light backgrounds (mobile form panel) */
.auth-form-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.5px;
  background: linear-gradient(90deg, #4f46e5 0%, #a855f7 70%, #ff5a8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand-tagline {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255,255,255,.95);
  max-width: 340px;
}

.auth-brand-sub {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(255,255,255,.6);
  max-width: 300px;
}

.auth-brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.auth-brand-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
  font-size: 12px;
  color: rgba(255,255,255,.8);
  backdrop-filter: blur(4px);
}

.auth-brand-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  animation: prysm-fade-in 1.2s ease both;
}

/* Form panel — centered card on light gradient background */
.auth-form-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  animation: prysm-fade-up .45s ease both;
}

@media (max-width: 599px) {
  .auth-form-panel {
    padding: 28px 18px;
  }
}

/* ── Animated background blobs ──────────────────────────── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float 18s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.bg-blob-1 {
  width: 400px;
  height: 400px;
  background: #4f46e5;
  top: 10%;
  right: 15%;
}

.bg-blob-2 {
  width: 350px;
  height: 350px;
  background: #ff5a8a;
  bottom: 20%;
  right: 30%;
  animation-delay: -6s;
}

.bg-blob-3 {
  width: 300px;
  height: 300px;
  background: #a855f7;
  top: 40%;
  right: 5%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(0.95); }
}

.auth-form-panel-inner {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.auth-form-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.auth-form-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.auth-form-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.auth-form-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-form-separator::before,
.auth-form-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-register-link {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-register-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-register-link a:hover {
  color: var(--accent-hover);
}

/* ── Form elements ───────────────────────────────────────────── */
.auth-panel h1,
.auth-form-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-panel p {
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  height: 42px;
  padding: 0 12px;
  color: var(--text-primary);
  background: var(--input-bg);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.auth-form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
  border-color: var(--input-focus);
}

.auth-form button[type="submit"],
.auth-form button {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  height: 44px;
  font-weight: 700;
  font-size: 14px;
  background: var(--btn-gradient);
  color: white;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  animation: prysm-pulse-ring 3s ease-in-out infinite;
}

.auth-form button[type="submit"]:hover,
.auth-form button:hover {
  opacity: .88;
  transform: translateY(-1px);
}

.auth-error,
.auth-message {
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.auth-message {
  border-color: rgba(79, 70, 229, 0.25);
  background: #eef2ff;
  color: #3730a3;
}

/* ── Password input wrapper ──────────────────────────────────── */
.auth-pw-wrap {
  position: relative;
}

.auth-pw-wrap input {
  padding-right: 40px;
}

.auth-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  animation: none;
  height: auto;
  margin: 0;
}

.auth-pw-toggle:hover {
  color: var(--text-primary);
  transform: translateY(-50%);
  opacity: 1;
}

/* ── Tenant list ─────────────────────────────────────────────── */
.tenant-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.tenant-list a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color .15s, box-shadow .15s;
}

.tenant-list a:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79,70,229,.1);
}

/* ── SSO buttons ─────────────────────────────────────────────── */
.auth-sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.auth-sso-btn:hover {
  border-color: var(--accent);
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(79,70,229,.1);
}

.auth-back {
  display: inline-block;
  margin-top: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}

.auth-back:hover {
  color: var(--text-primary);
}

/* ── Divider ─────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Tenant login full-screen ────────────────────────────────── */
.tenant-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(79,70,229,.18), transparent 42%),
    radial-gradient(circle at 84% 18%, rgba(255,90,138,.13), transparent 38%),
    linear-gradient(180deg, #f8f9ff 0%, #eef2ff 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}

.tenant-login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

.tenant-login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  animation: prysm-fade-up .45s ease both;
}

.tenant-login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.tenant-login-logo img {
  height: 52px;
  border-radius: 10px;
}

.tenant-login-avatar {
  width: 58px;
  height: 58px;
  max-width: 64px;
  max-height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
  object-fit: contain;
}

.tenant-login-footer img {
  max-width: 80px;
  height: auto;
  vertical-align: middle;
}

.tenant-login-name {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tenant-login-email-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.tenant-login-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 11px;
  color: var(--text-muted);
}

.tenant-login-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.tenant-login-footer a:hover {
  color: var(--accent);
}

/* ── Glass card variant (custom background set) ──────────────── */
.auth-form-panel--glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

/* ── Submit button explicit class ────────────────────────────── */
.auth-submit-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  height: 44px;
  font-weight: 700;
  font-size: 14px;
  background: var(--btn-gradient);
  color: white;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  animation: prysm-pulse-ring 3s ease-in-out infinite;
}

.auth-submit-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

