/* Auth pages — Missional Agents branding */
:root {
  --ink: var(--ma-text);
  --ink2: var(--ma-navy-dark);
  --muted: var(--ma-muted);
  --canvas: var(--ma-canvas);
  --surface: var(--ma-surface);
  --line: var(--ma-line);
  --line2: #f0f0f0;
  --primary: var(--ma-navy);
  --primary-hover: var(--ma-navy-hover);
  --accent: var(--ma-orange);
  --accent-gradient: var(--ma-orange-gradient);
  --gold: var(--ma-orange);
  --gold-tint: var(--ma-cream);
  --green: var(--ma-green);
  --green-tint: var(--ma-green-tint);
  --red: var(--ma-red);
  --red-tint: var(--ma-red-tint);
  --tint: var(--ma-cream);
  --shadow: var(--ma-shadow);
  --r: var(--ma-radius);
  --display: var(--ma-display);
  --body: var(--ma-body);
  --mono: var(--ma-mono);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: var(--body);
  color: var(--ink);
  background: var(--canvas);
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    display: none;
  }
}

.auth-panel {
  position: relative;
  padding: 48px 56px;
  background: linear-gradient(145deg, var(--ma-navy) 0%, var(--ma-navy-dark) 55%, #041829 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 191, 66, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.auth-panel-inner {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
}

.auth-brand-mark {
  display: none;
}

.auth-panel h1 em {
  font-style: italic;
  color: var(--ma-peach);
}

.auth-preview-doc .hl {
  background: rgba(255, 191, 66, 0.28);
  border-bottom: 2px solid var(--ma-orange);
  padding: 0 3px;
}

.auth-trust-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ma-orange);
  margin-top: 7px;
  flex-shrink: 0;
}

.auth-panel h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 500;
  line-height: 1.12;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}

.auth-panel-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 38ch;
  margin: 0 0 32px;
}

.auth-trust {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.auth-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.auth-preview-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 20px 22px;
  backdrop-filter: blur(8px);
}

.auth-preview-cap {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.auth-preview-doc {
  margin-top: 10px;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 36px 32px;
  box-sizing: border-box;
}

.auth-card-top {
  margin-bottom: 28px;
}

.auth-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.auth-card h2 {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.auth-card-sub {
  color: var(--ink2);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

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

.auth-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: var(--ma-navy);
  box-shadow: 0 0 0 3px rgba(7, 35, 68, 0.12);
}

.auth-input.has-toggle {
  padding-right: 44px;
}

.auth-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.auth-toggle-pw:hover {
  color: var(--primary);
  background: var(--tint);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--red-tint);
  border: 1px solid rgba(179, 58, 58, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--red);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 18px;
}

.auth-error-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px 22px;
  border-radius: 999px;
  border: none;
  background: var(--accent-gradient);
  color: var(--ma-navy);
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.05s, opacity 0.15s, filter 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.2;
  min-height: 48px;
}

a.auth-submit,
a.auth-submit:visited {
  text-decoration: none;
  color: var(--ma-navy);
}

a.auth-submit:hover {
  filter: brightness(0.97);
  text-decoration: none;
  color: var(--ma-navy);
}

a.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(0.97);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(7, 35, 68, 0.25);
  border-top-color: var(--ma-navy);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.auth-label-row label {
  margin-bottom: 0;
}

.auth-text-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--ma-orange);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.auth-text-link:hover {
  text-decoration: underline;
}

.auth-text-link-block {
  display: inline-block;
}

.auth-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--green-tint);
  border: 1px solid rgba(47, 122, 76, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--green);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 18px;
}

.auth-success-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.auth-inline-link {
  color: var(--green);
  font-weight: 600;
}

.auth-footer-spaced {
  margin-top: 20px;
}

.auth-page-single {
  grid-template-columns: 1fr;
}

.auth-page-single .auth-main {
  min-height: 100vh;
}

.auth-footer {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink2);
  margin: 0;
}

.auth-footer a {
  color: var(--ma-navy);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 500;
}

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

.auth-mobile-brand {
  display: none;
  align-items: center;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .auth-mobile-brand {
    display: flex;
  }
}

/* Invitation accept page */
.auth-invite-card {
  max-width: 460px;
}

.auth-invite-card-invalid {
  text-align: center;
  padding-top: 42px;
  padding-bottom: 40px;
}

.auth-invite-state-invalid .auth-invite-state-copy {
  margin-bottom: 18px;
}

.auth-invite-state-invalid .auth-invite-state-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  border-radius: 22px;
}

.auth-invite-state-invalid .auth-invite-state-icon svg {
  width: 34px;
  height: 34px;
}

.auth-invite-note {
  width: 100%;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  border-radius: 0 10px 10px 0;
  background: #fff;
  color: var(--ink2);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
  box-sizing: border-box;
}

.auth-invite-steps {
  width: 100%;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 16px 18px 16px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, var(--tint) 160%);
  text-align: left;
  box-sizing: border-box;
  min-width: 0;
}

.auth-invite-steps li {
  color: var(--ink2);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-invite-steps li + li {
  margin-top: 12px;
}

.auth-invite-steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.88rem;
}

.auth-invite-state {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.auth-invite-state-copy {
  width: 100%;
  text-align: center;
  margin-bottom: 22px;
}

.auth-invite-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  align-self: center;
}

.auth-invite-state-icon-loading {
  background: var(--tint);
  color: var(--primary);
}

.auth-invite-state-icon-invalid {
  background: var(--red-tint);
  color: var(--red);
}

.auth-invite-state-icon-valid {
  background: linear-gradient(180deg, rgba(255, 191, 66, 0.18) 0%, var(--tint) 100%);
  color: var(--ma-navy);
}

.auth-invite-alert {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.auth-invite-alert-error {
  background: var(--red-tint);
  border: 1px solid rgba(179, 58, 58, 0.18);
}

.auth-invite-alert-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
}

.auth-invite-alert p {
  margin: 0;
  color: #8f2f2f;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-invite-actions {
  width: 100%;
  align-self: stretch;
}

.auth-invite-actions .auth-submit {
  margin-top: 0;
}

.auth-invite-action-primary {
  text-decoration: none;
}

.auth-invite-help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-invite-summary {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--tint) 140%);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.auth-invite-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}

.auth-invite-summary-row + .auth-invite-summary-row {
  border-top: 1px solid var(--line2);
  margin-top: 4px;
  padding-top: 10px;
}

.auth-invite-summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-invite-summary-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink2);
  text-align: right;
  word-break: break-word;
}

.auth-invite-password-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.auth-invite-password-rules li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.auth-invite-password-rules li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #d5d9de;
}

.auth-invite-password-rules li.is-met {
  color: var(--green);
}

.auth-invite-password-rules li.is-met::before {
  background: var(--green);
}

/* Login screen — matches the Missional Agents sign-in design */
.auth-login {
  background: #f3f8fc;
  grid-template-columns: 55.7% 44.3%;
}

.auth-login .auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 32px 22px 36px;
  background: linear-gradient(180deg, #012d50 0%, #012d50 72%, #00203f 100%);
  overflow: hidden;
}

.auth-login .auth-panel::before {
  display: none;
}

.auth-login .auth-hero-art {
  position: absolute;
  right: -1%;
  top: 16%;
  width: 46%;
  height: auto;
  z-index: 0;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%);
}

.auth-login .auth-panel-inner {
  position: relative;
  z-index: 2;
  max-width: 58%;
}

.auth-login .auth-panel-inner,
.auth-login .auth-preview-card {
  position: relative;
  z-index: 2;
}

.auth-login .auth-login-logo {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.auth-login .auth-login-logo-sm {
  height: 32px;
  filter: none;
}

.auth-login .auth-panel h1 {
  margin: 22px 0 10px;
  max-width: none;
  font-family: var(--body);
  font-size: clamp(1.9rem, 2.5vw, 2.45rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.auth-login .auth-panel h1 span {
  color: #f5a623;
}

.auth-login .auth-panel-lede {
  max-width: 36ch;
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.auth-login .auth-trust {
  gap: 16px;
  max-width: 460px;
  margin-top: 22px;
}

.auth-login .auth-trust-item {
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(214, 226, 240, 0.88);
}

.auth-login .auth-trust-item::before {
  display: none;
}

.auth-login .auth-trust-item img {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: contain;
}

.auth-login .auth-trust-item strong {
  display: block;
  color: #fff;
  font-weight: 700;
}

.auth-login .auth-preview-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px 14px;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #021a36;
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 2;
}

.auth-login .auth-preview-spark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.auth-login .auth-preview-cap {
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  color: #9eb4d4;
  letter-spacing: 0.08em;
}

.auth-login .auth-preview-doc {
  margin: 0;
  font-family: var(--body);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-login .auth-preview-doc .hl {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 8px;
  border: 0;
  border-radius: 999px;
  background: #f5a623;
  color: #1a1204;
  font-weight: 700;
}

.auth-login .auth-main {
  position: relative;
  overflow: hidden;
  background: #f3f8fc;
}

.auth-login .auth-main::before,
.auth-login .auth-main::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-login .auth-main::before {
  inset: 0;
  background:
    radial-gradient(240px 160px at 96% 6%, rgba(214, 228, 240, 0.95), transparent 70%),
    radial-gradient(320px 180px at 0% 108%, rgba(206, 222, 236, 0.9), transparent 68%),
    radial-gradient(280px 150px at 108% 96%, rgba(210, 226, 240, 0.75), transparent 70%);
}

.auth-login .auth-main::after {
  right: 28px;
  bottom: 28px;
  width: 96px;
  height: 76px;
  background-image: radial-gradient(circle, #c5d4e4 1.4px, transparent 1.6px);
  background-size: 16px 16px;
}

.auth-login .auth-card {
  position: relative;
  z-index: 1;
  max-width: 440px;
  padding: 36px 36px 28px;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 22px 50px rgba(7, 35, 68, 0.1);
}

.auth-login .auth-eyebrow {
  color: #6d7f93;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.auth-login .auth-card h2 {
  font-family: var(--body);
  font-size: 2rem;
  font-weight: 750;
  color: #0c2340;
}

.auth-login .auth-card-sub {
  color: #5c6b7b;
  font-size: 0.92rem;
}

.auth-login .auth-field label {
  color: #0c2340;
}

.auth-login .auth-toggle-pw {
  color: #1d4e89;
  font-weight: 650;
}

.auth-login .auth-footer {
  text-align: center;
}

.auth-login .auth-input.has-icon {
  padding-left: 42px;
}

.auth-login .auth-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  display: flex;
  color: #8b97a8;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-login .auth-input {
  min-height: 48px;
  border-radius: 12px;
  border-color: #d7dee8;
  background: #fbfcfe;
}

.auth-login .auth-text-link {
  color: #e08d2b;
  font-weight: 650;
}

.auth-login .auth-submit {
  min-height: 50px;
  margin-top: 8px;
  border-radius: 999px;
  background: #f5a623;
  color: #10233f;
  font-size: 1.02rem;
  font-weight: 700;
}

.auth-login .auth-submit span {
  letter-spacing: 0.12em;
  font-weight: 500;
  color: rgba(16, 35, 63, 0.55);
}

.auth-login .auth-inline-link,
.auth-login .auth-footer a {
  color: #1d4e89;
}

@media (max-width: 1200px) {
  .auth-login .auth-panel-inner {
    max-width: 62%;
  }

  .auth-login .auth-hero-art {
    width: 42%;
    top: 18%;
    right: 0;
  }
}

@media (max-width: 1100px) {
  .auth-login .auth-preview-card {
    grid-template-columns: auto 1fr;
  }

  .auth-login .auth-preview-cap {
    display: none;
  }
}

@media (max-width: 900px) {
  .auth-login .auth-panel {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-invite-password-rules {
    grid-template-columns: 1fr;
  }

  .auth-invite-summary-row {
    flex-direction: column;
    gap: 4px;
  }

  .auth-invite-summary-value {
    text-align: left;
  }
}
