/*
 * corgos-id-button.css — the standard "Sign in with Corgos ID" button (the Corgos ID kit, v1;
 * canonical in auth.git kit/, byte-copied beside corgos-id-mark.svg, never edited in an app).
 *
 * Self-contained: no Cirrus, no font to load, no variable from the page — it looks the same on any
 * page. Light by default; add corgos-id-button--night on a dark ground. A 44px touch target, a focus
 * ring that shows on any ground, the mark drawn from corgos-id-mark.svg beside this file.
 *
 *   <a class="corgos-id-button" href="/auth/login">Sign in with Corgos ID</a>
 *   <button class="corgos-id-button corgos-id-button--night" type="submit">Prijavite se Corgos ID-om</button>
 *
 * Contrast (WCAG 2.2): text 17:1 on either ground; the edge 4.0:1 on white and 4.3:1 on the night
 * ground; the focus ring 4.5:1 on white and 8.2:1 on the night ground.
 */

.corgos-id-button {
  --corgos-id-bg: #ffffff;
  --corgos-id-bg-hover: #f7f2ec;
  --corgos-id-bg-active: #efe6dc;
  --corgos-id-fg: #1f1a16;
  --corgos-id-edge: #8d7c6a;
  --corgos-id-ring: #c2570a;

  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid var(--corgos-id-edge);
  border-radius: 10px;
  background: var(--corgos-id-bg);
  color: var(--corgos-id-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.corgos-id-button::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  background: url("corgos-id-mark.svg") center / contain no-repeat;
}

.corgos-id-button:hover {
  background: var(--corgos-id-bg-hover);
  color: var(--corgos-id-fg);
  text-decoration: none;
}

.corgos-id-button:active {
  background: var(--corgos-id-bg-active);
}

.corgos-id-button:focus-visible {
  outline: 3px solid var(--corgos-id-ring);
  outline-offset: 2px;
}

.corgos-id-button:disabled,
.corgos-id-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* on a dark ground */
.corgos-id-button--night {
  --corgos-id-bg: #1f1a16;
  --corgos-id-bg-hover: #2b251f;
  --corgos-id-bg-active: #362e27;
  --corgos-id-fg: #ffffff;
  --corgos-id-edge: #8d7c6a;
  --corgos-id-ring: #ff9a4d;
}

/* the full width of its column */
.corgos-id-button--wide {
  display: flex;
  width: 100%;
}

@media (forced-colors: active) {
  .corgos-id-button {
    border-color: ButtonText;
  }
  .corgos-id-button:focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .corgos-id-button {
    transition: none;
  }
}
