/* Shared visual shell for the unauthenticated Coach journey. */
body.auth-shell-page {
  --auth-shell-max-width: var(--app-content-width-auth);
  --auth-shell-gutter: clamp(14px, 4vw, 28px);
  --auth-shell-card-padding: clamp(22px, 5vw, 34px);
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(var(--app-color-sage-rgb, 149, 174, 160), .18), transparent 32rem),
    var(--app-shell-bg);
  color: var(--app-text-primary);
  font-family: var(--font-family-base);
}

.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(var(--app-color-primary-rgb), .09);
  background: var(--app-shell-header-bg);
  box-shadow: var(--app-shadow-header);
}

.auth-topbar__inner {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  width: 100%;
  height: var(--app-header-height);
  padding-inline: max(var(--app-space-4), env(safe-area-inset-left));
}

.auth-brand-link {
  grid-column: 2;
  color: var(--app-color-primary);
  font-size: 1.08rem;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.auth-back-link {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: var(--app-touch-target);
  padding-inline: var(--app-space-3);
  border: 0;
  border-radius: var(--app-radius-pill);
  background: var(--app-color-sage-soft);
  color: var(--app-color-primary-active);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.auth-topbar a:focus-visible {
  outline: 2px solid var(--app-focus-color);
  outline-offset: 2px;
}

.auth-shell-main {
  box-sizing: border-box;
  width: 100%;
  min-height: calc(100svh - var(--app-header-height) - env(safe-area-inset-top));
  min-height: calc(100dvh - var(--app-header-height) - env(safe-area-inset-top));
  padding: clamp(22px, 6vh, 56px) var(--auth-shell-gutter) max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--auth-shell-max-width);
  padding: var(--auth-shell-card-padding);
  overflow: hidden;
  border: 1px solid rgba(var(--app-color-primary-rgb, 54, 89, 69), .11);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 46px rgba(31, 41, 55, .09);
}

.auth-shell-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--app-color-sage, #95aea0);
}

.auth-card__eyebrow {
  margin: 0 0 6px;
  color: var(--app-text-muted, #6b7280);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .055em;
  text-align: center;
  text-transform: uppercase;
}

.auth-card h1,
.reset-password-title,
.action-status-title,
.auth-shell-page .bridge-title {
  color: var(--app-color-primary-active, #244130);
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.reset-password-input {
  min-height: 48px;
  padding: 11px 13px;
  border-color: var(--app-border-control, #d1d5db);
  border-radius: var(--app-control-radius, 12px);
  background: var(--app-surface-bg, #fff);
}

.auth-card input:focus,
.reset-password-input:focus {
  outline: none;
  border-color: var(--app-color-primary, #365945);
  box-shadow: var(--app-control-focus-ring, 0 0 0 3px rgba(var(--app-color-primary-rgb, 54, 89, 69), .12));
}

.auth-card #submitBtn,
.reset-password-submit,
.action-status-button {
  min-height: 48px;
  border-radius: var(--app-control-radius, 12px);
  font-weight: 600;
  box-shadow: none;
}

.auth-card .pw-toggle,
.reset-password-toggle {
  width: 44px;
  height: 44px;
  right: 2px;
  padding: 0;
  border-radius: 10px;
}

.auth-card .toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  border-radius: 10px;
}

.auth-card .toggle:hover {
  background: var(--app-color-sage-soft, rgba(149, 174, 160, .16));
}

.auth-card .auth-pilot-note,
.auth-card .auth-legal-note,
.auth-card .status-tray,
.reset-password-status,
.reset-password-error,
.auth-shell-page .bridge-error {
  border-radius: 10px;
}

.action-page-body {
  --auth-shell-max-width: 560px;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.action-page-main {
  flex: 1;
  min-height: calc(100svh - var(--app-header-height) - env(safe-area-inset-top));
}

.action-status-card {
  align-items: stretch;
  gap: 12px;
}

.action-status-button {
  align-self: flex-start;
  min-width: 140px;
}

.auth-shell-page .bridge-card {
  --auth-shell-max-width: 520px;
  text-align: center;
}

.auth-shell-page .bridge-actions a {
  min-height: 44px;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  body.auth-shell-page {
    --auth-shell-card-padding: 22px 18px;
  }

  .auth-topbar__inner {
    grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
    padding-inline: 12px;
  }

  .auth-back-link {
    padding-inline: 8px;
  }

  .auth-shell-main {
    align-items: safe center;
    padding-block: 20px max(20px, env(safe-area-inset-bottom));
  }

  .auth-shell-card {
    border-radius: 15px;
  }

  .auth-card .options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .auth-card .options a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-align: left;
  }

  .action-status-button {
    width: 100%;
  }
}

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