/* HTC Auth Experience Manager 1.0.0. All runtime rules are gated by the
   server-rendered html.htc-auth-experience context class. */

html.htc-auth-experience #UICenter.NoSearch.LoginPage.htc-auth-shell {
  box-sizing: border-box;
  width: 100%;
}

html.htc-auth-experience.htc-auth-custom-image #UICenter.NoSearch.LoginPage,
html.htc-auth-experience #UICenter.NoSearch.LoginPage.slideshow-enabled {
  display: flex;
}

html.htc-auth-experience #login-slideshow {
  min-width: 0;
  background-color: var(--htc-auth-visual-background, #e9e9e9);
  background-repeat: no-repeat;
}

html.htc-auth-experience.htc-auth-custom-image #login-slideshow {
  position: relative;
  flex: 1 1 auto;
  min-height: 100%;
}

html.htc-auth-experience.htc-auth-custom-image #UICenter.NoSearch.LoginPage:not(.slideshow-enabled) > #CentralSpaceLogin {
  width: 434px;
  margin: 0;
  padding: var(--space-48, 48px) 120px;
  overflow-y: auto;
}

html.htc-auth-experience.htc-auth-custom-image #login-slideshow .login-slide {
  display: none;
}

html.htc-auth-experience #CentralSpaceLogin {
  min-width: 0;
}

html.htc-auth-experience .htc-auth-confirmation {
  box-sizing: border-box;
  width: 100%;
  margin: var(--space-24, 24px) 0 0;
  padding: var(--space-32, 32px);
  border-radius: 4px;
  background: #fff;
}

html.htc-auth-experience .htc-auth-confirmation h1 {
  margin-top: 0;
}

/* done.php adds CentralSpaceContainer between UICenter and the login shell.
   Mirror ResourceSpace's direct-child slideshow geometry for this one strictly
   allowlisted context so the confirmation card and visual remain side by side. */
@media (min-width: 769px) {
  html.htc-auth-experience.htc-auth-context-confirmation #UICenter.NoSearch.LoginPage.slideshow-enabled > #CentralSpaceContainer {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    margin: 0;
  }

  html.htc-auth-experience.htc-auth-context-confirmation #CentralSpaceContainer > #CentralSpaceLogin {
    width: 434px;
    margin: 0;
    padding: var(--space-48, 48px) 120px;
    overflow-y: auto;
  }

  html.htc-auth-experience.htc-auth-context-confirmation #CentralSpaceContainer > #login-slideshow {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100%;
  }
}

/* Colour-only overrides: geometry remains owned by ResourceSpace/HTC. */
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="submit"],
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="button"],
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin button,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin .Button {
  background-color: var(--htc-auth-brand);
  border-color: var(--htc-auth-brand);
  color: var(--htc-auth-brand-foreground);
}

html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="submit"]:hover,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="button"]:hover,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin button:hover,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin .Button:hover {
  background-color: var(--htc-auth-brand-hover);
  border-color: var(--htc-auth-brand-hover);
  color: var(--htc-auth-brand-foreground);
}

html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="submit"]:active,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin input[type="button"]:active,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin button:active,
html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin .Button:active {
  background-color: var(--htc-auth-brand-active);
  border-color: var(--htc-auth-brand-active);
}

html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin a {
  color: var(--htc-auth-brand-link);
}

html.htc-auth-experience.htc-auth-custom-colour #CentralSpaceLogin :is(a, input, button, select, textarea):focus-visible {
  outline-color: var(--htc-auth-brand-focus);
}

.htc-auth-setup-page {
  max-width: 1100px;
}

.htc-auth-setup-page .htc-auth-status,
.htc-auth-setup-page .htc-auth-message {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid #003945;
  border-radius: 4px;
  background: #f4f8f8;
}

.htc-auth-setup-page .htc-auth-error {
  border-left-color: #bf0c12;
  background: #fff8f7;
}

.htc-auth-setup-page .htc-auth-preview {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 18px 0;
}

.htc-auth-setup-page .htc-auth-preview-image {
  box-sizing: border-box;
  width: 100%;
  min-height: 200px;
  border: 1px solid rgba(0, 57, 69, 0.2);
  border-radius: 6px;
  background-color: var(--htc-auth-preview-background, #e9e9e9);
  background-repeat: no-repeat;
  background-position: var(--htc-auth-preview-position, center center);
  background-size: var(--htc-auth-preview-size, contain);
}

.htc-auth-setup-page .htc-auth-preview-empty {
  display: grid;
  place-items: center;
  color: #4c5759;
}

.htc-auth-setup-page .htc-auth-summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
}

.htc-auth-setup-page .htc-auth-summary dt {
  font-weight: 700;
}

.htc-auth-setup-page .htc-auth-summary dd {
  margin: 0;
}

.htc-auth-setup-page fieldset {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid rgba(0, 57, 69, 0.18);
  border-radius: 8px;
}

.htc-auth-setup-page legend {
  padding: 0 6px;
  font-weight: 700;
}

.htc-auth-setup-page .htc-auth-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 18px;
}

.htc-auth-setup-page .htc-auth-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.htc-auth-setup-page .htc-auth-brand-preview {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--htc-auth-preview-brand, #003945);
  border-radius: 4px;
  background: var(--htc-auth-preview-brand, #003945);
  color: var(--htc-auth-preview-foreground, #fff);
  font-weight: 500;
}

@media (max-width: 700px) {
  .htc-auth-setup-page .htc-auth-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1366px) and (min-width: 769px) {
  html.htc-auth-experience.htc-auth-custom-image #UICenter.NoSearch.LoginPage:not(.slideshow-enabled) > #CentralSpaceLogin {
    padding-right: var(--space-32, 32px);
    padding-left: var(--space-32, 32px);
  }

  html.htc-auth-experience.htc-auth-context-confirmation #CentralSpaceContainer > #CentralSpaceLogin {
    padding-right: var(--space-32, 32px);
    padding-left: var(--space-32, 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.htc-auth-experience .login-slide {
    transition: none;
  }
}
