/* ============================================
   ICT BOT LANDING — CSS SYSTEM
   Mobile First | Dark Theme | Trading Aesthetic
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Colors */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-terminal: #0d1117;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #f1f5f9;

  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.3);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --red-deep: #dc2626;

  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.25);

  --purple: #a78bfa;
  --orange: #f97316;
  --yellow: #eab308;

  --border: #1e293b;
  --divider: #334155;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --content-max-width: 720px;
  --section-padding: 3rem 1.25rem;
  --block-gap: 2rem;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* --- Layout --- */
.landing-main {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.section {
  padding: var(--section-padding);
}

/* --- Section Divider --- */
.section-divider {
  max-width: var(--content-max-width);
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--divider);
  opacity: 0.5;
}

/* --- Typography --- */
.section h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-accent);
  margin-bottom: 1.25rem;
}

.section p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.section p:last-child {
  margin-bottom: 0;
}

/* Emphasis */
.text-accent {
  color: var(--text-accent);
  font-weight: 600;
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-muted {
  color: var(--text-muted);
}

strong {
  color: var(--text-accent);
  font-weight: 700;
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 640px) {
  :root {
    --section-padding: 4rem 2rem;
  }

  .section h1 {
    font-size: 2.25rem;
  }

  .section h2 {
    font-size: 1.6rem;
  }
}

/* --- Responsive: Desktop --- */
@media (min-width: 1024px) {
  :root {
    --section-padding: 5rem 2rem;
  }

  .section h1 {
    font-size: 2.5rem;
  }
}

/* ============================================
   БЛОК 2: Симулятор лудомана
   ============================================ */

.simulator {
  position: relative;
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.simulator__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.simulator__balance,
.simulator__pnl {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.simulator__pnl {
  text-align: right;
}

.simulator__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.simulator__value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-accent);
}

.simulator__value--positive {
  color: var(--green);
}

.simulator__value--negative {
  color: var(--red);
}

.simulator__value--neutral {
  color: var(--text-muted);
}

/* Canvas */
.simulator__chart {
  display: block;
  width: 100%;
  height: 280px;
  background: var(--bg-terminal);
}

/* Кнопки управления */
.simulator__controls {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.simulator__btn {
  flex: 1;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.simulator__btn:active {
  transform: scale(0.97);
}

.simulator__btn--long {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 16px var(--green-glow);
}

.simulator__btn--short {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 16px var(--red-glow);
}

/* Кнопка «Усреднить» */
.simulator__average-wrap {
  padding: 0.75rem 1rem;
}

.simulator__btn--average {
  width: 100%;
  padding: 1.1rem;
  background: var(--red-deep);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 0 20px var(--red-glow);
  animation: pulse-average 1s ease-in-out infinite;
}

@keyframes pulse-average {
  0%, 100% { box-shadow: 0 0 20px var(--red-glow); }
  50% { box-shadow: 0 0 40px var(--red-glow), 0 0 60px rgba(239, 68, 68, 0.15); }
}

/* Финальный оверлей */
.simulator__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(220, 38, 38, 0.92);
  backdrop-filter: blur(4px);
  z-index: 10;
  animation: fade-in 0.6s ease;
}

.simulator__overlay-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  text-align: center;
}

/* Текст после симулятора */
.simulator__aftermath {
  margin-top: 1.5rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Ensure hidden attribute works on flex elements */
.simulator__overlay[hidden],
.simulator__average-wrap[hidden],
.simulator__aftermath[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .simulator__chart {
    height: 340px;
  }
}

/* ============================================
   БЛОК 3 & 5: Калькуляторы (общие стили)
   ============================================ */

.calculator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  margin: 1.5rem 0;
}

.calculator__slider-group {
  margin-bottom: 1.5rem;
}

.calculator__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.calculator__slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calculator__range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.calculator__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
}

.calculator__range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
}

.calculator__output {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-accent);
  min-width: 3rem;
  text-align: right;
}

.calculator__result {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.calculator__result p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.calculator__result-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-accent);
  margin-bottom: 0.75rem !important;
}

.calculator__result-cta {
  margin-top: 0.75rem !important;
  font-weight: 600;
  color: var(--text-accent);
  font-style: italic;
}

/* ============================================
   БЛОК 4: Скриншоты-заглушки
   ============================================ */

.proof-screenshot {
  margin: 1.25rem 0;
}

.proof-screenshot__placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--divider);
  border-radius: 8px;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   БЛОК 4: Рентген рынка (X-Ray)
   ============================================ */

.xray {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

/* Toggle row */
.xray__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.xray__toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-accent);
  transition: opacity 0.3s;
}

/* Custom toggle switch */
.xray__switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.xray__switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.xray__switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 14px;
  transition: background 0.3s;
}

.xray__switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.xray__switch input:checked + .xray__switch-slider {
  background: var(--accent);
}

.xray__switch input:checked + .xray__switch-slider::before {
  transform: translateX(24px);
}

/* Chart area */
.xray__chart-wrap {
  position: relative;
}

.xray__chart {
  display: block;
  width: 100%;
  height: 300px;
  background: var(--bg-terminal);
}

/* Scanner animation */
.xray__scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.6),
    rgba(59, 130, 246, 0.9),
    rgba(59, 130, 246, 0.6),
    transparent
  );
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  z-index: 5;
}

.xray__scanner[hidden] {
  display: none !important;
}

@keyframes xray-scan {
  from { left: 0; }
  to { left: 100%; }
}

@media (min-width: 640px) {
  .xray__chart {
    height: 380px;
  }
}

/* ============================================
   БЛОК 5: Калькулятор безопасности (специфичные стили)
   ============================================ */

.safety-calc__input-group {
  margin-bottom: 1.25rem;
}

.safety-calc__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.safety-calc__currency {
  position: absolute;
  left: 1rem;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.safety-calc__input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-accent);
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.safety-calc__input::-webkit-outer-spin-button,
.safety-calc__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.safety-calc__input:focus {
  border-color: var(--accent);
}

.safety-calc__highlight {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.5rem !important;
}

/* Grid of 69 squares */
.safety-calc__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 1rem 0;
  justify-content: center;
}

.safety-calc__square {
  width: 14px;
  height: 14px;
  background: var(--red);
  border-radius: 2px;
  opacity: 0.7;
}

.safety-calc__footnote {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* ============================================
   БЛОК 6: CTA-кнопка и Trust Badges
   ============================================ */

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1.15rem 1.5rem;
  margin: 1.5rem 0;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.cta-btn:active {
  transform: scale(0.98);
}

.cta-btn__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.trust-badges__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.trust-badges__icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

@media (min-width: 640px) {
  .trust-badges {
    flex-direction: row;
  }

  .trust-badges__item {
    flex: 1;
  }
}
