/* Reset + layout shell. */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

/* Faint full-viewport technical background (inherits theme text color). */
.bg-decor {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  color: var(--text);
  opacity: 0.04;            /* ~96% transparent */
}
/* Keep real content above the decoration. */
.topbar, .app, .footer { position: relative; z-index: 1; }
.topbar { z-index: 100; }  /* sticky bar stays above content + decor */

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar — sticks to the top of the viewport during scroll. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--gray-700);
  box-shadow: var(--shadow-1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.3rem;
}
.brand:hover { text-decoration: none; }
.brand-logo { border-radius: 50%; object-fit: cover; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a, .nav button.linklike {
  color: var(--text);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 4px 2px;
}
.nav a:hover, .nav button.linklike:hover { color: var(--accent-cyan); text-decoration: none; }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-600);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

/* Main */
.app {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 40px;
}
@media (max-width: 700px) { .app { padding: 40px 20px; } }

/* Footer */
.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--gray-700);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer p { margin: 6px 0; }
.footer-copy { color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--gray-600);
  color: var(--text);
}
.btn:hover { filter: brightness(1.1); }
.btn-primary { background: var(--accent-cyan); color: var(--accent-cyan-ink); }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.9rem; }
.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-600);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.input:focus { outline: 2px solid var(--accent-cyan); border-color: transparent; }
.field-error { color: var(--danger); font-size: 0.82rem; margin-top: 5px; }
.textarea { resize: vertical; min-height: 120px; font: inherit; line-height: 1.5; }
.req { color: var(--danger); }
select.input { appearance: auto; }

/* Generic message banners */
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; }
.banner-error { background: rgba(255,107,107,0.14); color: var(--danger); }
.banner-success { background: rgba(95,208,160,0.14); color: var(--success); }

.hidden { display: none !important; }
