/* ============================================================
   SutraHub — landing page + auth screens.
   Landing markup: custom/templates/home.tmpl
   Auth screens keep Forgejo's own markup (they carry OAuth, captcha,
   link-account and error logic) — we only restyle them.
   ============================================================ */

/* ---------- LANDING SHELL ---------- */
.sh-landing {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}

/* ---------- HERO ---------- */
.sh-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 32px 72px;
}

/* ambient brand wash behind the hero */
.sh-hero::before {
  content: "";
  position: absolute;
  inset: -20% -30% auto -30%;
  height: 150%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 26rem at 18% 8%,  color-mix(in srgb, var(--sh-orange) 13%, transparent), transparent 62%),
    radial-gradient(42rem 26rem at 84% 26%, color-mix(in srgb, var(--sh-violet) 20%, transparent), transparent 62%);
}

.sh-eyebrow {
  display: inline-block;
  padding: 5px 13px;
  margin-bottom: 20px;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: .01em;
  color: var(--sh-text-dim);
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: 999px;
}

.sh-hero-title {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.028em;
  color: var(--sh-text);
}
.sh-grad {
  background: var(--sh-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sh-hero-sub {
  margin: 0 0 30px;
  max-width: 30rem;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--sh-text-dim);
}

.sh-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.sh-hero-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--sh-text-dim);
}
.sh-hero-meta .svg { color: #3fb950; }

/* ---------- BUTTONS ---------- */
.sh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--sh-fast) var(--sh-ease-out),
              background-color var(--sh-fast) ease,
              border-color var(--sh-fast) ease;
}
.sh-btn:active { transform: translateY(1px); }

/* -webkit-text-fill-color is set explicitly: the gradient wordmark rules
   elsewhere set it to transparent, and it inherits. Without this the label
   is painted transparent over the gradient, i.e. invisible. */
.sh-btn-primary {
  background: var(--sh-gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
}
.sh-btn-primary:hover { filter: brightness(1.08); color: #fff; }

.sh-btn-ghost {
  background: var(--sh-surface);
  border-color: var(--sh-border);
  color: var(--sh-text);
}
.sh-btn-ghost:hover { background: var(--sh-surface-2); border-color: var(--sh-accent); color: var(--sh-text); }

/* ---------- HERO ART (decorative mock window) ---------- */
.sh-hero-art { display: flex; justify-content: center; }
.sh-win {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--sh-border);
  border-radius: 14px;
  background: var(--sh-surface);
  box-shadow: var(--sh-shadow);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-9deg) rotateX(3deg);
}
.sh-win-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: var(--sh-surface-2);
  border-bottom: 1px solid var(--sh-border);
}
.sh-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sh-border); }
.sh-win-title {
  margin-left: 10px;
  font-size: 12.5px;
  color: var(--sh-text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.sh-win-body { padding: 8px 0; }
.sh-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px;
}
.sh-row + .sh-row { border-top: 1px solid color-mix(in srgb, var(--sh-border) 55%, transparent); }
.sh-ico { color: var(--sh-text-dim); display: flex; flex: none; }
.sh-bar { height: 8px; border-radius: 4px; background: var(--sh-surface-2); }
.sh-bar.dim { margin-left: auto; opacity: .55; }
.w14 { width: 14% } .w16 { width: 16% } .w20 { width: 20% } .w24 { width: 24% }
.w28 { width: 28% } .w34 { width: 34% } .w40 { width: 40% } .w44 { width: 44% } .w52 { width: 52% }

/* ---------- FEATURES ---------- */
.sh-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 88px;
}
.sh-feat {
  padding: 26px 24px;
  border: 1px solid var(--sh-border);
  border-radius: 14px;
  background: var(--sh-surface);
  transition: border-color var(--sh-base) ease, transform var(--sh-base) var(--sh-ease-out);
}
.sh-feat:hover { border-color: var(--sh-accent); transform: translateY(-3px); }
.sh-feat-ico {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  margin-bottom: 15px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--sh-violet) 16%, transparent);
  color: var(--sh-accent);
}
.sh-feat h3 {
  margin: 0 0 7px;
  font-size: 16.5px;
  font-weight: 620;
  color: var(--sh-text);
}
.sh-feat p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--sh-text-dim);
}

/* ---------- CLOSING CTA ---------- */
.sh-cta {
  max-width: 1200px;
  margin: 0 auto 88px;
  padding: 56px 32px;
  text-align: center;
  border: 1px solid var(--sh-border);
  border-radius: 18px;
  background:
    radial-gradient(38rem 18rem at 50% 0%, color-mix(in srgb, var(--sh-violet) 14%, transparent), transparent 70%),
    var(--sh-surface);
}
.sh-cta h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 680;
  letter-spacing: -.02em;
  color: var(--sh-text);
}
.sh-cta p { margin: 0 0 26px; font-size: 15.5px; color: var(--sh-text-dim); }

/* ---------- AUTH SCREENS (sign in / sign up) ----------
   Forgejo's own markup, restyled. The brand lockup + gradient wash come from
   custom/templates/custom/body_outer_pre.tmpl, which already targets
   .page-content.sign-in / .sign-up. Forgejo also uses `.user.signin` and
   `.user.signup`, so both spellings are matched here. */
.page-content.user.signin,
.page-content.user.signup,
.page-content.sign-in,
.page-content.sign-up {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100vh - var(--sh-topbar) - 64px);
  padding: 56px 20px 72px;
}

/* Forgejo wraps the form in a `page grid` that fights centring — flatten it */
.page-content.user.signin .ui.middle.very.relaxed.page.grid,
.page-content.user.signup .ui.middle.very.relaxed.page.grid {
  width: 100%;
  max-width: 428px;
  margin: 0;
  padding: 0;
}
.page-content.user.signin .ui.container.fluid,
.page-content.user.signup .ui.container.fluid { padding: 0 !important; }

/* the card: header + segment are separate elements upstream — join them */
.page-content.user.signin .ui.top.attached.header,
.page-content.user.signup .ui.top.attached.header {
  border-radius: 14px 14px 0 0 !important;
  border: 1px solid var(--sh-border) !important;
  border-bottom: none !important;
  background: var(--sh-surface-2) !important;
  padding: 18px 26px !important;
  font-size: 16px !important;
  font-weight: 620 !important;
  color: var(--sh-text) !important;
}
.page-content.user.signin .ui.attached.segment,
.page-content.user.signup .ui.attached.segment {
  border-radius: 0 0 14px 14px !important;
  border: 1px solid var(--sh-border) !important;
  background: var(--sh-surface) !important;
  padding: 26px !important;
  box-shadow: var(--sh-shadow) !important;
}

.page-content.user.signin .ui.form .field,
.page-content.user.signup .ui.form .field { margin-bottom: 17px !important; }

.page-content.user.signin .ui.form label,
.page-content.user.signup .ui.form label {
  display: block !important;
  margin-bottom: 7px !important;
  font-size: 13.5px !important;
  font-weight: 550 !important;
  color: var(--sh-text) !important;
}

.page-content.user.signin .ui.form input[type="text"],
.page-content.user.signin .ui.form input[type="password"],
.page-content.user.signin .ui.form input[type="email"],
.page-content.user.signup .ui.form input[type="text"],
.page-content.user.signup .ui.form input[type="password"],
.page-content.user.signup .ui.form input[type="email"] {
  height: 44px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
}

/* primary submit picks up the brand gradient — it is the one action here */
.page-content.user.signin .ui.primary.button,
.page-content.user.signup .ui.primary.button {
  height: 46px !important;
  border-radius: 10px !important;
  background: var(--sh-gradient) !important;
  border: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  transition: filter var(--sh-fast) ease, transform var(--sh-fast) var(--sh-ease-out) !important;
}
.page-content.user.signin .ui.primary.button:hover,
.page-content.user.signup .ui.primary.button:hover { filter: brightness(1.08) !important; }
.page-content.user.signin .ui.primary.button:active,
.page-content.user.signup .ui.primary.button:active { transform: translateY(1px) !important; }

/* the "Forgot password?" / "Need an account?" trailing links */
.page-content.user.signin .ui.attached.segment + .ui.attached.segment,
.page-content.user.signup .ui.attached.segment + .ui.attached.segment {
  margin-top: 14px !important;
  border-radius: 14px !important;
  text-align: center;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .sh-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 56px 22px 48px;
    text-align: center;
  }
  .sh-hero-sub { margin-left: auto; margin-right: auto; }
  .sh-hero-cta, .sh-hero-meta { justify-content: center; }
  .sh-win { transform: none; }
  .sh-features { padding: 8px 22px 64px; }
  .sh-cta { margin: 0 22px 64px; padding: 44px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .sh-feat:hover { transform: none; }
  .sh-btn:active { transform: none; }
}
