/**
 * Общая тема интерфейса: Bootstrap 5 + единая палитра Algocode.
 */

:root {
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-bs-theme="dark"] {
  --bs-body-bg: #0a0c10;
  --bs-body-color: #e8ecf1;
  --bs-secondary-color: #94a3b8;
  --bs-border-color: #2a3444;
  --bs-primary: #5b7cfa;
  --bs-primary-rgb: 91, 124, 250;
  --bs-info: #2ec4b6;
  --bs-info-rgb: 46, 196, 182;
  --bs-link-color: #7c9cff;
  --bs-link-hover-color: #a8bcff;
}

html {
  scroll-behavior: smooth;
}

body.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bs-body-bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -8%, rgba(91, 124, 250, 0.18), transparent 55%),
    radial-gradient(ellipse 700px 400px at 85% 5%, rgba(46, 196, 182, 0.1), transparent 50%),
    linear-gradient(180deg, #0c1018 0%, #0a0c10 40%, #080a0e 100%);
  background-attachment: fixed;
}

body.site-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.site-main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

/* Навигация */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  background: linear-gradient(180deg, rgba(12, 16, 24, 0.92) 0%, rgba(10, 12, 16, 0.88) 100%) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(42, 52, 68, 0.85) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.app-navbar .navbar-brand {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  padding: 0.35rem 0;
}

.app-navbar .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 700;
  font-size: 0.95rem;
  color: #2ec4b6;
  background: linear-gradient(145deg, rgba(91, 124, 250, 0.2), rgba(46, 196, 182, 0.12));
  border: 1px solid rgba(91, 124, 250, 0.35);
  box-shadow: 0 0 20px rgba(91, 124, 250, 0.15);
}

.app-navbar .nav-link {
  position: relative;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  color: rgba(232, 236, 241, 0.88) !important;
  transition: color 0.2s, background 0.2s;
}

.app-navbar .nav-link:not(.disabled):hover {
  color: #fff !important;
  background: rgba(91, 124, 250, 0.12);
}

.app-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(91, 124, 250, 0.22);
}

.app-navbar .navbar-toggler {
  border-color: rgba(148, 163, 184, 0.35);
}

.app-navbar .btn-logout {
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  border-color: rgba(148, 163, 184, 0.4);
}

.app-navbar .user-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8 !important;
}

/* Подвал */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(42, 52, 68, 0.75);
  background: rgba(8, 10, 14, 0.6);
  backdrop-filter: blur(8px);
}

.site-footer-inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.site-footer a {
  color: #7c9cff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Главная */
.landing-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(91, 124, 250, 0.25);
  background: linear-gradient(145deg, rgba(17, 24, 38, 0.95) 0%, rgba(12, 16, 26, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(46, 196, 182, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.landing-hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 120%;
  background: radial-gradient(circle, rgba(91, 124, 250, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.landing-hero .display-5 {
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.landing-hero .lead {
  position: relative;
  z-index: 1;
  max-width: 52ch;
  line-height: 1.65;
}

.landing-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2ec4b6;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(46, 196, 182, 0.35);
  background: rgba(46, 196, 182, 0.08);
  margin-bottom: 1rem;
}

.landing-actions .btn {
  border-radius: 12px;
  padding: 0.65rem 1.35rem;
  font-weight: 600;
}

.landing-actions .btn-lg {
  padding: 0.75rem 1.5rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.feature-card {
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(42, 52, 68, 0.9);
  background: rgba(15, 18, 28, 0.65);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: rgba(91, 124, 250, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #e2e8f0;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.55;
}

.feature-card .feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(91, 124, 250, 0.2), rgba(46, 196, 182, 0.12));
  border: 1px solid rgba(91, 124, 250, 0.25);
}

/* Формы входа / регистрации */
.auth-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.auth-card {
  border-radius: 18px;
  border: 1px solid rgba(42, 52, 68, 0.95);
  background: linear-gradient(165deg, rgba(17, 22, 34, 0.98) 0%, rgba(12, 14, 22, 0.99) 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.auth-card-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid rgba(42, 52, 68, 0.6);
  background: rgba(91, 124, 250, 0.06);
}

.auth-card-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-card-header p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.auth-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.auth-card .form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.auth-card .form-control {
  border-radius: 10px;
  border-color: rgba(42, 52, 68, 0.95);
  background: rgba(6, 8, 12, 0.85);
  color: #f1f5f9;
  padding: 0.6rem 0.85rem;
}

.auth-card .form-control:focus {
  border-color: rgba(91, 124, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.2);
}

.auth-card .btn-primary,
.auth-card .btn-info {
  border-radius: 10px;
  padding: 0.65rem;
  font-weight: 600;
}

/* Алерты */
.alert {
  border-radius: 12px;
  border: none;
}

/* Контейнер сообщений */
.messages-wrap {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
}

.messages-wrap .btn-close {
  filter: invert(1);
  opacity: 0.55;
}

.messages-wrap .btn-close:hover {
  opacity: 0.85;
}

/* Водяной знак (имя / подпись проекта) */
.site-watermark {
  position: fixed;
  right: 0.35rem;
  bottom: 2.5rem;
  z-index: 2;
  pointer-events: none;
  transform: rotate(-12deg);
  transform-origin: 100% 100%;
  font-size: clamp(0.65rem, 1.1vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 236, 241, 0.09);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  max-width: 60vw;
  text-align: right;
  white-space: pre-wrap;
  user-select: none;
}
