/* BrAIn Vault — global styles */
/* See styles.md for a text explanation of this file. */

/* --------------------------------------------------------------------------- */
/* Variables (design tokens) */
/* --------------------------------------------------------------------------- */

:root {
  --bg: #171717;
  --text: #e6e6e6;
  --container-max: 1400px;
  --logo-height-desktop: 300px;
  /* Project colors: graphics/UI only (progress bars, spinners, glows, indicators). Do not use for body text. */
  --color-primary: #009be1;
  --color-secondary: #3be77d;
}

/* --------------------------------------------------------------------------- */
/* Base reset & page */
/* --------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 2rem;
}

/* --------------------------------------------------------------------------- */
/* Logo block (top, centered) */
/* --------------------------------------------------------------------------- */

.logo-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 10px 2rem;
  position: relative;
}

.logo-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.logo-wrapper img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* Desktop: logo 300px max height, natural width, centered */
@media (min-width: 768px) {
  .logo-wrapper {
    max-width: none;
  }
  .logo-wrapper img {
    max-height: var(--logo-height-desktop);
    width: auto;
  }
}

.logo-bw {
  position: relative;
  z-index: 1;
}

.logo-color {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  animation: logoFadeCycle 16s ease-in-out infinite;
  pointer-events: none;
}

/* 5s fade to color, 3s hold, 5s fade to B&W, 3s hold, loop */
@keyframes logoFadeCycle {
  0% { opacity: 0; }
  31.25% { opacity: 1; }
  50% { opacity: 1; }
  81.25% { opacity: 0; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------- */
/* Main container & intro box */
/* --------------------------------------------------------------------------- */

.main-container {
  width: calc(100% - 20px);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 10px;
  flex: 1;
}

.intro-box {
  text-align: center;
  margin: 0 auto;
  max-width: 42rem;
}

.intro-box h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.intro-box .tagline {
  font-size: clamp(0.85rem, 2vw, 1rem);
  opacity: 0.85;
  margin: 0 0 1.25rem;
}

.intro-box p {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.6;
  margin: 0;
  opacity: 0.9;
}

/* --------------------------------------------------------------------------- */
/* Site footer (all pages) */
/* --------------------------------------------------------------------------- */

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 1rem 1.25rem 1.25rem;
  background: #404040;
  color: var(--text);
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.5;
}

.site-footer .footer-disclaimer {
  margin: 0 0 0.5rem;
  opacity: 0.95;
}

.site-footer .footer-copyright {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------- */
/* Links (default: 80% white, underlined; hover 70% white) */
/* --------------------------------------------------------------------------- */

a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}
a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------- */
/* Auth strip (floating top-right when not logged in) */
/* --------------------------------------------------------------------------- */

.auth-strip {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.auth-strip .btn--standalone {
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.auth-strip .btn--standalone:not(:last-child) {
  border-right: 1px solid rgba(128, 128, 128, 0.5);
}
.auth-strip .btn--standalone:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

/* --------------------------------------------------------------------------- */
/* Public non-home logo (150px desktop, 50% width mobile) */
/* --------------------------------------------------------------------------- */

.logo-block--public-page .logo-wrapper--public-page {
  max-width: 50%;
}
.logo-block--public-page .logo-wrapper--public-page img {
  max-height: none;
}
@media (min-width: 768px) {
  .logo-block--public-page .logo-wrapper--public-page {
    max-width: none;
  }
  .logo-block--public-page .logo-wrapper--public-page img {
    max-height: 150px;
    width: auto;
  }
}

.logo-wrapper a {
  display: block;
  position: relative;
  text-decoration: none;
}

/* --------------------------------------------------------------------------- */
/* Buttons: standalone (subtitle size, 10px radius) */
/* --------------------------------------------------------------------------- */

.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
.btn--standalone {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  display: inline-block;
}
.btn--standalone:hover {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
}
.btn--submit {
  font-size: 1rem;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  color: var(--bg);
  background: var(--text);
}
.btn--submit:hover {
  background: rgba(230, 230, 230, 0.9);
}

/* --------------------------------------------------------------------------- */
/* Menu groups (single rectangle 10px radius, 1px grey between items) */
/* --------------------------------------------------------------------------- */

.member-nav {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
}
.member-nav__item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 128, 128, 0.4);
  font-size: 1rem;
}
.member-nav__item:last-child {
  border-bottom: none;
}
.member-nav__item:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}
.member-nav__item--active {
  background: #000;
  color: var(--text);
}
.member-nav__item--active:hover {
  background: #111;
}

/* --------------------------------------------------------------------------- */
/* Forms (auth forms) */
/* --------------------------------------------------------------------------- */

.auth-form-box {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem 0;
}
.auth-form-box--text {
  max-width: 42rem;
}
.auth-form-title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}
.auth-form-error {
  color: #e88;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.auth-form .form-row {
  margin-bottom: 1rem;
}
.auth-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(128, 128, 128, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.auth-form-footer {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
}
.auth-form-footer a {
  text-decoration: underline;
}
.form-row--actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------- */
/* Paragraph max width (1400px) for loose text */
/* --------------------------------------------------------------------------- */

.paragraph-max {
  max-width: 1400px;
  margin: 0 0 1rem;
  line-height: 1.6;
  color: var(--text);
  font-size: 1rem;
}

/* --------------------------------------------------------------------------- */
/* HR standard (50% grey 1px, 80% width) */
/* --------------------------------------------------------------------------- */

.hr-standard {
  border: none;
  height: 1px;
  background: rgba(128, 128, 128, 0.5);
  width: 80%;
  margin: 1.5rem auto;
}

/* --------------------------------------------------------------------------- */
/* Member layout: sidebar + main (no 1400px limit on main) */
/* --------------------------------------------------------------------------- */

.page--member {
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  min-height: 100vh;
}

.member-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.member-sidebar__logo {
  flex-shrink: 0;
}
.member-sidebar__logo-img {
  max-height: 60px;
  width: auto;
  display: block;
}
.member-sidebar__logo a {
  text-decoration: none;
}

.member-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.member-main {
  flex: 1;
  padding: 1.5rem 1.5rem 2rem;
  width: 100%;
  max-width: none;
}

/* Hamburger: visible only on mobile */
.member-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 101;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.member-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}
.member-sidebar--open {
  transform: translateX(0);
}

@media (max-width: 767px) {
  .page--member {
    flex-direction: column;
  }
  .member-menu-toggle {
    display: flex;
  }
  .member-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .member-sidebar--open {
    transform: translateX(0);
  }
  .member-main {
    padding-top: 4rem;
  }
}

/* --------------------------------------------------------------------------- */
/* Member dashboard */
/* --------------------------------------------------------------------------- */

.member-dashboard__profile-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}
.member-dashboard__heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.project-list__item {
  margin-bottom: 0.5rem;
}
.project-list__link {
  display: block;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}
.project-list__link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}
.project-list__name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.project-list__stats {
  font-size: 0.85rem;
  opacity: 0.85;
}
.project-list__item--empty {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------- */
/* Project tabs (Vault, Brain, Reports, Settings) */
/* --------------------------------------------------------------------------- */

.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  max-width: 100%;
}
.project-tabs__item {
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-right: 1px solid rgba(128, 128, 128, 0.4);
  font-size: 0.95rem;
}
.project-tabs__item:last-child {
  border-right: none;
}
.project-tabs__item:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}
.project-tabs__item--active {
  background: #000;
}
.project-tabs__item--active:hover {
  background: #0a0a0a;
}

.project-page__title,
.member-page__title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}
.project-summary,
.under-construction {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------- */
/* Admin */
/* --------------------------------------------------------------------------- */

.admin-page {
  max-width: 100%;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.admin-table th,
.admin-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}
.admin-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.admin-table a {
  text-decoration: underline;
}
.admin-table a:hover {
  color: rgba(255, 255, 255, 0.7);
}
