/* Pishdad Git public/auth surfaces. Scoped to .pishdad-public. */

:root {
  --pd-bg: #080a0e;
  --pd-surface: #0d1117;
  --pd-surface-raised: #111720;
  --pd-line: #232b37;
  --pd-line-strong: #344154;
  --pd-text: #f0f3f6;
  --pd-text-soft: #a7b0bc;
  --pd-text-dim: #737f8d;
  --pd-accent: #8baeff;
  --pd-accent-strong: #b7cbff;
  --pd-ok: #7fc8a2;
  --pd-danger: #ff7f8c;
  --pd-radius: 14px;
}

body:has(.pishdad-public) {
  margin: 0;
  background: var(--pd-bg) !important;
  color: var(--pd-text) !important;
  color-scheme: dark;
}

body:has(.pishdad-public) #navbar,
body:has(.pishdad-public) > .page-footer,
body:has(.pishdad-public) .full.height > .page-footer,
body:has(.pishdad-public) footer.page-footer {
  display: none !important;
}

body:has(.pishdad-public) .full.height {
  min-height: 100vh;
  background: var(--pd-bg);
}

body:has(.pishdad-public) ::selection {
  color: #09101d;
  background: var(--pd-accent-strong);
}

body:has(.pishdad-public) :focus-visible {
  outline: 2px solid var(--pd-accent) !important;
  outline-offset: 3px;
}

.pishdad-public {
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  overflow: hidden;
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-feature-settings: "ss01" 1, "cv02" 1, "cv03" 1;
  -webkit-font-smoothing: antialiased;
}

.pd-shell {
  width: min(1420px, calc(100% - 72px));
  margin-inline: auto;
}

.pd-topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--pd-line);
}

.pd-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--pd-text) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none !important;
}

.pd-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--pd-line-strong);
  border-radius: 10px;
  background: #0b0f15;
}

.pd-mark svg {
  overflow: visible;
}

.pd-mark path,
.pd-mark circle {
  fill: none;
  stroke: var(--pd-accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-mark circle {
  fill: var(--pd-bg);
}

.pd-topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pd-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pd-text-dim);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}

.pd-status-dot,
.pd-board-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pd-ok);
  box-shadow: 0 0 0 3px rgba(127, 200, 162, .08);
}

.pd-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 17px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.pd-button:hover {
  transform: translateY(-1px);
}

.pd-button-primary {
  color: #07101e !important;
  background: var(--pd-accent-strong);
  border: 1px solid var(--pd-accent-strong);
}

.pd-button-primary:hover {
  background: #d0dcff;
  border-color: #d0dcff;
}

.pd-button-secondary {
  color: var(--pd-text) !important;
  background: transparent;
  border: 1px solid var(--pd-line-strong);
}

.pd-button-secondary:hover {
  background: var(--pd-surface-raised);
  border-color: #47566b;
}

.pd-home-stage {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(520px, 1.06fr);
  gap: 70px;
  align-items: center;
  padding-block: 72px 58px;
}

.pd-home-copy {
  min-width: 0;
}

.pd-home-copy h1,
.pd-login-context h1 {
  margin: 0;
  max-width: 820px;
  color: var(--pd-text);
  font-size: clamp(3.5rem, 6.4vw, 6rem);
  font-weight: 680;
  line-height: .96;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.pd-home-copy h1 span,
.pd-login-context h1 span {
  color: #7f8b99;
}

.pd-lead {
  max-width: 650px;
  margin: 30px 0 0;
  color: var(--pd-text-soft);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -.01em;
}

.pd-actions {
  margin-top: 34px;
}

.pd-actions .pd-button {
  min-height: 48px;
  padding-inline: 20px;
}

.pd-endpoints {
  margin-top: 58px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--pd-line);
  border-bottom: 1px solid var(--pd-line);
}

.pd-endpoints > div {
  min-width: 0;
  padding: 17px 16px 17px 0;
}

.pd-endpoints > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--pd-line);
}

.pd-endpoints span,
.pd-access-facts dt {
  display: block;
  margin-bottom: 7px;
  color: var(--pd-text-dim);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.pd-endpoints strong {
  display: block;
  overflow: hidden;
  color: #c9d0d8;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-branch-board {
  position: relative;
  min-height: 470px;
  border: 1px solid var(--pd-line-strong);
  border-radius: var(--pd-radius);
  background: #0a0e14;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  overflow: hidden;
}

.pd-board-header {
  position: relative;
  z-index: 2;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--pd-line);
  color: var(--pd-text-soft);
  font-size: 12px;
  font-weight: 650;
}

.pd-board-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pd-text-dim);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
}

.pd-branch-canvas {
  position: relative;
  height: 340px;
  padding: 16px 20px 0;
}

.pd-branch-canvas svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pd-branch-canvas path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.pd-branch-main {
  stroke: #8392a5;
}

.pd-branch-work {
  stroke: var(--pd-accent);
}

.pd-branch-release {
  stroke: #5f7188;
  stroke-dasharray: 5 8;
}

.pd-nodes circle {
  fill: #0a0e14;
  stroke: var(--pd-accent-strong);
  stroke-width: 2;
}

.pd-branch-label {
  position: absolute;
  padding: 4px 8px;
  border: 1px solid var(--pd-line-strong);
  border-radius: 6px;
  color: var(--pd-text-soft);
  background: #0d121a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.pd-label-main { top: 59px; right: 42px; }
.pd-label-review { top: 145px; left: 37%; }
.pd-label-release { top: 236px; right: 48px; }

.pd-clone-line {
  position: absolute;
  z-index: 3;
  left: 20px;
  right: 20px;
  bottom: 18px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--pd-line);
  border-radius: 8px;
  background: #080b10;
  color: var(--pd-text-dim);
  overflow: hidden;
}

.pd-clone-line span {
  color: var(--pd-ok);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pd-clone-line code {
  overflow: hidden;
  color: #b7c0cb;
  background: none;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-capability-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--pd-line);
  border-bottom: 1px solid var(--pd-line);
}

.pd-capability-rail > div {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 26px 18px 0;
}

.pd-capability-rail > div + div {
  padding-left: 26px;
  border-left: 1px solid var(--pd-line);
}

.pd-capability-rail strong {
  color: #dbe1e8;
  font-size: 13px;
  font-weight: 680;
}

.pd-capability-rail span {
  margin-top: 7px;
  color: var(--pd-text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.pd-public-footer {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #606c79;
  font-size: 11px;
}

/* Login */

.pd-back-link {
  color: var(--pd-text-dim) !important;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none !important;
}

.pd-back-link:hover {
  color: var(--pd-text) !important;
}

.pd-login-stage {
  min-height: calc(100vh - 176px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .65fr);
  gap: clamp(70px, 10vw, 170px);
  align-items: center;
  padding-block: 56px;
}

.pd-login-context {
  align-self: center;
  max-width: 760px;
}

.pd-login-context h1 {
  max-width: 720px;
  font-size: clamp(3rem, 5.4vw, 5.2rem);
}

.pd-login-context > p {
  max-width: 620px;
  margin: 30px 0 0;
  color: var(--pd-text-soft);
  font-size: 17px;
  line-height: 1.65;
}

.pd-auth-line {
  width: min(560px, 100%);
  height: 22px;
  display: flex;
  align-items: center;
  margin: 52px 0 42px;
}

.pd-auth-line span {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 2px solid var(--pd-accent);
  border-radius: 50%;
  background: var(--pd-bg);
}

.pd-auth-line i {
  height: 1px;
  flex: 1 1 auto;
  background: var(--pd-line-strong);
}

.pd-access-facts {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--pd-line);
  border-bottom: 1px solid var(--pd-line);
}

.pd-access-facts > div {
  padding: 17px 20px 17px 0;
}

.pd-access-facts > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--pd-line);
}

.pd-access-facts dt,
.pd-access-facts dd {
  margin: 0;
}

.pd-access-facts dd {
  color: #c1c9d2;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.pd-login-panel {
  width: 100%;
  max-width: 510px;
  justify-self: end;
  padding: 34px;
  border: 1px solid var(--pd-line-strong);
  border-radius: var(--pd-radius);
  background: #0c1016;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}

.pd-login-panel-head {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--pd-line);
}

.pd-login-panel-head h2 {
  margin: 0;
  color: var(--pd-text);
  font-size: 23px;
  font-weight: 680;
  letter-spacing: -.025em;
}

.pd-login-panel-head p {
  margin: 8px 0 0;
  color: var(--pd-text-dim);
  font-size: 13px;
}

.pd-auth-form-wrap .ui.message {
  margin: 0 0 20px !important;
  border: 1px solid #67343a !important;
  border-radius: 9px !important;
  background: #1d1014 !important;
  box-shadow: none !important;
  color: #ffc5cb !important;
}

.pd-auth-form {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.pd-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-field label,
.pd-field-row label {
  color: #cdd4dc;
  font-size: 12px;
  font-weight: 680;
}

.pd-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pd-field-row a,
.pd-webauthn a {
  color: var(--pd-accent-strong) !important;
  font-size: 11px;
  text-decoration: none !important;
}

.pd-field input[type="text"],
.pd-field input[type="password"],
.pd-field input[type="email"] {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--pd-line-strong) !important;
  border-radius: 8px !important;
  background: #080b10 !important;
  box-shadow: none !important;
  color: var(--pd-text) !important;
  font: inherit;
  font-size: 13px;
  caret-color: var(--pd-accent-strong);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.pd-field input::placeholder {
  color: #596573;
  opacity: 1;
}

.pd-field input:focus {
  border-color: var(--pd-accent) !important;
  background: #0a0e14 !important;
}

.pd-field.is-error input {
  border-color: var(--pd-danger) !important;
}

.pd-remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--pd-text-dim);
  font-size: 11px;
  cursor: pointer;
}

.pd-remember input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--pd-accent);
}

.pd-submit {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  padding: 0 16px;
  border: 1px solid var(--pd-accent-strong);
  border-radius: 8px;
  background: var(--pd-accent-strong);
  color: #07101e;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pd-submit:hover {
  transform: translateY(-1px);
  background: #d0dcff;
  border-color: #d0dcff;
}

.pd-submit svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pd-auth-form-wrap .oauth2-login-divider,
.pd-auth-form-wrap .oauth2-login-navigator,
.pd-auth-form-wrap .openid-login {
  margin-top: 20px !important;
}

.pd-webauthn {
  margin-top: 18px;
  color: var(--pd-text-dim);
  font-size: 11px;
}

.pd-webauthn .ui.message {
  border-radius: 8px !important;
  box-shadow: none !important;
}

/* Keep stock Forgejo auth helpers inside our visual system. */
.pishdad-public .ui.form .field > label,
.pishdad-public .ui.checkbox label {
  color: var(--pd-text-soft) !important;
}

.pishdad-public .ui.input > input,
.pishdad-public .ui.form input:not([type="checkbox"]):not([type="radio"]) {
  background: #080b10 !important;
  color: var(--pd-text) !important;
  border-color: var(--pd-line-strong) !important;
}

.pishdad-public .ui.button {
  box-shadow: none !important;
}

@media (max-width: 1080px) {
  .pd-home-stage {
    grid-template-columns: 1fr;
    gap: 54px;
    padding-top: 58px;
  }

  .pd-home-copy {
    max-width: 820px;
  }

  .pd-branch-board {
    width: 100%;
    max-width: 820px;
  }

  .pd-login-stage {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .pd-login-context {
    max-width: 760px;
  }

  .pd-login-panel {
    max-width: 620px;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .pishdad-public {
    background: var(--pd-bg);
  }

  .pd-shell {
    width: min(100% - 36px, 1420px);
  }

  .pd-topbar {
    height: 70px;
  }

  .pd-status {
    display: none;
  }

  .pd-button-secondary {
    min-height: 38px;
    padding-inline: 14px;
  }

  .pd-home-stage {
    min-height: auto;
    padding-block: 52px 42px;
  }

  .pd-home-copy h1,
  .pd-login-context h1 {
    font-size: clamp(2.75rem, 14vw, 4.15rem);
    line-height: .98;
  }

  .pd-lead,
  .pd-login-context > p {
    margin-top: 24px;
    font-size: 15px;
  }

  .pd-endpoints {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .pd-endpoints > div,
  .pd-endpoints > div + div {
    padding: 13px 0;
    border-left: 0;
  }

  .pd-endpoints > div + div {
    border-top: 1px solid var(--pd-line);
  }

  .pd-branch-board {
    min-height: 400px;
  }

  .pd-branch-canvas {
    height: 290px;
    margin-left: -28px;
    margin-right: -18px;
  }

  .pd-clone-line {
    left: 14px;
    right: 14px;
  }

  .pd-capability-rail {
    grid-template-columns: 1fr 1fr;
  }

  .pd-capability-rail > div,
  .pd-capability-rail > div + div {
    min-height: 94px;
    padding: 17px 14px 17px 0;
    border-left: 0;
  }

  .pd-capability-rail > div:nth-child(even) {
    padding-left: 14px;
    border-left: 1px solid var(--pd-line);
  }

  .pd-capability-rail > div:nth-child(n+3) {
    border-top: 1px solid var(--pd-line);
  }

  .pd-public-footer {
    min-height: 82px;
  }

  .pd-login-stage {
    min-height: auto;
    padding-block: 48px 56px;
  }

  .pd-auth-line {
    margin: 38px 0 32px;
  }

  .pd-access-facts {
    grid-template-columns: 1fr;
  }

  .pd-access-facts > div,
  .pd-access-facts > div + div {
    padding: 13px 0;
    border-left: 0;
  }

  .pd-access-facts > div + div {
    border-top: 1px solid var(--pd-line);
  }

  .pd-login-panel {
    max-width: none;
    padding: 26px 22px;
  }
}

@media (max-width: 460px) {
  .pd-brand span:last-child {
    font-size: 14px;
  }

  .pd-home-copy h1,
  .pd-login-context h1 {
    font-size: 2.7rem;
  }

  .pd-capability-rail {
    grid-template-columns: 1fr;
  }

  .pd-capability-rail > div,
  .pd-capability-rail > div:nth-child(even) {
    padding: 15px 0;
    border-left: 0;
    border-top: 1px solid var(--pd-line);
  }

  .pd-capability-rail > div:first-child {
    border-top: 0;
  }

  .pd-public-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pishdad-public *,
  .pishdad-public *::before,
  .pishdad-public *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
