/* Riveredge private login — sci-fi brand + minimal form */

:root {
  --re-bg: #05070c;
  --re-ink: #eef4ff;
  --re-muted: #8b9bb8;
  --re-line: rgba(120, 180, 255, 0.16);
  --re-cyan: #22d3ee;
  --re-blue: #4f6ef7;
  --re-violet: #7c5cff;
}

body:has(.page-content.user.signin),
body:has(.page-content.home) {
  background: var(--re-bg) !important;
  overflow-x: hidden;
}

body:has(.page-content.user.signin)::before,
body:has(.page-content.home)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 28%, rgba(79, 110, 247, 0.22), transparent 58%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(34, 211, 238, 0.1), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 70%, rgba(124, 92, 255, 0.12), transparent 50%),
    linear-gradient(180deg, #05070c 0%, #0a1020 100%);
}

/* scanline / grid */
body:has(.page-content.user.signin)::after,
body:has(.page-content.home)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(100, 160, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 160, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: re-grid-drift 28s linear infinite;
}

@keyframes re-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 48px, 48px 0; }
}

.full.height:has(.page-content.user.signin),
.full.height:has(.page-content.home),
.page-content.user.signin,
.page-content.home {
  position: relative;
  z-index: 1;
}

/* —— Brand stage —— */
.re-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 1.75rem;
  text-align: center;
  animation: re-fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.re-brand-stage {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 1.15rem;
}

.re-brand-stage .re-ring,
.re-brand-stage .re-ring-2,
.re-brand-stage .re-core-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.re-brand-stage .re-ring {
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.15),
    inset 0 0 18px rgba(79, 110, 247, 0.12);
  animation: re-spin 14s linear infinite;
}

.re-brand-stage .re-ring::before,
.re-brand-stage .re-ring::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--re-cyan);
  box-shadow: 0 0 12px var(--re-cyan);
  top: 50%;
  left: 50%;
  margin: -4px 0 0 -4px;
}

.re-brand-stage .re-ring::before {
  transform: rotate(0deg) translateX(78px);
}

.re-brand-stage .re-ring::after {
  background: var(--re-violet);
  box-shadow: 0 0 12px var(--re-violet);
  transform: rotate(180deg) translateX(78px);
}

.re-brand-stage .re-ring-2 {
  inset: 14px;
  border: 1px dashed rgba(124, 92, 255, 0.4);
  animation: re-spin-rev 22s linear infinite;
}

.re-brand-stage .re-core-glow {
  inset: 28px;
  background: radial-gradient(circle, rgba(79, 110, 247, 0.35) 0%, transparent 68%);
  animation: re-pulse-glow 2.8s ease-in-out infinite;
  filter: blur(2px);
}

.re-brand-stage .re-logo {
  position: absolute;
  inset: 42px;
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(34, 211, 238, 0.55))
    drop-shadow(0 0 28px rgba(79, 110, 247, 0.4));
  animation: re-logo-breathe 4.2s ease-in-out infinite;
}

@keyframes re-spin {
  to { transform: rotate(360deg); }
}

@keyframes re-spin-rev {
  to { transform: rotate(-360deg); }
}

@keyframes re-pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes re-logo-breathe {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(3deg); }
}

@keyframes re-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.re-brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3.5vw, 1.9rem);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--re-ink);
  text-shadow: 0 0 24px rgba(79, 110, 247, 0.35);
}

.re-brand p {
  margin: 0.45rem 0 0;
  color: var(--re-muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

/* —— Login panel —— */
.page-content.user.signin {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.page-content.user.signin > .ui.middle.very.relaxed.page.grid,
.page-content.user.signin > .ui.grid {
  width: 100%;
  max-width: 420px;
  margin: 0 auto !important;
}

.page-content.user.signin .column {
  animation: re-fade-up 0.9s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: 420px !important;
  width: 100% !important;
}

.page-content.user.signin .ui.container.fluid {
  max-width: 100% !important;
}

.page-content.user.signin .ui.top.attached.header {
  display: none !important;
}

.page-content.user.signin .ui.attached.segment {
  background: rgba(10, 16, 32, 0.72) !important;
  border: 1px solid var(--re-line) !important;
  border-radius: 16px !important;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px);
  padding: 1.35rem 1.4rem 1.25rem !important;
}

.page-content.user.signin .ui.form .field > label {
  color: var(--re-muted) !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
}

.page-content.user.signin .ui.form input {
  background: rgba(5, 7, 12, 0.75) !important;
  border: 1px solid var(--re-line) !important;
  border-radius: 10px !important;
  color: var(--re-ink) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.page-content.user.signin .ui.form input:focus {
  border-color: rgba(34, 211, 238, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15) !important;
}

.page-content.user.signin .ui.primary.button {
  background: linear-gradient(90deg, var(--re-cyan), var(--re-blue) 55%, var(--re-violet)) !important;
  color: #041018 !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  border: none !important;
  transition: transform 0.2s ease, filter 0.2s ease !important;
}

.page-content.user.signin .ui.primary.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* private repo: strip extras */
.page-content.user.signin .divider.divider-text,
.page-content.user.signin #oauth2-login-navigator,
.page-content.user.signin .signin-passkey,
.page-content.user.signin a[href="/user/login/openid"],
.page-content.user.signin a[href="/user/sign_up"],
.page-content.user.signin a[href="/user/forgot_password"],
.page-content.user.signin .field:has(a[href="/user/sign_up"]),
.page-content.user.signin .ui.attached.segment.header.top {
  display: none !important;
}

/* private login/home: no top bar at all */
body:has(.page-content.user.signin) #navbar,
body:has(.page-content.home) #navbar {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:has(.page-content.user.signin) .page-footer,
body:has(.page-content.home) .page-footer {
  opacity: 0.35;
  border-top: 1px solid var(--re-line) !important;
  background: transparent !important;
}

/* home redirect visual: same brand, single CTA */
.page-content.home .ui.stackable.middle.very.relaxed.page.grid,
.page-content.home .tw-mb-8 .hero h2 {
  display: none !important;
}

.page-content.home .tw-mb-8 {
  padding-top: 8vh;
}

.page-content.home .logo {
  display: none !important;
}
