:root {
  --auth-ink: #08143d;
  --auth-text: #41547d;
  --auth-muted: #7180a2;
  --auth-line: #d8deec;
  --auth-purple: #7c3aed;
  --auth-purple-mid: #8f47ff;
  --auth-magenta: #d83bd7;
  --auth-soft: #f6f3ff;
  --auth-danger: #b4233b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
button, input { font: inherit; }
a { color: inherit; }

body.account-body {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background: #f8f8fc url("assets/auth/auth-hero-relaylane.png") center top / cover no-repeat fixed;
  font-family: Inter, ui-sans-serif, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.account-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(480px, 0.9fr);
  min-height: 100vh;
}

.account-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(110px, 17vh, 190px) clamp(54px, 9vw, 142px) 120px;
}

/* The approved hero already contains the desktop wordmark. */
.account-brand-logo { display: none; }

.account-visual-copy {
  display: grid;
  width: min(510px, 100%);
}

.account-visual-copy::before {
  width: 52px;
  height: 4px;
  margin-bottom: 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--auth-purple), var(--auth-magenta));
  content: "";
}

.account-visual-copy h1 {
  max-width: 500px;
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(48px, 4.1vw, 66px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.account-visual-copy h1 strong {
  color: var(--auth-purple);
  font-weight: inherit;
}

.account-visual-copy > p {
  max-width: 390px;
  margin: 30px 0 0;
  color: var(--auth-text);
  font-size: 18px;
  line-height: 1.7;
}

.account-feature-list { display: none; }

.account-panel {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 64px clamp(44px, 6vw, 96px) 64px 24px;
}

.account-card {
  position: relative;
  display: grid;
  gap: 22px;
  width: min(586px, 100%);
  padding: 54px 58px;
  overflow: hidden;
  border: 1px solid rgba(219, 221, 232, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: none;
}

.account-signin-success {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 32px;
  visibility: hidden;
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.99);
  opacity: 0;
  pointer-events: none;
}

.account-signin-success strong { font-size: 22px; }
.account-signin-success span { color: var(--auth-muted); font-size: 14px; }
.account-signin-rings { width: 96px; height: 96px; margin-bottom: 8px; }

.account-signin-ring {
  fill: none;
  stroke: var(--auth-purple);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 99;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.account-login-card.is-authenticated > :not(.account-signin-success) { opacity: 0; }
.account-login-card.is-authenticated .account-signin-success { visibility: visible; opacity: 1; }
.account-login-card.is-authenticated .account-signin-ring {
  animation: account-signin-circle-complete 0.62s ease-out forwards;
}
.account-login-card.is-authenticated .account-signin-ring-middle { animation-delay: 0.1s; }
.account-login-card.is-authenticated .account-signin-ring-inner { animation-delay: 0.2s; }

@keyframes account-signin-circle-complete {
  from { stroke-dashoffset: 99; }
  to { stroke-dashoffset: 0; }
}

.account-card-logo {
  display: block;
  width: 156px;
  height: auto;
  margin: -6px auto 2px;
  object-fit: contain;
}

.account-card-heading { text-align: center; }
.account-card-heading-left { text-align: left; }
.account-card-heading h1,
.account-card header:not(.account-card-heading) h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(28px, 2.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.account-card-heading p,
.account-card header:not(.account-card-heading) p,
.account-help {
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.5;
}

.account-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--auth-purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-field,
.account-card > label {
  display: grid;
  gap: 9px;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 600;
}

.account-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-field-heading a,
.account-signin-link a {
  color: var(--auth-purple);
  font-weight: 700;
  text-decoration: none;
}

.account-field-heading a:hover,
.account-signin-link a:hover { text-decoration: underline; }

.account-field input,
.account-card > label input,
.account-invite-summary b {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0 16px;
  color: var(--auth-ink);
  border: 1px solid #cbd4e6;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  font-size: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.account-field input:focus,
.account-card > label input:focus {
  border-color: var(--auth-purple);
  box-shadow: 0 0 0 3px rgba(109, 44, 255, 0.12);
}

.account-field input[readonly] { color: var(--auth-text); background: #f9faff; }
.account-input-wrap { position: relative; display: block; }

.account-control-icon {
  position: absolute;
  z-index: 1;
  left: 18px;
  top: 50%;
  width: 21px;
  height: 21px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7180a2;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.account-card .account-input-wrap input { padding-left: 54px; }
.account-card .account-input-lock input { padding-right: 58px; }

.account-password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.account-eye-icon {
  position: absolute;
  inset: 8px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #6377a3;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-eye-hide { display: none; }
.account-password-toggle[aria-pressed="true"] .account-eye-show { display: none; }
.account-password-toggle[aria-pressed="true"] .account-eye-hide { display: block; }
.account-password-toggle:hover { background: #f1edff; }

.account-primary,
.account-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 13px 20px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.account-primary {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--auth-purple) 0%, var(--auth-purple-mid) 52%, var(--auth-magenta) 100%);
  box-shadow: none;
}

.account-primary:hover { filter: brightness(1.04); }
.account-secondary { color: var(--auth-ink); border: 1px solid var(--auth-line); background: #fff; }
.account-secondary:hover { color: var(--auth-purple); border-color: #bba7ff; background: #fbfaff; }

.account-action-row {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1fr);
  gap: 14px;
}

.account-primary:focus-visible,
.account-secondary:focus-visible,
.account-password-toggle:focus-visible {
  outline: 3px solid rgba(109, 44, 255, 0.28);
  outline-offset: 2px;
}

/* Permanent brand contract: gradient actions always use a white foreground. */
.account-primary,
.account-primary :where(span, strong, small, i, svg) { color: #fff !important; }
.account-primary svg,
.account-primary svg * { stroke: currentColor !important; }
.account-primary svg [fill]:not([fill="none"]) { fill: currentColor !important; }

.account-error,
.account-success { padding: 14px 16px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.account-error { color: var(--auth-danger); border: 1px solid #f2bcc7; background: #fff3f6; }
.account-success { display: grid; gap: 4px; color: #17613a; border: 1px solid #b9e6c9; background: #f1fcf5; }
.account-success strong { font-size: 15px; }

.account-card-footer {
  display: none;
}

.account-page-footer {
  position: absolute;
  left: clamp(54px, 9vw, 142px);
  bottom: 28px;
  display: flex;
  gap: 16px;
  color: rgba(8, 20, 61, 0.68);
  font-size: 11px;
  font-weight: 600;
}

.account-page-footer-label { color: var(--auth-purple); }
.account-page-footer-label + .account-page-footer-label { padding-left: 16px; border-left: 1px solid rgba(8, 20, 61, 0.18); }

.account-invitation-page .account-shell,
.account-setup-page .account-shell { grid-template-columns: minmax(390px, .82fr) minmax(620px, 1.18fr); }
.account-invite-card { width: min(760px, 100%); gap: 18px; padding: 38px 46px; }
.account-invite-summary { padding: 18px 22px; border: 1px solid #d7cdfc; border-radius: 11px; background: #fbfaff; }
.account-invite-summary > strong { display: block; margin-bottom: 12px; font-size: 15px; }
.account-invite-summary > div { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.account-invite-summary > div > span { display: grid; gap: 7px; min-width: 0; }
.account-invite-summary > div > span + span { padding-left: 20px; border-left: 1px solid #ddd8ed; }
.account-invite-summary small { color: var(--auth-muted); font-size: 12px; }
.account-invite-summary b { display: flex; align-items: center; height: 46px; font-size: 15px; }
.account-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.account-password-note { margin: -6px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.35; }
.account-signin-link { margin: 0; color: var(--auth-text); text-align: center; font-size: 13px; }
.account-recovery-card { width: min(586px, 100%); }
.account-unavailable-card { text-align: center; }

body.account-change-password-page { background: #f7f4ff; }
body.account-change-password-page .account-shell { grid-template-columns: 1fr; }
body.account-change-password-page .account-visual,
body.account-change-password-page .account-page-footer { display: none; }
body.account-change-password-page .account-panel { padding: 40px 24px; }

@media (max-width: 1120px) {
  .account-shell,
  .account-invitation-page .account-shell,
  .account-setup-page .account-shell { grid-template-columns: minmax(320px, .72fr) minmax(440px, 1fr); }
  .account-visual { padding: 100px 44px 90px; }
  .account-visual-copy h1 { font-size: clamp(42px, 5vw, 54px); }
  .account-visual-copy > p { font-size: 16px; }
  .account-panel { padding: 40px 28px 40px 10px; }
  .account-card { padding: 40px; }
  .account-invite-card { padding: 34px; }
  .account-page-footer { left: 44px; }
}

/* Setup forms can exceed short laptop and landscape-tablet viewports. */
@media (max-width: 1120px), (max-height: 760px) {
  .account-invitation-page,
  .account-setup-page { background-attachment: scroll; }

  .account-invitation-page .account-shell,
  .account-setup-page .account-shell {
    display: block;
    min-height: 100dvh;
    padding: 32px 24px;
  }

  .account-invitation-page .account-visual,
  .account-setup-page .account-visual,
  .account-invitation-page .account-page-footer,
  .account-setup-page .account-page-footer { display: none; }

  .account-invitation-page .account-panel,
  .account-setup-page .account-panel {
    display: block;
    padding: 0;
  }

  .account-invitation-page .account-invite-card,
  .account-setup-page .account-invite-card { margin: 0 auto; }
}

/* Keep the complete sign-in composition visible when laptop browser chrome reduces height. */
@media (min-width: 821px) and (max-height: 760px) {
  .account-login-page .account-visual {
    padding: clamp(78px, 13vh, 96px) clamp(44px, 9vw, 142px) 68px;
  }

  .account-login-page .account-visual-copy::before { margin-bottom: 24px; }
  .account-login-page .account-visual-copy h1 {
    font-size: clamp(40px, 4vw, 52px);
    line-height: 1.02;
  }

  .account-login-page .account-visual-copy > p {
    margin-top: 22px;
    font-size: 16px;
    line-height: 1.55;
  }

  .account-login-page .account-panel {
    padding: 24px clamp(32px, 5vw, 72px) 24px 16px;
  }

  .account-login-page .account-login-card {
    gap: 18px;
    padding: 36px 42px;
  }

  .account-login-page .account-card-logo { width: 142px; margin-top: -2px; }
  .account-login-page .account-field input { height: 54px; }
  .account-login-page .account-primary { min-height: 52px; }
  .account-login-page .account-page-footer { bottom: 14px; }
}

@media (max-width: 820px) {
  body.account-body {
    background-attachment: scroll;
    background-position: 68% center;
  }

  .account-shell,
  .account-invitation-page .account-shell,
  .account-setup-page .account-shell {
    position: relative;
    display: block;
    min-height: 100dvh;
    padding: 24px 16px;
  }

  .account-visual,
  .account-page-footer { display: none; }
  .account-panel { display: block; padding: 0; }
  .account-card { margin: 0 auto; padding: 34px 30px; border-radius: 22px; }

  .account-login-page .account-shell {
    display: flex;
    align-items: stretch;
  }

  .account-login-page .account-panel {
    display: flex;
    width: 100%;
    min-height: calc(100dvh - 48px);
  }

  .account-login-page .account-login-card { margin: auto; }
  .account-card-logo { width: 142px; }
  .account-card-heading h1,
  .account-card header:not(.account-card-heading) h1 { font-size: 30px; }
  .account-invite-card { padding: 30px 26px; }
  .account-invite-summary > div,
  .account-form-grid { grid-template-columns: 1fr; gap: 14px; }
  .account-invite-summary > div > span + span { padding: 0; border: 0; }
}

@media (max-width: 480px) {
  body.account-body { background-position: 68% center; }
  .account-shell,
  .account-invitation-page .account-shell,
  .account-setup-page .account-shell { padding: 16px 12px 24px; }
  .account-card { gap: 17px; padding: 28px 20px; border-radius: 18px; }
  .account-login-page .account-panel { min-height: calc(100dvh - 40px); }
  .account-card-logo { width: 126px; margin-top: -2px; }
  .account-card-heading h1,
  .account-card header:not(.account-card-heading) h1 { font-size: 28px; }
  .account-field input,
  .account-card > label input { height: 54px; }
  .account-primary,
  .account-secondary { min-height: 52px; }
  .account-action-row { grid-template-columns: 1fr; }
  .account-field-heading { align-items: baseline; }
  .account-field-heading a { font-size: 13px; }
  .account-invite-summary { padding: 16px; }
}

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