/* style.css - Compact & Optimized v2.0 */

/* ===============================================
   1. ЗМІННІ (VARIABLES) & THEMES
   =============================================== */
:root {
  /* --- Fonts & Basics --- */
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;       /* Зменшено з 16px */
  --radius-sm: 8px;     /* Зменшено з 10px */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Швидша анімація */
  
  /* --- Colors: Brand --- */
  --brand: #22d3ee;
  --brand-2: #8b5cf6;
  --brand-grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --telegram: #229ED9;
  --viber: #7360f2;

  /* --- DARK THEME (Default) --- */
  --bg-body: #0b1220;
  --bg-card: rgba(15, 23, 42, 0.9); /* Менш прозорий для читабельності */
  --bg-input: #0e1629;
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inv: #0f172a; 

  --border-light: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.06);
  
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  
  --hdr-bg: rgba(11, 18, 32, 0.85); 
  
  /* Grad text colors */
  --grad-start: #bff7ff;
  --grad-end: #d9d0ff;
}

/* --- LIGHT THEME --- */
html.light-mode {
  --bg-body: #f4f7fa;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inv: #ffffff;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-input: #cbd5e1;
  --chip-bg: rgba(0, 0, 0, 0.05);

  --shadow: 0 10px 30px rgba(100, 116, 139, 0.1);

  --hdr-bg: rgba(255, 255, 255, 0.85);

  --grad-start: var(--brand);
  --grad-end: var(--brand-2);
}

/* ===============================================
   2. RESET & BASE
   =============================================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5; /* Більш компактний інтервал */
  font-size: 14px;  /* Базовий шрифт зменшено */
  
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* Background Blobs */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -2;
  background: 
    radial-gradient(800px circle at 15% 10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(800px circle at 85% 80%, rgba(139, 92, 246, 0.12), transparent 60%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

/* ===============================================
   3. LAYOUT & UI COMPONENTS
   =============================================== */
.container {
  width: 100%;
  max-width: 1140px; /* Трохи вужчий контейнер */
  margin: 0 auto;
  padding: 0 16px;
}

/* Page Wrapper (Fix Sticky Footer) */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 0;
}

/* --- Buttons --- */
.btn, .bln-btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; /* Компактні кнопки */
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
  transition: var(--transition);
  text-align: center;
  height: 40px; /* Фіксована висота */
}

.btn:hover, .bln-btn:hover {
  transform: translateY(-2px);
  background: var(--chip-bg);
  border-color: var(--brand);
}

.btn.primary, .bln-btn.primary {
  background: var(--brand-grad);
  border: none;
  color: #0f172a;
}
.btn.primary:hover { opacity: 0.9; box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3); }

.btn.telegram { background: var(--telegram); color: #fff; border: none; }
.btn.telegram:hover { opacity: 0.9; }

.btn.ghost { background: transparent; }

/* --- Forms (Compact Inputs) --- */
input, select, textarea {
  width: 100%;
  height: 40px; /* Зменшена висота */
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
textarea { height: auto; padding: 10px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15);
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

/* Checkbox */
input[type="checkbox"] {
  width: 18px; height: 18px;
  vertical-align: middle;
  cursor: pointer;
  -webkit-appearance: checkbox; /* Стандартний вигляд */
  appearance: checkbox;
  accent-color: var(--brand);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 24px; /* Компактні відступи */
  width: 100%;
}
.card h2 { margin-top: 0; font-size: 20px; text-align: center; margin-bottom: 20px; }

/* ===============================================
   4. HEADER (Compact & Responsive)
   =============================================== */
.bln-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 60px; /* Фіксована висота */
  display: flex; align-items: center;
}

.bln-wrap {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}

.bln-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.bln-brand img { height: 28px; width: auto; }

/* Desktop Nav */
.bln-nav { display: flex; gap: 6px; margin: 0 20px; }
.bln-nav a { 
    padding: 6px 12px; border-radius: 6px; 
    font-size: 13px; font-weight: 500; 
    color: var(--text-muted); 
    display: flex; align-items: center; gap: 6px;
}
.bln-nav a:hover { color: var(--text-main); background: var(--chip-bg); }

/* Right Actions */
.bln-cta { display: flex; gap: 10px; align-items: center; margin-left: auto; }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border-light);
  color: var(--text-muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* Burger Menu (Mobile) */
.bln-burger {
    display: none;
    width: 36px; height: 36px;
    background: transparent; border: 1px solid var(--border-light);
    border-radius: 8px; color: var(--text-main);
    font-size: 16px; cursor: pointer;
}

/* Mobile Drawer */
.bln-drawer {
    display: none;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--hdr-bg);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 20px;
    flex-direction: column; gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.bln-drawer.open { display: flex; }
.bln-drawer a {
    padding: 10px; border-radius: 8px;
    font-size: 15px; color: var(--text-main);
}
.bln-drawer a:hover { background: var(--chip-bg); }

/* ===============================================
   5. AUTH PAGES (Login/Register)
   =============================================== */
.form-wrap { 
    display: flex; 
    gap: 20px; /* Зменшено відстань між колонками */
    align-items: start; 
    justify-items: center;
}

/* Універсальна сітка для форми */
.grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 14px; /* Компактні відступи між полями */
    width: 100%;
}
.grid .full { grid-column: 1 / -1; }

.actions {
    margin-top: 20px;
    display: flex; flex-direction: column; gap: 10px;
}

/* Сповіщення */
.note { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; line-height: 1.4; }
.note.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #fca5a5; }
.note.success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.success-block { text-align: center; padding: 20px; }
.success-block i { font-size: 48px; color: var(--ok); margin-bottom: 16px; }

/* Side info card (Register page) */
.side { width: 100%; max-width: 350px; }
.side .card { background: rgba(255,255,255,0.02); border: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.chip { padding: 4px 10px; border-radius: 20px; font-size: 12px; background: var(--chip-bg); border: 1px solid var(--border-light); color: var(--text-muted); }

/* ===============================================
   6. FOOTER (Fixed Theming)
   =============================================== */
.bln-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding: 40px 0 20px;
  
  /* ВАЖЛИВО: Використовуємо змінні замість фіксованого кольору */
  background: var(--bg-card); 
  color: var(--text-muted);
  
  position: relative; 
  z-index: 10;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.bln-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    margin-bottom: 30px; 
}

/* Заголовки в футері */
.bln-footer h2 { 
    font-size: 18px; 
    color: var(--text-main); /* Адаптивний колір */
    margin: 0 0 15px; 
    display: flex; align-items: center; gap: 10px; 
    font-weight: 700;
}
.bln-footer img.footer-logo { 
    height: 28px; width: auto; 
    vertical-align: middle;
}
.bln-footer h4 { 
    font-size: 14px; 
    color: var(--text-main); /* Адаптивний колір */
    margin: 15px 0 6px; 
    font-weight: 600;
}

/* Соцмережі */
.bln-social { display: flex; gap: 10px; margin-top: 15px; }
.bln-social a {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 8px; 
  border: 1px solid var(--border-light);
  background: var(--bg-input); /* Адаптивний фон кнопок */
  color: var(--text-muted); 
  transition: all 0.2s ease;
}
.bln-social a:hover { 
    border-color: var(--brand); 
    color: var(--brand); 
    transform: translateY(-2px);
}

/* Посилання */
.bln-links { display: flex; flex-direction: column; gap: 8px; }
.bln-links a { 
    color: var(--text-muted); 
    transition: color 0.2s;
}
.bln-links a:hover { 
    color: var(--brand); 
    text-decoration: underline; 
}

/* Нижній рядок */
.bln-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  display: flex; justify-content: space-between;
  opacity: 0.8; 
  font-size: 13px;
  color: var(--text-muted);
}
.bln-bottom a { color: var(--text-main); font-weight: 500; }

/* Мобільна адаптація футера */
@media (max-width: 768px) {
    .bln-grid { grid-template-columns: 1fr; gap: 30px; }
    .bln-bottom { flex-direction: column; gap: 10px; text-align: center; }
}
/* ===============================================
   7. MEDIA QUERIES (Responsiveness)
   =============================================== */
@media (max-width: 900px) {
    .bln-nav, .bln-cta { display: none; } /* Ховаємо десктоп меню */
    .bln-burger { display: grid; place-items: center; } /* Показуємо бургер */
}

@media (max-width: 768px) {
    .form-wrap { grid-template-columns: 1fr; } /* Форма в одну колонку */
    .side { max-width: 100%; order: -1; margin-bottom: 20px; } /* Підказки зверху або прибрати order */
    .bln-grid { grid-template-columns: 1fr; gap: 20px; }
    .hero h1 { font-size: 2rem; }
    .card { padding: 20px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; } /* Поля в одну колонку на дуже малих екранах */
    .bln-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ===============================================
   8. UTILITIES
   =============================================== */
#scrollToTopBtn {
  position: fixed; bottom: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text-main); font-size: 18px; z-index: 999;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: var(--transition);
}
#scrollToTopBtn.show { opacity: 1; pointer-events: auto; }
#scrollToTopBtn:hover { border-color: var(--brand); color: var(--brand); }

/* Cookie Banner */
.cookie-consent {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    padding: 15px 0;
    z-index: 2000;
}