/* Phase 5: compact authentication and onboarding entry flow. */

body.phase5-entry-flow {
  --entry-red: #b30d16;
  --entry-ink: #211713;
  --entry-muted: #6c594f;
  --entry-line: #ead4c5;
  --entry-soft: #fff8ef;
}

body.phase5-entry-flow.page-auth {
  background: #fffaf3;
}

body.phase5-entry-flow.page-auth .mobile-app-nav,
body.phase5-entry-flow.page-auth .pwa-install-card,
body.phase5-entry-flow.page-auth .site-footer {
  display: none;
}

body.phase5-entry-flow.page-auth .app-main {
  min-height: calc(100svh - 72px);
  display: grid;
  align-items: start;
}

body.phase5-entry-flow.page-auth .auth-wrap,
body.phase5-entry-flow.page-auth .auth-flow-shell {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 32px 18px 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.phase5-entry-flow.page-auth .auth-single,
body.phase5-entry-flow.page-auth .auth-register-single {
  max-width: none;
}

body.phase5-entry-flow.page-auth .auth-card,
body.phase5-entry-flow.page-auth .auth-flow-card {
  width: min(560px, 100%) !important;
  max-width: 560px !important;
  margin-inline: auto;
  padding: 30px;
  border: 1px solid var(--entry-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(73, 37, 24, .09);
}

body.phase5-entry-flow.route-register .auth-card {
  width: min(940px, 100%) !important;
  max-width: 940px !important;
}

body.phase5-entry-flow.page-auth .auth-form-brand {
  display: none !important;
}

body.phase5-entry-flow.page-auth .auth-centered-eyebrow,
body.phase5-entry-flow.page-auth .auth-section-title,
body.phase5-entry-flow.page-auth .auth-flow-card > .eyebrow {
  margin: 0;
  color: var(--entry-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

body.phase5-entry-flow.page-auth .auth-page-title,
body.phase5-entry-flow.page-auth .auth-flow-card h1 {
  margin: 3px 0 0;
  color: var(--entry-ink);
  font-size: 34px !important;
  line-height: 1.12;
  text-align: center;
}

body.phase5-entry-flow.page-auth .auth-page-copy,
body.phase5-entry-flow.page-auth .auth-flow-copy {
  max-width: 520px;
  margin: 0 auto 4px;
  color: var(--entry-muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

body.phase5-entry-flow.page-auth .auth-flow-brand {
  display: none;
}

body.phase5-entry-flow.page-auth .auth-flow-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0;
}

body.phase5-entry-flow.page-auth .auth-card label,
body.phase5-entry-flow.page-auth .auth-flow-card label {
  min-width: 0;
  color: var(--entry-ink);
  font-size: 14px;
  font-weight: 800;
}

body.phase5-entry-flow.page-auth :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 50px !important;
  margin-top: 7px;
  border-color: var(--entry-line);
  border-radius: 8px;
  font-size: 16px;
}

body.phase5-entry-flow.page-auth :is(input, select):focus-visible,
body.phase5-entry-flow.page-auth button:focus-visible,
body.phase5-entry-flow.page-auth a:focus-visible {
  outline: 3px solid rgba(179, 13, 22, .18);
  outline-offset: 2px;
}

body.phase5-entry-flow.page-auth .password-input-wrap {
  margin-top: 7px;
}

body.phase5-entry-flow.page-auth .password-input-wrap input {
  margin-top: 0;
  padding-right: 58px !important;
}

body.phase5-entry-flow.page-auth .password-toggle {
  width: 44px !important;
  height: 44px !important;
  right: 3px !important;
  border-radius: 8px !important;
}

body.phase5-entry-flow.page-auth .auth-login-options {
  align-items: center;
  justify-content: flex-end;
  margin: -2px 0 0;
  font-size: 13px;
}

body.phase5-entry-flow.page-auth .auth-card > .button,
body.phase5-entry-flow.page-auth .auth-flow-card .button {
  min-height: 50px;
}

body.phase5-entry-flow.page-auth .auth-card > p:last-of-type {
  margin: 2px 0 0;
  text-align: center;
}

.auth-entry-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid #f0dfd3;
}

.auth-entry-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: #8e171b;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-entry-links a + a {
  border-left: 1px solid #ead8cc;
}

body.phase5-entry-flow.route-register .register-role-picker {
  display: grid;
  gap: 12px;
  margin: 4px 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.phase5-entry-flow.route-register .register-role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.phase5-entry-flow.route-register .register-role-card {
  min-width: 0;
  min-height: 108px;
  padding: 12px 8px;
  border-radius: 8px;
  box-shadow: none;
}

body.phase5-entry-flow.route-register .register-role-card strong {
  font-size: 14px;
  line-height: 1.2;
}

body.phase5-entry-flow.route-register .role-card-icon {
  width: 46px;
  height: 46px;
}

body.phase5-entry-flow.route-register .provider-role-panel,
body.phase5-entry-flow.route-register .register-plan-panel {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--entry-line);
  border-radius: 8px;
  background: var(--entry-soft);
}

body.phase5-entry-flow.route-register .provider-role-panel[hidden],
body.phase5-entry-flow.route-register .register-plan-panel[hidden] {
  display: none;
}

body.phase5-entry-flow.route-register .provider-type-grid {
  grid-template-columns: 1fr;
}

body.phase5-entry-flow.route-register .register-plan-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.phase5-entry-flow.route-register .register-plan-card {
  min-width: 0;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
}

body.phase5-entry-flow.route-register .register-plan-card span,
body.phase5-entry-flow.route-register .register-plan-card small,
body.phase5-entry-flow.route-register .register-plan-card em {
  overflow-wrap: anywhere;
}

body.phase5-entry-flow.route-register .register-plan-card em {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.4;
}

body.phase5-entry-flow.route-register .register-consent-check {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
}

body.phase5-entry-flow.route-register .register-consent-check input {
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
}

body.phase5-entry-flow.route-onboarding .onboarding-topbar h1 {
  font-size: 34px;
}

body.phase5-entry-flow.route-onboarding :is(.button, .dashboard-side-link, .dashboard-workspace-menu summary, .dashboard-account-menu summary) {
  min-height: 44px;
}

body.phase5-entry-flow.route-onboarding .onboarding-role-label,
body.phase5-entry-flow.route-onboarding .onboarding-progress-ring span,
body.phase5-entry-flow.route-onboarding .onboarding-status-grid small,
body.phase5-entry-flow.route-onboarding .onboarding-step-card small,
body.phase5-entry-flow.route-onboarding .onboarding-step-card em,
body.phase5-entry-flow.route-onboarding .onboarding-quick-grid small,
body.phase5-entry-flow.route-onboarding .onboarding-drawer small,
body.phase5-entry-flow.route-onboarding .dashboard-side-context small {
  font-size: 12px;
  letter-spacing: 0;
}

body.phase5-entry-flow.route-onboarding .onboarding-step-card {
  min-height: 150px;
}

body.phase5-entry-flow.route-onboarding .onboarding-step-number {
  font-size: 12px;
}

body.phase5-entry-flow.route-onboarding .onboarding-quick-grid > a {
  min-height: 100px;
}

@media (max-width: 820px) {
  body.phase5-entry-flow.page-auth .auth-wrap,
  body.phase5-entry-flow.page-auth .auth-flow-shell {
    padding: 20px 14px 32px;
  }

  body.phase5-entry-flow.page-auth .auth-card,
  body.phase5-entry-flow.page-auth .auth-flow-card,
  body.phase5-entry-flow.route-register .auth-card {
    width: min(680px, 100%) !important;
    max-width: 680px !important;
    padding: 24px;
  }

  body.phase5-entry-flow.route-register .register-plan-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(245px, 72vw);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    padding: 2px 2px 10px;
    scrollbar-width: thin;
  }

  body.phase5-entry-flow.route-register .register-plan-card {
    min-height: 154px;
    scroll-snap-align: start;
  }
}

@media (max-width: 560px) {
  body.phase5-entry-flow.page-auth .site-header {
    position: sticky;
    top: 0;
  }

  body.phase5-entry-flow.page-auth .app-main {
    min-height: calc(100svh - 62px);
  }

  body.phase5-entry-flow.page-auth .auth-wrap,
  body.phase5-entry-flow.page-auth .auth-flow-shell {
    padding: 12px 10px 24px;
  }

  body.phase5-entry-flow.page-auth .auth-card,
  body.phase5-entry-flow.page-auth .auth-flow-card,
  body.phase5-entry-flow.route-register .auth-card {
    padding: 20px 16px;
    box-shadow: 0 12px 30px rgba(73, 37, 24, .07);
  }

  body.phase5-entry-flow.page-auth .auth-page-title,
  body.phase5-entry-flow.page-auth .auth-flow-card h1 {
    font-size: 27px !important;
  }

  body.phase5-entry-flow.page-auth .auth-page-copy,
  body.phase5-entry-flow.page-auth .auth-flow-copy {
    font-size: 14px;
  }

  body.phase5-entry-flow.page-auth .auth-login-options {
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    gap: 10px;
  }

  body.phase5-entry-flow.route-register .register-role-grid {
    gap: 6px;
  }

  body.phase5-entry-flow.route-register .register-role-card {
    min-height: 96px;
    padding: 10px 4px;
  }

  body.phase5-entry-flow.route-register .register-role-card strong {
    font-size: 12px;
  }

  body.phase5-entry-flow.route-register .role-card-icon {
    width: 42px;
    height: 42px;
  }

  body.phase5-entry-flow.route-register .provider-role-panel,
  body.phase5-entry-flow.route-register .register-plan-panel {
    padding: 12px;
  }

  body.phase5-entry-flow.route-register .register-plan-grid {
    grid-auto-columns: minmax(235px, 82vw);
  }

  .auth-entry-links a {
    padding-inline: 13px;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-topbar {
    align-items: center;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-topbar .eyebrow {
    display: none;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-topbar h1 {
    font-size: 25px;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-topbar .button {
    min-width: 92px;
    padding-inline: 12px;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-status-grid article {
    min-height: 96px;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-status-grid small {
    max-width: 96px;
  }

  body.phase5-entry-flow.route-onboarding .onboarding-step-track {
    grid-auto-columns: minmax(220px, 76vw);
  }

  body.phase5-entry-flow.route-onboarding .onboarding-step-card {
    min-height: 156px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.phase5-entry-flow * {
    scroll-behavior: auto;
  }
}
