:root {
  --bg-1: #0b1220;
  --card: rgba(255, 255, 255, 0.06);
  --text: #f4f7ff;
  --muted: #b8c2dc;
  --accent: #18c29c;
  --accent-2: #48a8ff;
  --warning: #ff9f43;
  --error: #ff4d4d;
  --border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  opacity: 0; /* Скрыто по умолчанию для предотвращения мерцания */
}

body.lang-ready {
  opacity: 1;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

.loader-bar {
  width: 150px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Плаваючі сфери (Background effects) */
body::before, body::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.35;
}

body::before {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -10%;
  left: -10%;
  animation: float 12s infinite alternate ease-in-out;
}

body::after {
  width: 350px;
  height: 350px;
  background: var(--accent-2);
  bottom: -5%;
  right: -5%;
  animation: float 15s infinite alternate-reverse ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10%, 15%) scale(1.2); }
}

/* Common Containers */
.container, .wrap {
  width: 100%;
  background: rgba(18, 27, 47, 0.70);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 36px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  position: relative;
}

.wrap {
  max-width: 500px;
  text-align: center;
  padding: 40px 32px;
}

.container {
  max-width: 860px;
}

/* Common Links and Buttons */
.link, .btn {
  text-decoration: none;
  color: var(--text);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  cursor: pointer;
}

.link:hover, .btn:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.primary, .btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1220;
  font-weight: 700;
}

.primary:hover, .btn-primary:hover {
  box-shadow: 0 0 20px rgba(24, 194, 156, 0.4);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* Typography */
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.foot, .footer-note {
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.foot::before {
  content: "© BENGAL STORE";
  font-weight: 700;
  color: var(--accent);
}

.foot::after {
  content: "EST. 2024";
  font-size: 10px;
  opacity: 0.5;
}

.subtitle {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

/* No prefix for main page h1 */
.wrap h1::before {
  content: none;
}

/* Navigation */
.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.ghost-link, .back-link, .home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  transition: .2s;
  background: rgba(24, 194, 156, 0.05);
  font-weight: 600;
  font-size: 14px;
}

.home-link::before {
  font-family: "Font Awesome 6 Free";
  content: "\f015"; /* fa-home */
  font-weight: 900;
}

.ghost-link:hover, .back-link:hover, .home-link:hover {
  color: #0b1220;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}


/* Sections and Notices */
.notice, .intro-warn {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 26px;
  font-size: 14px;
}

/* Accordion (Details/Summary) Styles */
details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

details[open] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

summary {
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 600;
  font-size: 17px;
  color: var(--accent);
  transition: .2s;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: auto;
  font-size: 12px;
  transition: .3s;
  color: var(--muted);
}

details[open] summary::after {
  transform: rotate(180deg);
  color: var(--accent);
}

summary i {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.details-content {
  padding: 0 20px 20px 59px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.details-content p {
  margin: 0 0 12px;
}

.details-content p:last-child {
  margin-bottom: 0;
}

.details-content b {
  color: var(--text);
}

.details-content .highlight {
  color: var(--warning);
  font-weight: 600;
}

/* Rules List Styles (Payments page) */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: .3s;
}

.rule-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-box {
  min-width: 48px;
  width: 48px;
  height: 48px;
  background: rgba(24, 194, 156, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
}

.rule-content {
  flex: 1;
}

.rule-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--accent);
  font-weight: 700;
}

.rule-content p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.notice {
  background: rgba(255, 159, 67, 0.12);
  border: 1px solid rgba(255, 159, 67, 0.35);
  border-left: 4px solid var(--warning);
  color: #ffe3c2;
}

.intro-warn {
  background: rgba(255, 77, 77, 0.1);
  border-left: 4px solid var(--error);
  color: var(--text);
}

.section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* Language Selector - INTEGRATED */
.lang-switcher {
  display: flex !important;
  justify-content: flex-end !important;
  margin-bottom: 10px !important;
  position: relative !important;
  z-index: 100 !important;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: 0.2s !important;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.lang-dropdown {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  background: #1a243a !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  margin-top: 5px !important;
  display: none !important;
  flex-direction: column !important;
  min-width: 60px !important;
  overflow: hidden !important;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5) !important;
}

.lang-switcher.active .lang-dropdown {
  display: flex !important;
}

.lang-option {
  padding: 8px 12px !important;
  cursor: pointer !important;
  color: var(--text) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid/Lists */
.links, .actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Responsive */
@media (max-width: 640px) {
  .container, .wrap {
    padding: 24px;
    border-radius: 24px;
  }
  
  h1 {
    font-size: 24px;
  }
}
