/*
    The site's look: deep space, a starfield behind everything (drawn by site.js), Bootstrap's dark
    theme for the forms and tables, Cinzel for names and headings, Garamond for the lore.
*/

:root,
[data-bs-theme="dark"] {
  --ooc-space: #05070c;
  --ooc-panel: rgba(14, 20, 32, 0.78);
  --ooc-line: rgba(140, 170, 210, 0.18);
  --ooc-text: #d9e0ea;
  --ooc-muted: #8d99ab;
  --ooc-accent: #8fc3ff;
  --ooc-gold: #d8c08a;

  --bs-body-bg: var(--ooc-space);
  --bs-body-color: var(--ooc-text);
  --bs-secondary-color: var(--ooc-muted);
  --bs-border-color: var(--ooc-line);
  --bs-link-color: var(--ooc-accent);
  --bs-link-color-rgb: 143, 195, 255;
  --bs-link-hover-color: #c4e0ff;
  --bs-link-hover-color-rgb: 196, 224, 255;
  --bs-tertiary-bg: rgba(20, 28, 44, 0.9);
  --bs-secondary-bg: rgba(26, 36, 54, 0.9);
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: radial-gradient(ellipse at 70% -10%, #101a2e 0%, var(--ooc-space) 55%) fixed, var(--ooc-space);
  margin-bottom: 60px;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, .site-brand {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.04em;
}

/* ---- navigation and footer ----------------------------------------------------------------- */

.site-nav {
  background: rgba(5, 7, 12, 0.6);
  border-bottom: 1px solid var(--ooc-line);
  backdrop-filter: blur(6px);
  margin-bottom: 1.5rem;
}

.site-brand {
  color: var(--ooc-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 1rem;
}

.site-brand:hover {
  color: #fff;
}

.site-nav .nav-link {
  color: var(--ooc-muted);
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
  color: var(--ooc-text);
}

.site-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  line-height: 60px;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--ooc-muted);
  border-top: 1px solid var(--ooc-line);
  background: rgba(5, 7, 12, 0.6);
}

/* Pages other than the landing sit on a panel, so forms and tables stay readable over the stars. */
body:not(.landing) .site-main > main {
  background: var(--ooc-panel);
  border: 1px solid var(--ooc-line);
  border-radius: 0.5rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

/* ---- forms and buttons --------------------------------------------------------------------- */

.btn-primary {
  --bs-btn-bg: #2a5d94;
  --bs-btn-border-color: #3a70ab;
  --bs-btn-hover-bg: #3470b0;
  --bs-btn-hover-border-color: #4a85c4;
  --bs-btn-active-bg: #255385;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--ooc-space), 0 0 0 0.25rem rgba(143, 195, 255, 0.6);
}

.form-control, .form-select {
  background-color: rgba(8, 12, 20, 0.85);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.table {
  --bs-table-bg: transparent;
}

/* ---- the landing page ---------------------------------------------------------------------- */

.landing-hero {
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 0 4rem;
}

.landing-title {
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #eef3fa;
  text-shadow: 0 0 28px rgba(143, 195, 255, 0.35);
  margin: 0 0 2.75rem;
  animation: landing-rise 2.4s ease-out both;
}

.landing-lore {
  max-width: 40rem;
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.7;
  color: #cdd6e3;
  text-align: left;
}

.landing-lore p {
  margin-bottom: 1.2em;
  animation: landing-rise 1.8s ease-out both;
}

.landing-lore p:nth-child(1) { animation-delay: 0.8s; }
.landing-lore p:nth-child(2) { animation-delay: 1.6s; }
.landing-lore p:nth-child(3) { animation-delay: 2.4s; }
.landing-lore p:nth-child(4) { animation-delay: 3.2s; }
.landing-lore p:nth-child(5) { animation-delay: 4.0s; }

.landing-lore-close {
  font-style: italic;
  text-align: center;
  color: var(--ooc-gold);
  margin-top: 1.8em;
}

.landing-soon {
  margin-top: 3rem;
  font-family: 'Cinzel', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.95rem;
  color: var(--ooc-muted);
  animation: landing-rise 1.8s ease-out 5s both, landing-breathe 4s ease-in-out 7s infinite;
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes landing-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-title, .landing-lore p, .landing-soon {
    animation: none;
  }
}

/* ---- account pages ------------------------------------------------------------------------- */

/* Account pages are one form or one message, so the panel narrows to it and sits in the middle of
   the page under a centred heading. Management has a menu beside the form and takes a wider panel.
   The class comes from the Identity area's _ViewStart and the manage layout. */
.site-main > main.main-narrow,
.site-main > main.main-wide {
  margin-left: auto;
  margin-right: auto;
}

.site-main > main.main-narrow {
  max-width: 34rem;
}

.site-main > main.main-wide {
  max-width: 64rem;
}

main.main-narrow > h1,
main.main-wide > h1 {
  text-align: center;
  margin-bottom: 1.25rem;
}

.account-message {
  text-align: center;
  color: var(--ooc-muted);
}

.account-links {
  margin-top: 1rem;
}

.manage-body .nav-pills {
  --bs-nav-pills-link-active-bg: #2a5d94;
  --bs-nav-link-color: var(--ooc-muted);
  --bs-nav-link-hover-color: var(--ooc-text);
  margin-bottom: 1.5rem;
}

.manage-body h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.manage-form {
  max-width: 28rem;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.manage-steps li {
  margin-bottom: 0.75rem;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.4rem 1.5rem;
}

/* ---- invitations --------------------------------------------------------------------------- */

.invite-link code {
  word-break: break-all;
}

.invite-status {
  font-weight: 600;
}

.invite-pending { color: #8fc3ff; }
.invite-accepted { color: #7fd48a; }
.invite-expired { color: var(--ooc-muted); }
.invite-cancelled { color: #e08a8a; }

.manage-subheading {
  font-size: 1.05rem;
  margin-top: 1.75rem;
}

.admin-invite-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.admin-invite-fields .form-floating {
  flex: 1 1 18rem;
  max-width: 26rem;
}

.admin-invite-fields .admin-invite-count {
  flex: 0 1 12rem;
}

.admin-adjust {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.admin-adjust input {
  width: 4.5rem;
}

.admin-reassign {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-reassign select {
  max-width: 22rem;
}
