/* ================================================================
   Veralia Globe — Main Stylesheet
   ================================================================
   Global styles used site-wide. Page-specific styles live in
   pages.css, organized by page section.
   ================================================================ */


/* ================================================================
   Reset & Base
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; display: block; }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p  { margin: 0 0 1em; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

::selection { background: var(--color-brand-soft); color: var(--color-text); }


/* ================================================================
   Layout
   ================================================================ */
.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.app__sidebar-left {
  padding-top: 16px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}

.app__main {
  min-width: 0;
  border-left:  1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  min-height: 100vh;
  background: var(--color-bg);
}

.app__main-inner {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

/* Some pages (messages, info hero, profile cover) want full width */
.page-messages .app__main-inner,
.page-info     .app__main-inner,
.page-profile  .app__main-inner {
  max-width: none;
}

/* Mobile: collapse to single column, show bottom nav */
@media (max-width: 960px) {
  .app {
    display: block;
    padding: 0;
    max-width: none;
  }
  .app__sidebar-left { display: none; }
  .app__main {
    border: none;
    padding-bottom: 72px; /* space for bottom nav */
  }
  .app__main-inner { padding: 12px; }
}


/* ================================================================
   Site Footer (full-width, below everything)
   ================================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  padding: 32px 16px 24px;
  margin-top: 32px;
  color: var(--color-text-muted);
}
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
.site-footer__brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.site-footer__brand:hover { text-decoration: none; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9rem;
}
.site-footer__links a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.site-footer__links a:hover {
  color: var(--color-brand);
  text-decoration: none;
}

.site-footer__copy {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .site-footer__inner {
    justify-content: center;
    text-align: center;
  }
  .site-footer__links { justify-content: center; }
}

/* Hide the site footer on Messages (full-screen layout there) */
.page-messages .site-footer { display: none; }


/* ================================================================
   Top Bar (logo on left sidebar)
   ================================================================ */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__icon {
  /* width: 32px;
  height: 32px; */
  object-fit: contain;
  flex-shrink: 0;
}


/* ================================================================
   Navigation
   ================================================================ */
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  list-style: none;
  margin: 0;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}
.nav__item:hover {
  background: var(--color-surface-hover);
  text-decoration: none;
}
.nav__item--active {
  font-weight: 700;
}
.nav__icon { font-size: 1.25rem; width: 24px; text-align: center; }

/* Mobile bottom bar */
.bottom-nav {
  display: none;
}
@media (max-width: 960px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: 50;
  }
  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
  }
  .bottom-nav__item--active { color: var(--color-brand); }
  .bottom-nav__icon { font-size: 1.3rem; }
}


/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--color-brand);
  color: var(--color-text-on-brand);
}
.btn--primary:hover { background: var(--color-brand-hover); }

.btn--outline {
  border-color: var(--color-border-strong);
  background: transparent;
}
.btn--outline:hover { background: var(--color-surface-hover); }

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn--ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.btn--danger {
  background: var(--color-danger);
  color: #fff;
}

.btn--block { display: flex; width: 100%; }
.btn--sm    { padding: 6px 12px; font-size: 0.85rem; }
.btn--lg    { padding: 14px 26px; font-size: 1.05rem; }


/* ================================================================
   Forms
   ================================================================ */
.form__row { margin-bottom: 16px; }

.form__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
}

.form__textarea { min-height: 100px; resize: vertical; }

.form__hint  { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.form__error { font-size: 0.85rem; color: var(--color-danger);    margin-top: 4px; }

.form__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.form__check input { margin-top: 3px; }


/* ================================================================
   Cards
   ================================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card--auth {
  max-width: 420px;
  margin: 60px auto;
  padding: 32px;
}


/* ================================================================
   Badges (verified, real-id, peace tier)
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.85rem;
  line-height: 1;
  vertical-align: middle;
  margin-left: 3px;
  border-radius: 999px;
  cursor: help;
}

/* When the badge is an <img> (Real-ID), it keeps its own artwork. */
img.badge {
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.badge-verified { color: var(--badge-verified-fg); }
.badge-verified svg {
  fill: #1d9bf0;
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 2px rgba(29,155,240,0.4));
}

.badge-peace-peacekeeper { }
.badge-peace-good        { }
.badge-peace-caution     { }
.badge-peace-at-risk     { }


/* ================================================================
   User display line (name + badges + @handle)
   ================================================================ */
.user-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.user-line__name {
  font-weight: 700;
  color: var(--color-text);
}
.user-line__handle {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.9rem;
}


/* ================================================================
   Flash Messages
   ================================================================ */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-size: 0.95rem;
}
.flash--success {
  background: rgba(34, 197, 94, 0.10);
  color: var(--color-success);
  border-color: rgba(34, 197, 94, 0.25);
}
.flash--error {
  background: rgba(220, 38, 38, 0.10);
  color: var(--color-danger);
  border-color: rgba(220, 38, 38, 0.25);
}
.flash--info {
  background: var(--color-brand-soft);
  color: var(--color-brand);
  border-color: var(--color-brand-soft);
}


/* ================================================================
   Utility
   ================================================================ */
.text-muted  { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.divider {
  height: 1px;
  background: var(--color-border);
  margin: 16px 0;
}