:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --navy-950: #0b253a;
  --navy-900: #0d2f4f;
  --teal-700: #06748a;
  --blue-600: #1570ef;
  --blue-700: #175cd3;
  --gold: #ffd21e;
  --danger: #b42318;
  --shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
  --font-sans: "Inter", "Inter var", "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(11, 37, 58, 0.98), rgba(13, 47, 79, 0.96) 52%, rgba(21, 112, 239, 0.9)),
    var(--navy-950);
  padding: 32px;
}

.login-auth {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(8, 31, 48, 0.98), rgba(10, 57, 79, 0.94) 46%, rgba(22, 104, 214, 0.92)),
    var(--navy-950);
}

.login-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.55), transparent 68%);
  animation: grid-drift 18s linear infinite;
}

.login-auth::after {
  content: "";
  position: fixed;
  inset: auto -10% 0 -10%;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 210, 30, 0.08));
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 444px;
  gap: 48px;
  align-items: center;
}

.login-shell {
  position: relative;
  z-index: 1;
}

.auth-info {
  color: #fff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy-950);
  font-weight: 850;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.login-auth .brand-mark {
  animation: float-in 700ms ease-out both;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-kicker {
  color: var(--gold);
}

.auth-info h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.6rem, 4vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-weight: 760;
}

.auth-lead {
  max-width: 680px;
  margin: 24px 0 28px;
  font-size: 1.03rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 450;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-grid > div {
  min-height: 136px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.login-info-grid > div {
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.login-info-grid > div:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 210, 30, 0.48);
  background: rgba(255, 255, 255, 0.14);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: rgba(255, 210, 63, 0.18);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.info-grid strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 750;
}

.info-grid p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.87rem;
  line-height: 1.45;
}

.auth-card {
  width: min(444px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 34px 90px rgba(4, 21, 37, 0.36),
    0 1px 0 rgba(255, 255, 255, 0.84) inset;
  animation: card-rise 620ms cubic-bezier(.2, .8, .2, 1) both;
}

.login-card .card-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.94)),
    radial-gradient(circle at top right, rgba(255, 210, 30, 0.16), transparent 38%);
}

.compact-auth .auth-card {
  padding-bottom: 28px;
}

.card-header {
  padding: 28px 30px 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-bottom: 1px solid #e5edf5;
}

.card-header h2 {
  margin: 0;
  font-size: 1.72rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 760;
}

.card-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.eyebrow {
  color: var(--blue-700);
}

.auth-form {
  padding: 26px 30px;
}

.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.input-shell {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f9fbfd;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(27, 127, 229, 0.13);
}

.login-card .input-shell {
  min-height: 48px;
  background: #f4f8fd;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.login-card .input-shell:hover {
  border-color: #b9cbe0;
  background: #fff;
}

.login-card .input-shell:focus-within {
  box-shadow:
    0 0 0 4px rgba(21, 112, 239, 0.14),
    0 12px 28px rgba(21, 112, 239, 0.12);
}

.auth-input,
.input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.input-addon,
.ghost-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid #e2eaf3;
  background: #edf3fa;
  color: #52657a;
  font-weight: 800;
}

.ghost-icon {
  cursor: pointer;
  font-size: 0.8rem;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 2px 0 18px;
  font-size: 0.86rem;
  font-weight: 600;
}

.form-row a,
.auth-footer-link a {
  color: var(--blue-700);
  text-decoration: none;
}

.form-row a:hover,
.auth-footer-link a:hover {
  text-decoration: underline;
}

.secure-note {
  color: #11845b;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue-600);
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(20, 120, 212, 0.25);
}

.primary-action:hover {
  background: var(--blue-700);
}

.login-card .primary-action {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1570ef, #175cd3);
  box-shadow: 0 18px 34px rgba(21, 112, 239, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-card .primary-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transform: translateX(-110%);
  transition: transform 540ms ease;
}

.login-card .primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px rgba(21, 112, 239, 0.34);
}

.login-card .primary-action:hover::after {
  transform: translateX(110%);
}

.login-card .primary-action:active {
  transform: translateY(0);
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #e5edf5;
  background: var(--panel-soft);
}

.trust-row span {
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: #213246;
  font-size: 0.78rem;
  font-weight: 700;
}

.trust-row span + span {
  border-left: 1px solid #e0e8f2;
}

.login-card .trust-row {
  background: linear-gradient(180deg, #f8fbfd, #eef5fb);
}

.login-card .trust-row span {
  color: #132f4b;
}

.auth-alert,
.errorlist {
  color: var(--danger);
}

.auth-alert {
  margin: 20px 30px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff1f0;
  border: 1px solid #ffd3cf;
  font-weight: 700;
}

.errorlist {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-footer-link {
  margin: 0;
  padding: 0 30px;
  text-align: center;
  font-weight: 700;
}

/* Match the main app and Unfold: normal reading text, medium labels, and
   restrained emphasis only where it helps users scan. */
body.auth-page {
  font-size: 14.5px;
  font-weight: 400;
}

body.auth-page p,
body.auth-page span,
body.auth-page small,
body.auth-page label,
body.auth-page a,
body.auth-page button,
body.auth-page input {
  font-weight: 400;
}

.auth-info h1 {
  font-weight: 650;
}

.card-header h2 {
  font-weight: 650;
}

.brand-mark,
.brand-kicker,
.eyebrow,
.field-group label,
.info-grid strong,
.primary-action,
.trust-row span,
.auth-footer-link {
  font-weight: 600;
}

.auth-lead,
.info-grid p,
.card-header p:last-child,
.auth-input,
.input-shell input,
.form-row {
  font-weight: 400;
}

.info-icon,
.input-addon,
.ghost-icon,
.auth-alert,
.errorlist,
.secure-note {
  font-weight: 600;
}

.link-action {
  width: calc(100% - 60px);
  margin: 0 30px;
}

.invite-shell {
  grid-template-columns: minmax(0, 1fr) 480px;
}

.activation-card,
.recovery-card {
  width: min(480px, 100%);
}

.invite-summary {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.invite-summary > div {
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.invite-summary span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.invite-summary strong {
  display: block;
  color: #fff;
  font-weight: 650;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd, #eef6fb);
}

.account-chip > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--navy-950);
  color: var(--gold);
  font-weight: 750;
}

.account-chip strong,
.account-chip small {
  display: block;
}

.account-chip strong {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.account-chip small {
  margin-top: 2px;
  color: var(--muted);
}

.password-guide,
.recovery-note,
.status-panel,
.inline-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
}

.password-guide {
  border: 1px solid #d9eadf;
  background: #f3fbf6;
  color: #155b3d;
}

.password-guide strong,
.recovery-note strong,
.status-panel strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
}

.password-guide ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.password-guide li {
  margin: 5px 0;
  line-height: 1.45;
}

.inline-alert {
  border: 1px solid #ffd3cf;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 650;
}

.recovery-note {
  margin: -4px 30px 22px;
  border: 1px solid #e1ebf3;
  background: #f8fbfd;
  color: #425466;
}

.recovery-note p,
.status-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 26px 30px;
  border: 1px solid #d9eadf;
  background: #f3fbf6;
  color: #155b3d;
}

.status-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #11845b;
  color: #fff;
  font-weight: 750;
}

.status-card .auth-footer-link {
  padding-bottom: 4px;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 72px 72px, 72px 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 920px) {
  body.auth-page {
    padding: 0;
    background: #f4f8fc;
  }

  .auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .auth-info {
    display: none;
  }

  .auth-card {
    box-shadow: 0 18px 44px rgba(15, 42, 65, 0.14);
  }
}

@media (max-width: 520px) {
  .auth-shell,
  body.auth-page {
    padding: 0;
  }

  .auth-card {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .compact-auth {
    align-items: stretch;
  }

  .card-header {
    padding: 34px 22px 22px;
  }

  .auth-form {
    padding: 24px 22px;
  }

  .recovery-note,
  .status-panel {
    margin-right: 22px;
    margin-left: 22px;
  }

  .trust-row {
    grid-template-columns: 1fr;
  }

  .trust-row span {
    min-height: 48px;
  }

  .trust-row span + span {
    border-left: 0;
    border-top: 1px solid #e0e8f2;
  }
}
