/* Sealand / 新蓝科技 brand layer for Forgejo.
 * Kept intentionally small so Forgejo upgrades remain easy to validate. */

:root {
  --sealand-indigo-950: #111a57;
  --sealand-indigo-800: #2738a6;
  --sealand-blue-700: #3157d5;
  --sealand-blue-600: #3e6be6;
  --sealand-cyan-400: #38bdf8;
  --sealand-focus: rgba(62, 107, 230, 0.3);
  --color-primary: var(--sealand-blue-700);
  --color-primary-hover: #2949bd;
  --color-primary-active: #213c9f;
}

/* Navigation: clear product identity without changing Forgejo's layout. */
#navbar {
  border-bottom: 0;
  background: linear-gradient(112deg, var(--sealand-indigo-950) 0%, var(--sealand-indigo-800) 48%, var(--sealand-blue-700) 100%);
  box-shadow: 0 6px 24px rgba(17, 26, 87, 0.2);
}

#navbar .item,
#navbar .item > svg,
#navbar .item .svg {
  color: rgba(255, 255, 255, 0.9) !important;
  fill: currentColor;
}

#navbar .item:hover,
#navbar .item.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

#navbar-logo {
  display: flex !important;
  gap: 0.65rem;
  align-items: center;
}

#navbar-logo img {
  content: url("/assets/img/sealand-logo-20260918.svg");
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

#navbar-logo::after {
  content: "SEALAND";
  color: #fff;
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

/* Keep core actions recognizably Forgejo while applying Sealand's blue. */
.ui.primary.button,
.ui.primary.buttons .button {
  border-color: var(--sealand-blue-700) !important;
  background: linear-gradient(135deg, var(--sealand-blue-700), var(--sealand-blue-600)) !important;
  box-shadow: 0 4px 12px rgba(49, 87, 213, 0.18);
}

.ui.primary.button:hover,
.ui.primary.buttons .button:hover {
  border-color: #2949bd !important;
  background: linear-gradient(135deg, #2949bd, #3157d5) !important;
}

a:not(.ui.button) {
  text-decoration-color: rgba(49, 87, 213, 0.35);
}

input:focus,
textarea:focus,
select:focus,
.ui.input > input:focus {
  border-color: var(--sealand-blue-600) !important;
  box-shadow: 0 0 0 3px var(--sealand-focus) !important;
}

.ui.tabular.menu .active.item,
.ui.secondary.pointing.menu .active.item {
  border-color: var(--sealand-blue-700) !important;
}

/* Sign-in page: branded welcome card, with no form or auth-flow changes. */
.page-content.user.signin {
  display: flex;
  min-height: calc(100vh - 116px);
  align-items: center;
  padding: clamp(2rem, 7vh, 5rem) 1rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.16), transparent 28rem),
    radial-gradient(circle at 88% 75%, rgba(49, 87, 213, 0.14), transparent 30rem),
    linear-gradient(145deg, #f4f7ff 0%, #edf4ff 48%, #f8fbff 100%);
}

.page-content.user.signin > .ui.page.grid {
  width: 100%;
  margin: 0;
}

.page-content.user.signin .column {
  width: min(100%, 31rem) !important;
  max-width: 31rem !important;
}

.page-content.user.signin .column::before {
  display: flex;
  min-height: 72px;
  align-items: center;
  box-sizing: border-box;
  padding-left: 88px;
  margin: 0 auto 1.25rem;
  background: url("/assets/img/sealand-logo-20260918.svg") left center / 68px 68px no-repeat;
  color: var(--sealand-indigo-950);
  content: "新蓝科技 · SEALAND\A开放协作 · 稳定交付";
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: left;
  white-space: pre;
}

.page-content.user.signin .column > .ui.container.fluid:first-of-type {
  overflow: hidden;
  border: 1px solid rgba(49, 87, 213, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(17, 26, 87, 0.16);
  backdrop-filter: blur(12px);
}

.page-content.user.signin .column > .ui.container.fluid:first-of-type > h4.ui.header {
  padding: 1.05rem 1.4rem;
  border: 0;
  border-radius: 0 !important;
  background: linear-gradient(112deg, var(--sealand-indigo-800), var(--sealand-blue-700));
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.page-content.user.signin .column > .ui.container.fluid:first-of-type > .ui.attached.segment {
  padding: 1.55rem 1.6rem 1.35rem;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
}

.page-content.user.signin .column > .ui.container.fluid:nth-of-type(2) > .ui.attached.segment.header.top {
  padding: 0.9rem 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.page-content.user.signin label {
  color: #24305f;
  font-weight: 650;
}

.page-content.user.signin .ui.form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 44px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
}

.page-content.user.signin .ui.primary.button {
  min-height: 44px;
  border-radius: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.page-footer {
  border-top-color: rgba(49, 87, 213, 0.12);
}

/* Forgejo auto/dark themes retain readable contrast. */
html[data-theme="forgejo-dark"] .page-content.user.signin,
html[data-theme="gitea-dark"] .page-content.user.signin {
  background:
    radial-gradient(circle at 14% 20%, rgba(56, 189, 248, 0.12), transparent 28rem),
    radial-gradient(circle at 86% 78%, rgba(62, 107, 230, 0.18), transparent 30rem),
    linear-gradient(145deg, #0a1023 0%, #101936 55%, #0b1328 100%);
}

html[data-theme="forgejo-dark"] .page-content.user.signin .column::before,
html[data-theme="gitea-dark"] .page-content.user.signin .column::before {
  color: #f4f7ff;
}

html[data-theme="forgejo-dark"] .page-content.user.signin .column > .ui.container.fluid:first-of-type,
html[data-theme="gitea-dark"] .page-content.user.signin .column > .ui.container.fluid:first-of-type {
  border-color: rgba(110, 152, 255, 0.2);
  background: rgba(19, 28, 57, 0.95);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

html[data-theme="forgejo-dark"] .page-content.user.signin label,
html[data-theme="gitea-dark"] .page-content.user.signin label {
  color: #e5ebff;
}

html[data-theme="forgejo-dark"] .page-content.user.signin a,
html[data-theme="gitea-dark"] .page-content.user.signin a,
html[data-theme="forgejo-dark"] .page-footer a,
html[data-theme="gitea-dark"] .page-footer a {
  color: #9dbbff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="forgejo-auto"] .page-content.user.signin,
  html[data-theme="gitea-auto"] .page-content.user.signin {
    background:
      radial-gradient(circle at 14% 20%, rgba(56, 189, 248, 0.12), transparent 28rem),
      radial-gradient(circle at 86% 78%, rgba(62, 107, 230, 0.18), transparent 30rem),
      linear-gradient(145deg, #0a1023 0%, #101936 55%, #0b1328 100%);
  }

  html[data-theme="forgejo-auto"] .page-content.user.signin .column::before,
  html[data-theme="gitea-auto"] .page-content.user.signin .column::before {
    color: #f4f7ff;
  }

  html[data-theme="forgejo-auto"] .page-content.user.signin .column > .ui.container.fluid:first-of-type,
  html[data-theme="gitea-auto"] .page-content.user.signin .column > .ui.container.fluid:first-of-type {
    border-color: rgba(110, 152, 255, 0.2);
    background: rgba(19, 28, 57, 0.95);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  }

  html[data-theme="forgejo-auto"] .page-content.user.signin label,
  html[data-theme="gitea-auto"] .page-content.user.signin label {
    color: #e5ebff;
  }

  html[data-theme="forgejo-auto"] .page-content.user.signin a,
  html[data-theme="gitea-auto"] .page-content.user.signin a,
  html[data-theme="forgejo-auto"] .page-footer a,
  html[data-theme="gitea-auto"] .page-footer a {
    color: #9dbbff;
  }
}

@media (max-width: 767px) {
  #navbar-logo::after {
    display: none;
  }

  .page-content.user.signin {
    min-height: calc(100vh - 104px);
    padding: 1.6rem 0.75rem;
  }

  .page-content.user.signin .column::before {
    min-height: 58px;
    padding-left: 70px;
    background-size: 56px 56px;
    font-size: 1.14rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
