/* Tenant sign-in — aligned with Platform Admin sign-in */

:root {
  --brand-blue: #0a2a5c;
  --brand-blue-mid: #1a4a8c;
  --brand-magenta: #d4145a;
  --brand-red: #b8104a;
  --tint-rgb: 10, 42, 92;
  --accent-rgb: 212, 20, 90;
  --ink: #0a2a5c;
  --ink-soft: #4a5d78;
  --ink-mute: #7a8ba3;
  --surface: #eef2f7;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html:has(body.login-body),
body.login-body {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
}

body.login-body {
  margin: 0;
  background: var(--surface, #eef2f7) !important;
  color: var(--ink, #0a2a5c) !important;
  font-family: "Manrope", "Segoe UI", sans-serif !important;
}

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(var(--tint-rgb), 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(var(--accent-rgb), 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #f4f7fb 0%, #e8eef6 100%);
}

.login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: radial-gradient(rgba(var(--tint-rgb), 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: login-fade-up 0.55s var(--ease) both;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.login-logo-wrap--full {
  width: auto;
  max-width: min(280px, 78vw);
  height: auto;
  padding: 10px 14px;
  border-radius: 18px;
  background: #fff;
}

.login-logo--full {
  width: 100%;
  height: auto;
  max-height: 148px;
  object-fit: contain;
  display: block;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: center;
  align-items: center;
}

.login-product {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-mute, #7a8ba3);
}

.login-panel {
  background: #fff;
  border: 1px solid rgba(var(--tint-rgb), 0.1);
  border-radius: 18px;
  padding: 28px 28px 26px;
  box-shadow:
    0 1px 2px rgba(var(--tint-rgb), 0.04),
    0 18px 40px rgba(var(--tint-rgb), 0.08);
  animation: login-fade-up 0.55s var(--ease) 0.06s both;
}

.login-panel-head {
  margin-bottom: 22px;
}

.login-panel-head h1 {
  margin: 0 0 10px;
  font-family: "Manrope", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--brand-blue);
}

.login-panel-head p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-mute, #7a8ba3);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-form .field span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.login-form .field input {
  width: 100%;
  border-radius: 11px;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid rgba(var(--tint-rgb), 0.12);
  font-size: 0.94rem;
  color: var(--ink, #0a2a5c) !important;
  caret-color: var(--ink, #0a2a5c);
}

.login-form .field input::placeholder {
  color: #9aa8bc;
}

.login-form .field input:focus {
  outline: none;
  background: #fff !important;
  border-color: var(--brand-magenta, #d4145a) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 212, 20, 90), 0.12) !important;
}

.login-password-row {
  position: relative;
  display: flex;
  align-items: center;
}

.login-password-row input {
  width: 100%;
  padding-right: 46px;
}

.login-toggle-pw {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--ink-mute);
  cursor: pointer;
}

.login-toggle-pw:hover {
  color: var(--brand-blue);
  background: #fff;
}

.login-toggle-pw svg {
  width: 18px;
  height: 18px;
}

.login-toggle-pw .is-hidden {
  display: none;
}

.login-error {
  display: none;
  margin: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #fde8ec;
  color: var(--brand-red);
  font-size: 0.86rem;
  font-weight: 650;
}

.login-error:not(.is-hidden) {
  display: block;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 0;
  border-radius: 11px;
  background: var(--brand-magenta);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.22);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.primary-btn:hover {
  background: var(--brand-red);
  transform: translateY(-1px);
}

.primary-btn svg {
  width: 16px;
  height: 16px;
}

.login-submit {
  position: relative;
  width: 100%;
  margin-top: 2px;
}

.login-submit .login-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: none;
  animation: login-spin 0.75s linear infinite;
}

.login-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.login-submit.is-loading .login-submit-arrow,
.login-submit.is-loading #btnText {
  opacity: 0.35;
}

.login-submit.is-loading .login-spinner,
.login-submit.is-loading .login-spinner:not(.is-hidden) {
  display: inline-block;
}

.login-submit .login-spinner.is-hidden {
  display: none;
}

.login-footer {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-mute);
  animation: login-fade-up 0.55s var(--ease) 0.12s both;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@keyframes login-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 28px 16px 36px;
    align-items: flex-start;
    padding-top: 48px;
  }

  .login-panel {
    padding: 22px 18px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-panel,
  .login-footer {
    animation: none !important;
  }
}

/* Signed-out confirmation */

.signout-page .signout-shell {
  animation: login-fade-up 0.45s var(--ease) both;
}

.signout-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 28px 24px 24px;
}

.signout-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ok, #0d9488);
  background:
    radial-gradient(circle at 30% 25%, rgba(13, 148, 136, 0.2), transparent 60%),
    linear-gradient(160deg, #e6f7f5, #fff 70%);
  border: 1px solid color-mix(in srgb, #0d9488 28%, #e5eaf0);
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.12);
  animation: signout-pop 0.55s var(--ease) both;
}

.signout-mark svg {
  width: 30px;
  height: 30px;
}

.signout-head {
  text-align: center;
}

.signout-head h1 {
  margin: 0;
}

.signout-head p {
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
}

.signout-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-decoration: none;
  box-sizing: border-box;
  color: #fff;
}

.signout-cta:hover,
.signout-cta:focus {
  color: #fff;
  filter: brightness(1.03);
}

.signout-cta:focus-visible {
  outline: 2px solid var(--brand-magenta, #d4145a);
  outline-offset: 3px;
}

@keyframes signout-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
