/* KHGC public welcome and authentication pages. */
:root {
  --khgc-blue: #1f6feb;
}

.khgc-home,
.khgc-signin {
  display: grid;
  width: 100%;
  min-height: calc(100vh - 96px);
  padding: 48px 24px;
  place-items: center;
}

.khgc-welcome {
  width: min(720px, 100%);
}

.khgc-welcome-brand {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-bottom: 28px;
}

.khgc-welcome-brand img,
.khgc-auth-brand img {
  display: block;
  flex: 0 0 auto;
}

.khgc-welcome h1,
.khgc-auth-brand h1 {
  margin: 0;
  color: var(--color-text);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.khgc-welcome h1 {
  font-size: 30px;
}

.khgc-welcome-brand p,
.khgc-auth-brand p {
  margin: 5px 0 0;
  color: var(--color-text-light);
  font-size: 14px;
  line-height: 1.5;
}

.khgc-access-row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.khgc-access-row strong,
.khgc-access-row span {
  display: block;
}

.khgc-access-row strong {
  color: var(--color-text);
  font-size: 15px;
}

.khgc-access-row span {
  margin-top: 4px;
  color: var(--color-text-light);
  font-size: 13px;
}

.ui.primary.button.khgc-signin-button,
.khgc-signin .ui.primary.button {
  min-height: 44px;
  border: 1px solid var(--khgc-blue);
  border-radius: 5px;
  background: var(--khgc-blue);
  color: #fff !important;
  font-weight: 650;
  box-shadow: none;
}

.ui.primary.button.khgc-signin-button {
  min-width: 112px;
}

.ui.primary.button.khgc-signin-button:hover,
.ui.primary.button.khgc-signin-button:focus-visible,
.khgc-signin .ui.primary.button:hover,
.khgc-signin .ui.primary.button:focus-visible {
  border-color: #388bfd;
  background: #1158c7;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.28);
}

.khgc-service-details {
  margin: 0;
}

.khgc-service-details > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  line-height: 1.45;
}

.khgc-service-details dt {
  color: var(--color-text-light);
}

.khgc-service-details dd {
  margin: 0;
  color: var(--color-text);
}

.khgc-auth-container {
  width: min(420px, 100%);
}

.khgc-auth-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.khgc-auth-brand a {
  display: block;
}

.khgc-auth-brand h1 {
  font-size: 22px;
}

.khgc-auth-panel {
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-box-body);
}

.khgc-signin .khgc-auth-panel > .ui.container,
.khgc-signin .khgc-auth-panel .tw-max-w-2xl {
  max-width: none !important;
}

.khgc-signin .ui.top.attached.header {
  padding: 0 0 16px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 19px;
  font-weight: 650;
  text-align: left;
}

.khgc-signin .ui.attached.segment {
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.khgc-signin .ui.form input:not([type="checkbox"]) {
  min-height: 44px;
  border-color: var(--color-border) !important;
  border-radius: 5px;
  background: var(--color-input-background, var(--color-body));
  box-shadow: none !important;
}

.khgc-signin .ui.form input:not([type="checkbox"]):focus {
  border-color: #58a6ff !important;
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.2) !important;
}

.khgc-signin .required.field > .tw-flex > label::after {
  margin-left: 0.25em;
  color: var(--color-red);
  content: "*";
}

.khgc-signin .ui.button,
.khgc-signin .signin-passkey {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 5px;
  font-weight: 650;
}

.khgc-signin .signin-passkey {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
}

.khgc-signin .ui.checkbox label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.khgc-signin a[href*="forgot_password"] {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.khgc-signin .divider.divider-text {
  margin-block: 18px;
}

.khgc-auth-note {
  margin: 14px 0 0;
  color: var(--color-text-light);
  font-size: 12px;
  text-align: center;
}

body:has(.khgc-home) #navbar .navbar-right > a[href*="/user/login"],
body:has(.khgc-signin) #navbar .navbar-right > a[href*="/user/login"] {
  display: none;
}

body:has(.khgc-home) .page-footer,
body:has(.khgc-signin) .page-footer {
  justify-content: center;
  min-height: 52px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

body:has(.khgc-home) .page-footer .left-links,
body:has(.khgc-signin) .page-footer .left-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 600px) {
  .khgc-home,
  .khgc-signin {
    min-height: 0;
    padding: 40px 20px;
  }

  .khgc-welcome-brand {
    padding-bottom: 24px;
  }

  .khgc-access-row {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .ui.primary.button.khgc-signin-button {
    width: 100%;
  }

  .khgc-service-details > div {
    grid-template-columns: 84px 1fr;
    gap: 14px;
  }

  .khgc-auth-panel {
    padding: 20px;
  }

  body:has(.khgc-home) #navbar-expand-toggle,
  body:has(.khgc-signin) #navbar-expand-toggle {
    min-width: 44px;
    min-height: 44px;
    margin-right: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .khgc-home *,
  .khgc-signin * {
    transition: none !important;
  }
}
