/* forge-git sign-in page — BlueForge branding + cleanup.
   Scoped to .page-content.user.signin so no other page is touched.
   Deployed as /data/gitea/custom/public/assets/css/forge-signin.css,
   linked from the custom header template. Palette: federation navy +
   the web app's primary blue; AA contrast on every text/background pair.
   v2: layout fix — the container is a centered COLUMN (the ::before/::after
   are flex siblings and were squeezing the card as a row); logo swap via
   background-image (content:url() on an <img> is unreliable); navy on the
   page shell so no white band shows below the hero. */

:root {
  --bf-navy: #0b1220;
  --bf-navy-2: #111a2e;
  --bf-ink: #e8edf6;
  --bf-ink-dim: #b9c4d8;
  --bf-accent: #4d8dff;
}

/* Page shell: navy behind everything the page can reveal. */
body {
  background: var(--bf-navy);
}
.full.height {
  min-height: 100vh;
  background: var(--bf-navy);
}

/* Brand: replace the Gitea cup with the BlueForge mark. content:url() on an
   <img> does not render reliably — hide the img and paint the logo as the
   link's background instead (asset: /assets/img/blueforge-logo.webp). */
#navbar .navbar-logo img[src="/assets/img/logo.svg"] {
  visibility: hidden;
  width: 32px;
  height: 32px;
}
#navbar .navbar-logo {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: url("/assets/img/blueforge-logo.webp") center / contain no-repeat;
}

/* Page shell: dark navy, centered COLUMN, mobile-friendly padding. The
   ::before/::after copy are flex items of this container — column direction
   keeps them stacked above/below the card instead of beside it. */
.page-content.user.signin {
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(77, 141, 255, 0.16), transparent 60%),
    var(--bf-navy);
}
.page-content.user.signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8vh 16px 48px;
}
@media (max-width: 640px) {
  .page-content.user.signin { padding: 4vh 12px 32px; }
}

/* Context copy: why the user is here. Centered, card-width, so they stack
   cleanly above and below the form. */
.page-content.user.signin::before {
  content: "Sign in to continue";
  display: block;
  width: min(420px, calc(100% - 32px));
  text-align: center;
  color: var(--bf-ink);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}
.page-content.user.signin::after {
  content: "An app is asking to use your forge-git identity.";
  display: block;
  width: min(420px, calc(100% - 32px));
  text-align: center;
  color: var(--bf-ink-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* One card: clamp the outermost grid to the card width and let every
   nested layer (column, container, segment, form) be 100% of it — nested
   min() clamps were multiplying and squeezing the form to ~90px. */
.page-content.user.signin .ui.page.grid {
  width: min(420px, calc(100% - 32px));
  max-width: none;
  margin: 0 auto;
  /* Fomantic's "very relaxed" page grid pads 175px per side, which squeezed
     the card column to ~70px inside the clamped box. The clamp IS the gutter. */
  padding: 0 !important;
}
.page-content.user.signin .ui.page.grid > .column {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto;
  padding: 0 0 14px;
}
.page-content.user.signin .ui.container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}
.page-content.user.signin .ui.cards,
.page-content.user.signin .ui.card,
.page-content.user.signin .ui.segments,
.page-content.user.signin .ui.segment {
  background: var(--bf-navy-2);
  border: 1px solid rgba(232, 237, 246, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: none;
  margin: 0 auto;
}
.page-content.user.signin .ui.attached.header {
  background: var(--bf-navy-2);
  color: var(--bf-ink);
  border-color: rgba(232, 237, 246, 0.14);
}
.page-content.user.signin .ui.segment form,
.page-content.user.signin form.ui.form {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* Field labels: label text left, "Forgot password?" right — the raw markup
   puts the anchor inside the label, which collides without a flex row. */
.page-content.user.signin .field label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  color: var(--bf-ink-dim);
}
.page-content.user.signin .ui.input > input,
.page-content.user.signin input:not([type="checkbox"]) {
  background: #0d1526 !important;
  color: var(--bf-ink) !important;
  border: 1px solid rgba(232, 237, 246, 0.22) !important;
  border-radius: 8px !important;
}
.page-content.user.signin .ui.input > input:focus,
.page-content.user.signin input:not([type="checkbox"]):focus {
  border-color: var(--bf-accent) !important;
  outline: 2px solid var(--bf-accent);
  outline-offset: 1px;
}

/* Buttons: primary = accent blue with AA ink; visible focus ring everywhere. */
.page-content.user.signin .ui.button,
.page-content.user.signin button {
  border-radius: 8px !important;
}
.page-content.user.signin .ui.button.primary,
.page-content.user.signin button.primary,
.page-content.user.signin .ui.green.button:not(.basic):not(.secondary) {
  background: var(--bf-accent) !important;
  color: #06101f !important;
  font-weight: 600;
}
.page-content.user.signin .ui.button:focus-visible,
.page-content.user.signin button:focus-visible,
.page-content.user.signin a:focus-visible,
.page-content.user.signin input:focus-visible {
  outline: 2px solid var(--bf-accent);
  outline-offset: 2px;
}

/* Passkey: demoted to a secondary section INSIDE the card flow. */
.page-content.user.signin .signin-passkey {
  margin-top: 14px !important;
  border-top: 1px solid rgba(232, 237, 246, 0.14) !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Links: AA on navy. */
.page-content.user.signin a { color: var(--bf-accent); }
.page-content.user.signin a:hover { color: #7aa9ff; }

/* The top bar: brand-navy so the cup-swap reads as intentional. */
.page-content.user.signin #navbar {
  background: var(--bf-navy-2);
  border-bottom: 1px solid rgba(232, 237, 246, 0.12);
}
