/* ЕДР Design System — main.css
   Tokens, reset, typography, utilities */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Colors */
  --bg:            #030907;
  --surface:       #08120e;
  --card:          #0e1a14;
  --card-hover:    #16261d;
  --border:        #1f3328;
  --border-light:  #2d4a39;

  /* Accent */
  --accent:        #3ecf8e;
  --accent-dim:    rgba(62, 207, 142, 0.15);
  --accent-hover:  #00c573;
  --accent-alt:    #1f4b37;
  --accent-alt-dim: rgba(31, 75, 55, 0.15);
  --crimson:       #fc1c46;

  /* Text */
  --text:          #ffffff;
  --text-muted:    #cccccc;
  --text-faint:    #4c4c4c;

  /* Status */
  --success:       #3ecf8e;
  --success-dim:   rgba(62, 207, 142, 0.12);
  --warning:       #fbbf24;
  --warning-dim:   rgba(251, 191, 36, 0.12);
  --error:         #f87171;
  --error-dim:     rgba(248, 113, 113, 0.12);
  --info:          #60a5fa;
  --info-dim:      rgba(96, 165, 250, 0.12);

  /* Glow / shadows (removed for flat design) */
  --shadow-sm:     none;
  --shadow-md:     none;
  --shadow-lg:     none;
  --shadow-accent: none;
  --shadow-alt:    none;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Typography */
  --font: 'Old Soviet', serif;
  --font-display: 'Capture It', sans-serif;
  --font-mono: var(--font);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  letter-spacing: -0.02em;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

img {
  max-width: 100%;
  display: block;
}

button { cursor: pointer; font-family: inherit; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Fix autofill background in Chrome/Edge */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  transition: background-color 5000s ease-in-out 0s;
}

ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -0.04em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { color: var(--text-muted); line-height: 1.7; }

.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-accent  { color: var(--accent); }
.text-alt     { color: var(--accent-alt); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error   { color: var(--error); }
.text-sm      { font-size: 0.825rem; }
.text-xs      { font-size: 0.75rem; }
.text-lg      { font-size: 1.1rem; }
.text-xl      { font-size: 1.25rem; }
.font-medium  { font-weight: 500; }
.font-semi    { font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-mono    { font-family: var(--font-mono); }
.section-label { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; font-size: 0.8rem; color: var(--text-muted); }

/* Scrollbar */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--surface); }
::-webkit-scrollbar-thumb  { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Utility */
.hidden       { display: none !important; }
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }
.mt-sm        { margin-top: var(--space-sm); }
.mt-md        { margin-top: var(--space-md); }
.mt-lg        { margin-top: var(--space-lg); }
.mb-md        { margin-bottom: var(--space-md); }
.w-full       { width: 100%; }
.truncate     { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Page loading overlay */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}
#page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.loader-logo {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
