:root {
  --bg-deep: #03050c;
  --bg-panel: #0a0f1a;
  --border: rgba(212, 175, 55, 0.22);
  --gold: #d4af37;
  --gold-dim: #9a7b2c;
  --accent: #2d6a4f;
  --accent-glow: rgba(45, 106, 79, 0.45);
  --text: #e8ecf4;
  --muted: #8b95a8;
  --safe-x: max(1rem, env(safe-area-inset-left, 0px));
  --safe-r: max(1rem, env(safe-area-inset-right, 0px));
  --safe-t: max(0.5rem, env(safe-area-inset-top, 0px));
  --safe-b: max(0.75rem, env(safe-area-inset-bottom, 0px));
  --touch-min: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.65;
  font-size: clamp(1rem, 2.8vw, 1.0625rem);
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.15);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  z-index: 9999;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 85% 55% at 50% 12%, black 25%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: fixed;
  width: min(95vw, 640px);
  height: min(95vw, 640px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  top: -18%;
  right: -20%;
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
}

header, main, footer { position: relative; z-index: 1; }

.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-left: var(--safe-x);
  padding-right: var(--safe-r);
}

header {
  padding: calc(0.85rem + var(--safe-t)) 0 0.85rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(3, 5, 12, 0.82);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  min-height: var(--touch-min);
}

.brand-logo {
  height: clamp(36px, 9vw, 48px);
  width: auto;
  max-width: min(140px, 40vw);
  object-fit: contain;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 2px solid var(--gold);
  border-radius: 4px;
  display: none;
  place-items: center;
  font-family: Orbitron, sans-serif;
  font-weight: 900;
  font-size: 0.6rem;
  color: var(--gold);
}

.brand-mark.is-visible { display: grid; }

.brand-text {
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  letter-spacing: 0.12em;
}

.nav-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-legal a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

.nav-legal a:hover { color: var(--gold); }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.lang-switch button {
  font-family: Orbitron, sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 0.6rem;
  min-height: var(--touch-min);
  min-width: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
}

.legal-main {
  padding: clamp(1.75rem, 5vw, 3rem) 0 clamp(2.5rem, 8vw, 4rem);
}

.legal-panel {
  max-width: 42rem;
  margin: 0 auto;
  background: linear-gradient(145deg, var(--bg-panel) 0%, #060a12 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.legal-panel h1 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.legal-panel h2 {
  font-family: Orbitron, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 1.5rem 0 0.65rem;
}

.legal-panel p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.legal-panel ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

.legal-panel li { margin-bottom: 0.35rem; }

.legal-panel a.mail {
  color: var(--gold);
  text-decoration: none;
  word-break: break-all;
}

.legal-panel a.mail:hover { text-decoration: underline; }

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.back-home:hover { opacity: 0.9; }

footer {
  padding: calc(1.5rem + var(--safe-b)) 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.foot-links a {
  color: var(--muted);
  text-decoration: none;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

.foot-links a:hover { color: var(--gold); }

/* —— Guide & FAQ pages —— */
.legal-panel.wide {
  max-width: min(52rem, 100%);
}

.page-lead {
  font-size: 1.02rem;
  color: var(--muted);
  margin: -0.35rem 0 1.35rem;
  line-height: 1.5;
  max-width: 40ch;
}

.faq-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(6, 10, 18, 0.72);
  overflow: hidden;
}

.faq-item summary {
  font-family: Orbitron, sans-serif;
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  letter-spacing: 0.05em;
  line-height: 1.35;
  padding: 0.95rem 1.15rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--touch-min);
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  margin-left: auto;
  flex-shrink: 0;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.faq-item[open] summary::after { content: "\2212"; }

.faq-item .faq-a {
  margin: 0;
  padding: 0 1.15rem 1.05rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
  padding-top: 0.85rem;
}

.guide-steps { margin-top: 0.25rem; }

.guide-step {
  margin-bottom: 1.4rem;
  padding: 0 0 0 1rem;
  border-left: 3px solid rgba(45, 106, 79, 0.9);
}

.guide-step h2 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 0.5rem;
  text-transform: none;
  line-height: 1.3;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.guide-tips-box {
  margin-top: 1.5rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(45, 106, 79, 0.08) 100%);
}

.guide-tips-box h2 {
  font-family: Orbitron, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.guide-tips-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-tips-box li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  line-height: 1.45;
}

.guide-tips-box li:last-child { margin-bottom: 0; }

.guide-tips-box li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  background: #c1121f;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(193, 18, 31, 0.45);
}

/* —— 404 error —— */
.error-main {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 2.5rem) var(--safe-x);
}

.error-card {
  text-align: center;
  max-width: 32rem;
  width: 100%;
  padding: clamp(1.75rem, 5vw, 2.5rem) clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: linear-gradient(160deg, var(--bg-panel) 0%, #050810 100%);
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.error-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c1121f, var(--gold), #c1121f, transparent);
  opacity: 0.85;
}

.error-tag {
  font-family: Orbitron, sans-serif;
  font-size: clamp(0.55rem, 1.8vw, 0.62rem);
  letter-spacing: 0.28em;
  color: #e85d6f;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.85rem;
}

.error-code {
  font-family: Orbitron, sans-serif;
  font-size: clamp(3.5rem, 16vw, 5.75rem);
  font-weight: 900;
  line-height: 0.95;
  margin: 0 0 0.65rem;
  letter-spacing: 0.12em;
  background: linear-gradient(165deg, #f0f4fc 0%, var(--gold) 45%, #8b7355 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.15);
}

.error-card h1 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(0.78rem, 2.8vw, 0.95rem);
  letter-spacing: 0.12em;
  margin: 0 0 0.85rem;
  color: var(--text);
  line-height: 1.35;
  text-transform: uppercase;
}

.err-lead {
  color: var(--muted);
  margin: 0 0 1.65rem;
  font-size: clamp(0.94rem, 3vw, 1.02rem);
  line-height: 1.55;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.error-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.7rem 1.35rem;
  font-family: Orbitron, sans-serif;
  font-size: clamp(0.58rem, 2vw, 0.65rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.error-actions a:active {
  transform: scale(0.98);
}

.error-actions .btn-home {
  background: linear-gradient(165deg, var(--accent) 0%, #1b4332 100%);
  color: #f0fdf4;
  border-color: rgba(45, 106, 79, 0.55);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.error-actions .btn-home:hover {
  box-shadow: 0 6px 28px var(--accent-glow);
}

.error-actions .btn-ghost {
  background: rgba(10, 15, 26, 0.6);
  color: var(--gold);
  border-color: var(--border);
}

.error-actions .btn-ghost:hover {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.06);
}

.error-foot-note {
  margin-top: 1.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.85;
}
