/* FlowStack auth shell canonical CSS. Load after app-local auth CSS. */
@media (max-height: 760px) {
  body[data-flowstack-shell][data-page="login"] .auth-shell {
    align-items: safe center;
    align-content: safe center;
    justify-content: center;
    justify-items: center;
  }
}

@media (orientation: landscape) and (min-width: 760px) and (max-height: 760px) {
  body[data-flowstack-shell][data-page="login"] .auth-card {
    display: grid;
    grid-template-areas:
      "brand form"
      "eyebrow form"
      "title form"
      "lede divider"
      "footer sso";
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1fr);
    gap: 6px 18px;
    align-items: start;
    width: min(calc(100vw - 24px), 960px);
    max-width: 960px;
    padding: 12px 16px;
    overflow: visible;
  }

  body[data-flowstack-shell][data-page="login"] .auth-brand {
    grid-area: brand;
    margin-bottom: 8px;
  }

  body[data-flowstack-shell][data-page="login"] .eyebrow {
    grid-area: eyebrow;
  }

  body[data-flowstack-shell][data-page="login"] .auth-card h1 {
    grid-area: title;
    font-size: 1.45rem;
  }

  body[data-flowstack-shell][data-page="login"] .page-lede {
    grid-area: lede;
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  body[data-flowstack-shell][data-page="login"] .auth-form {
    grid-area: form;
    gap: 7px 10px;
    margin-top: 0;
  }

  body[data-flowstack-shell][data-page="login"] .auth-divider {
    grid-area: divider;
    margin-top: 0;
  }

  body[data-flowstack-shell][data-page="login"] .auth-sso-actions {
    grid-area: sso;
    gap: 7px 10px;
    margin-top: 0;
  }

  body[data-flowstack-shell][data-page="login"] .auth-footer {
    grid-area: footer;
    align-self: end;
    margin-top: 8px;
  }

  body[data-flowstack-shell][data-page="login"] .page-message,
  body[data-flowstack-shell][data-page="login"] .auth-guidance {
    grid-column: 1 / -1;
  }

  body[data-flowstack-shell][data-page="login"] .auth-sso-actions .sso-help {
    display: none !important;
  }

  body[data-flowstack-shell][data-page="login"] .auth-brand img {
    width: 32px;
    height: 32px;
  }

  body[data-flowstack-shell][data-page="login"] .auth-brand p {
    font-size: 0.94rem;
  }

  body[data-flowstack-shell][data-page="login"] .auth-brand span {
    font-size: 0.7rem;
  }

  body[data-flowstack-shell][data-page="login"] .form-field {
    gap: 4px;
  }

  body[data-flowstack-shell][data-page="login"] .form-field label,
  body[data-flowstack-shell][data-page="login"] .sso-label {
    font-size: 0.82rem;
    line-height: 1.15;
  }

  body[data-flowstack-shell][data-page="login"] .form-field input {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body[data-flowstack-shell][data-page="login"] .auth-form .form-actions button {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  body[data-flowstack-shell][data-page="login"] .google-identity-button {
    min-height: 36px;
  }
}

body[data-flowstack-shell][data-page="request-access"] .auth-shell {
  align-items: safe center;
}

body[data-flowstack-shell][data-page="request-access"] .auth-card,
body[data-flowstack-shell][data-page="request-access"] .auth-card-wide {
  width: min(100%, 640px);
}

body[data-flowstack-shell][data-page="request-access"] .auth-next-steps {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-radius-md);
  background: var(--fs-bg-panel-muted);
}

body[data-flowstack-shell][data-page="request-access"] .auth-next-steps h2 {
  margin: 0 0 8px;
  color: var(--fs-text-strong);
  font-size: 0.95rem;
  line-height: 1.25;
}

body[data-flowstack-shell][data-page="request-access"] .auth-next-steps ol {
  margin: 0;
  padding-left: 20px;
  color: var(--fs-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

body[data-flowstack-shell][data-page="request-access"] .workspace-request-field {
  display: grid;
  gap: 6px;
}

body[data-flowstack-shell][data-page="request-access"] .workspace-request-field > label,
body[data-flowstack-shell][data-page="request-access"] .workspace-request-field > .field-help {
  margin: 0;
}

body[data-flowstack-shell][data-page="request-access"] .workspace-request-field > label {
  line-height: 1.25;
  white-space: nowrap;
}

body[data-flowstack-shell][data-page="request-access"] .workspace-request-inline {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 190px);
  gap: 12px;
  align-items: start;
}

body[data-flowstack-shell][data-page="request-access"] .workspace-request-inline:not(:has(.workspace-request-field:not([hidden]))) {
  display: none;
}

body[data-flowstack-shell][data-page="request-access"] .auth-choice-group[hidden],
body[data-flowstack-shell][data-page="request-access"] .workspace-request-field[hidden],
body[data-flowstack-shell][data-page="request-access"] .form-field[hidden] {
  display: none !important;
}

body[data-flowstack-shell][data-page="request-access"] .field-help {
  margin: 7px 0 0;
  color: var(--fs-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 520px) {
  body[data-flowstack-shell][data-page="request-access"] .workspace-request-inline {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (min-width: 760px) and (max-height: 760px) {
  body[data-flowstack-shell][data-page="request-access"] .auth-card {
    display: grid;
    grid-template-areas:
      "brand form"
      "eyebrow form"
      "title form"
      "lede form"
      "steps form"
      "footer form";
    grid-template-columns: minmax(240px, 0.85fr) minmax(360px, 1fr);
    gap: 6px 18px;
    align-content: start;
    align-items: start;
    width: min(calc(100vw - 24px), 960px);
    max-width: 960px;
    padding: 12px 16px;
    overflow: visible;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-brand {
    grid-area: brand;
    margin-bottom: 8px;
  }

  body[data-flowstack-shell][data-page="request-access"] .eyebrow {
    grid-area: eyebrow;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-card h1 {
    grid-area: title;
    font-size: 1.45rem;
  }

  body[data-flowstack-shell][data-page="request-access"] .page-lede {
    grid-area: lede;
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-next-steps {
    grid-area: steps;
    margin-top: -14px;
    padding: 10px 12px;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-next-steps h2 {
    font-size: 0.9rem;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-next-steps ol {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.3;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-form {
    grid-area: form;
    gap: 7px 10px;
    margin-top: 0;
  }

  body[data-flowstack-shell][data-page="request-access"] .auth-footer {
    grid-area: footer;
    align-self: end;
    margin-top: 8px;
  }
}

@media (max-height: 760px) {
  #auth-view.auth-shell {
    align-content: safe center;
    justify-content: center;
  }
}

@media (orientation: landscape) and (min-width: 760px) and (max-height: 760px) {
  #auth-view {
    width: min(100%, 960px);
  }

  #auth-view > .auth-card {
    display: grid;
    grid-template-areas:
      "brand form"
      "eyebrow form"
      "title form"
      "lede form"
      "status status";
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1fr);
    gap: 6px 18px;
    align-items: start;
    width: min(calc(100vw - 24px), 960px);
    max-width: 960px;
    padding: 12px 16px;
    overflow: visible;
  }

  #auth-view .auth-brand {
    grid-area: brand;
    margin-bottom: 8px;
  }

  #auth-view .eyebrow {
    grid-area: eyebrow;
  }

  #auth-heading {
    grid-area: title;
    font-size: 1.45rem;
  }

  #auth-description {
    grid-area: lede;
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.25;
  }

  #setup-panel,
  #login-panel {
    grid-area: form;
  }

  #auth-status {
    grid-area: status;
    margin-top: 8px;
  }

  #auth-view .auth-brand img {
    width: 32px;
    height: 32px;
  }

  #auth-view .auth-brand p {
    font-size: 0.94rem;
  }

  #auth-view .auth-brand span {
    font-size: 0.7rem;
  }

  #auth-view .form-field {
    gap: 4px;
  }

  #auth-view .form-field label {
    font-size: 0.82rem;
    line-height: 1.15;
  }

  #auth-view .form-field input {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #auth-view .auth-form .form-actions button {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}
