/* ==========================
   Общие переменные
   ========================== */
:root {
  --color-bg: #000;
  --color-text: #f0f0f0;
  --color-text-dark: #111111;
  --color-gold: #c09c6b;
  --color-gold-rgb: 192, 156, 107;
  --color-border: #705830;

  --blur-weak: 2px;
  --blur-strong: 6px;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 15px;

  --nav-link-hover-glow: rgba(255, 68, 68, 0.7);
}

/* ==========================
   Базовые стили
   ========================== */
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  position: relative;
  overflow-x: hidden;
  color: var(--color-text);
}

/* ==========================
   Шрифты
   ========================== */
.oranienbaum { font-family: "Oranienbaum", serif; font-style: normal; }
.oranienbaum-regular { font-family: "Oranienbaum", serif; font-weight: 400; font-style: normal; }
.montserrat { font-family: "Montserrat", sans-serif; font-weight: 400; font-style: normal; }
.font-oranienbaum { font-family: "Oranienbaum", serif; }
.font-montserrat { font-family: "Montserrat", sans-serif; }

/* ==========================
   Общие элементы
   ========================== */
.block-title {
  text-transform: uppercase;
  font-weight: 600;
}

.btn-hover-animate:hover {
  font-size: 1.0625rem;
  transform: translateY(-1px) scale(1.02);
}

.form-button {
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 1px;
  background-color: var(--color-gold);
  color: var(--color-bg);
  border-color: var(--color-border);
  transition: color .2s ease-in-out,
              background-color .2s ease-in-out,
              border-color .2s ease-in-out,
              box-shadow .2s ease-in-out;
}
.form-button:hover {
  color: var(--color-gold);
  transform: translateY(-1px) scale(1.02);
}

.blur-bg {
  backdrop-filter: blur(var(--blur-weak));
  -webkit-backdrop-filter: blur(var(--blur-weak));
}

/* ==========================
   Фоновые слои
   ========================== */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1536px;
  height: 1024px;
  background: url("background.webp") no-repeat center top;
  background-size: contain;
  pointer-events: none;
  mask-repeat: no-repeat;
  mask-size: cover;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: cover;
}
body::before {
  z-index: -2;
  -webkit-mask-image:
    linear-gradient(to right,
      rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%),
    linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  -webkit-mask-composite: destination-in;
  mask-image:
    linear-gradient(to right,
      rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%),
    linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  mask-composite: intersect;
}
body::after {
  z-index: -1;
  -webkit-mask-image:
    linear-gradient(to left,
      rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%),
    linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  -webkit-mask-composite: destination-in;
  mask-image:
    linear-gradient(to left,
      rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%),
    linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  mask-composite: intersect;
}

/* ==========================
   Header и навигация
   ========================== */
header {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding-top: 20px;
}
.logo-img {
  max-width: 400px;
  max-height: 400px;
  margin-bottom: 10px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  max-width: 1140px;
  margin: 0 auto;
  background-color: rgba(0,0,0,0.6);
  border-radius: var(--radius-lg);
  padding: 6px 16px;
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
}
@media (min-width: 992px) {
  .navbar { max-width: 960px; }
}
.sticky-nav { position: sticky; top: 0; z-index: 1000; }

.nav-item {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-link {
  color: var(--color-text) !important;
  transition: color 0.25s ease, text-shadow 0.25s ease, transform .18s;
}
.navbar-expand-lg .navbar-nav .nav-link.force {
  padding: 0 15px;
  font-size: 1.2rem;
}
.nav-link:hover {
  color: var(--color-gold) !important;
  text-shadow: 0 0 8px var(--nav-link-hover-glow);
  transform: translateY(-2px) scale(1.1);
}

/* Blocks */
.block h2 {
  font-size: 1.5rem;
}

.block {
  background-color: rgba(0,0,0,0.5);
  border-radius: var(--radius-md);
  padding: 15px;
  animation: fadeIn 0.8s ease;
  backdrop-filter: blur(var(--blur-weak));
  -webkit-backdrop-filter: blur(var(--blur-weak));
}

.link-gold {
  color: var(--color-gold);
}

.link-gold:hover,
.link-gold:focus {
  color: var(--bs-btn-hover-bg);
}


/* ==========================
   Mobile menu (toggler)
   ========================== */
.navbar-toggler {
  border: 0;
  padding: 0.25rem 0.5rem;
}
.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--color-gold-rgb), 0.6);
  border-radius: 4px;
}
.toggler-box {
  position: relative;
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  color: currentColor;
  --blade-thick-closed: 2px;
  --blade-thick-open: 3px;
  --cross-x: 70%;
  --guard-x: 20%;
  --guard-length: 8px;
  --guard-thick-closed: 2px;
  --guard-thick-open: 3px;
}
.toggler-line {
  position: absolute;
  left: 50%;
  width: 100%;
  height: var(--blade-thick-closed);
  background-color: currentColor;
  border-radius: 1px;
  transform: translateX(-50%);
  transition: transform 0.35s ease, opacity 0.25s ease,
              top 0.35s ease, height 0.35s ease;
  transform-origin: 50% 50%;
}
.toggler-line.top    { top: 25%; }
.toggler-line.middle { top: 50%; }
.toggler-line.bottom { top: 75%; }
.toggler-line::before {
  content: "";
  position: absolute;
  width: var(--guard-thick-closed);
  height: var(--guard-length);
  background-color: currentColor;
  opacity: 0;
  transition: opacity 0.25s ease, width 0.35s ease, height 0.35s ease;
  left: var(--guard-x);
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 1px;
}
.navbar-toggler:not(.collapsed) .toggler-line {
  height: var(--blade-thick-open);
  top: 50%;
  transform-origin: var(--cross-x) 50%;
}
.navbar-toggler:not(.collapsed) .toggler-line.middle { opacity: 0; }
.navbar-toggler:not(.collapsed) .toggler-line.top { transform: translateX(-50%) rotate(45deg); }
.navbar-toggler:not(.collapsed) .toggler-line.bottom { transform: translateX(-50%) rotate(-45deg); }
.navbar-toggler:not(.collapsed) .toggler-line::before {
  opacity: 1;
  width: var(--guard-thick-open);
  height: calc(var(--guard-length) + 2px);
}
.navbar-toggler:not(.collapsed) .toggler-line,
.navbar-toggler:not(.collapsed) .toggler-line:before {
  background-color: #c2c2c2;
}
.navbar-toggler:not(.collapsed) .toggler-box { transform: rotate(90deg); }
.navbar-toggler:focus { outline: none; box-shadow: none; }

/* Form styles */

/* Общие стили для текстовых полей, select и textarea */
.form-colored input:not([type="radio"]):not([type="checkbox"]),
.form-colored select,
.form-colored textarea {
  background: transparent;
  border: 1px solid var(--color-gold);
  color: var(--color-text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* Фокус */
.form-colored input:not([type="radio"]):not([type="checkbox"]):focus,
.form-colored select:focus,
.form-colored textarea:focus {
  background-color: transparent;
  outline: none;
  color: var(--color-text);
  border-color: var(--color-gold);
  box-shadow: 0 2px 0 var(--color-gold);
}

/* Placeholder */
.form-colored input::placeholder,
.form-colored textarea::placeholder {
  color: var(--color-gold);
}
.form-colored input::-webkit-input-placeholder,
.form-colored textarea::-webkit-input-placeholder {
  color: var(--color-gold);
}
.form-colored input::-moz-placeholder,
.form-colored textarea::-moz-placeholder {
  color: var(--color-gold);
}
.form-colored input:-ms-input-placeholder,
.form-colored textarea:-ms-input-placeholder {
  color: var(--color-gold);
}
.form-colored input::-ms-input-placeholder,
.form-colored textarea::-ms-input-placeholder {
  color: var(--color-gold);
}

#togglePassword {color: var(--color-gold);}

/* Радио и чекбоксы */
.form-colored .form-check-input {
  background-color: transparent;
  border-color: var(--color-gold);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-colored .form-check-input:checked {
  background-color: rgba(255, 215, 0, 0.6); /* мягкий золотой */
  border-color: var(--color-gold);
}

.form-colored .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(255, 215, 0, 0.25); /* мягкая тень */
  border-color: var(--color-gold);
}

/* Выпадающее меню select */
.form-colored select option {
  background-color: #111; /* тёмный фон */
  color: var(--color-text);
}

/* Автозаполнение Chrome */
.form-colored input:-webkit-autofill,
.form-colored textarea:-webkit-autofill,
.form-colored select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #222 inset; /* базовый тёмный фон */
  -webkit-text-fill-color: var(--color-text);
  transition: background-color 0.3s ease, -webkit-box-shadow 0.3s ease;
}

/* При фокусе — Chrome всё равно даёт светло‑серый фон,
   поэтому текст делаем тёмным для читаемости */
.form-colored input:-webkit-autofill:focus,
.form-colored textarea:-webkit-autofill:focus,
.form-colored select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #ddd inset, 0 0 0 2px rgba(192, 156, 107, 0.4);
  -webkit-text-fill-color: var(--color-text-dark); /* тёмный текст */
}


/* Кнопки */
.form-colored .btn-secondary:hover {
  font-size: 1.0625rem;
  transform: translateY(-1px) scale(1.02);
}



/* ==========================
   Адаптивные правила
   ========================== */
@media (max-width: 1536px) {
  body::before,
  body::after {
    width: 100%;
    height: auto;
    max-height: 1024px;
    aspect-ratio: 1536 / 1024;
    background-size: cover;
    -webkit-mask-image: linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 96%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 96%, rgba(0,0,0,0) 100%);
  }
  body::before {
    -webkit-mask-image: linear-gradient(to right,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
    -webkit-mask-composite: destination-in;
    mask-image: linear-gradient(to right,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
    mask-composite: intersect;
  }
  body::after {
    -webkit-mask-image: linear-gradient(to left,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
    -webkit-mask-composite: destination-in;
    mask-image: linear-gradient(to left,
      rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 60%);
    mask-composite: intersect;
  }
  .logo-img { max-width: 300px; max-height: 300px; }
}
@media (max-width: 1024px) {
  body::before,
  body::after {
    width: 1024px;
    height: 683px; /* пропорции 1536:1024 */
    left: 50%;
    transform: translateX(-50%);
    background-size: cover;
  }
  .navbar-dark { margin-top: -100px; }
}

@media (max-width: 767.98px) {
  .navbar-collapse {
    flex: 1 1 100%;
    width: 100% !important;
    justify-content: stretch !important;
  }
  .navbar-nav {
    flex: 1 1 100%;
    width: 100%;
    flex-direction: column;
  }
  .navbar-nav .nav-item {
    width: 100%;
    text-align: center;
  }
}


@media (max-width: 600px) {
  body::before { left: 62%; }
  body::after { left: 45%; }
  body::before,
  body::after { width: 768px; height: 512px; }
}

/* ==========================
   Анимации
   ========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}