@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root, [data-theme="light"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --hero-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}

[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-light: #1e293b;
  --primary-50: #1e293b;
  --primary-100: #1e3a5f;
  --primary-200: #1e40af;
  --primary-500: #60a5fa;
  --primary-600: #3b82f6;
  --primary-700: #93c5fd;
  --primary-900: #dbeafe;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --bg: #0f172a;
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* ======================== */
/*  КНОПКИ                   */
/* ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary-200);
}
.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}
.btn-outline:active {
  transform: scale(0.97);
}
.btn-white {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-md);
}
.btn-white:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
}
.profile-logout-btn {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.profile-delete-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
  cursor: pointer;
  transition: all 0.2s;
}
.profile-delete-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* ======================== */
/*  ПОЛЯ ВВОДА              */
/* ======================== */
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
input::placeholder { color: #94a3b8; }

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.375rem;
}

input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ======================== */
/*  АНИМАЦИИ                 */
/* ======================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.animate-in    { animation: fadeInUp 0.6s ease-out both; }
.animate-fade  { animation: fadeIn 0.5s ease-out both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.animate-scale { animation: scaleIn 0.3s ease-out both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--primary-50) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
.skeleton-line { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-circle { width: 3rem; height: 3rem; border-radius: 50%; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ======================== */
/*  ГЛАВНАЯ СТРАНИЦА         */
/* ======================== */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Шапка */
.topbar {
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  background: var(--hero-gradient);
}
.topbar-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.01em;
}
.topbar-link {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.topbar-link:hover {
  color: #fff;
}

/* Герой */
.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
  padding: 2rem;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.hero-grid {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Левая часть — текст */
.hero-text { color: #fff; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.95);
  padding: 0.375rem 1rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
}
.hero-text h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.hero-text p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  max-width: 28rem;
  margin-bottom: 2rem;
}
.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hero-features li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.85);
}
.hero-features li .icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

/* Правая часть — форма */
.hero-form-card {
  background: var(--bg-card);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.hero-form-card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.25rem;
}
.hero-form-card .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}
.hero-form-card .field { margin-bottom: 1.125rem; }
.hero-form-card .btn {
  width: 100%;
  padding: 0.8125rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}
.hero-form-card .form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.hero-form-card .divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.hero-form-card .divider::before,
.hero-form-card .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Карточки «как работает» */
.how-section {
  background: var(--bg-page);
  padding: 4rem 2rem;
}
.how-section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.how-section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  transition: box-shadow 0.25s, transform 0.25s;
}
.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}
.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.step-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Футер */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg);
}
.footer-links { margin-top: 0.5rem; }
.footer-links a {
  color: var(--text-muted);
  margin: 0 0.5rem;
  font-size: 0.8125rem;
}
.footer-links a:hover { color: var(--primary); }

/* ======================== */
/*  СТРАНИЦА РЕГИСТРАЦИИ     */
/* ======================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-page);
}
.auth-left {
  flex: 1;
  background: var(--hero-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.auth-left-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 24rem;
}
.auth-left-content h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.auth-left-content p {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
}
.auth-right {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-page);
  overflow-y: auto;
  max-height: 100vh;
}
.auth-box {
  width: 100%;
  max-width: 26rem;
  background: var(--bg-card);
  border-radius: 1rem;
  margin: auto 0;
  padding: 2rem;
}
.auth-box .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.auth-box .back-link:hover { color: var(--primary); }
.auth-box h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.auth-box .sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.auth-form .field { margin-bottom: 1.125rem; }
.auth-form .btn {
  width: 100%;
  padding: 0.8125rem;
  margin-top: 0.375rem;
}

/* Чекбоксы */
.checkbox-group { margin-top: 0.5rem; margin-bottom: 1.25rem; }
.auth-checkbox {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin-bottom: 0.875rem;
  cursor: pointer;
}
.auth-checkbox input { margin-top: 0.1875rem; }
.auth-checkbox span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-checkbox a { font-weight: 500; }

.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.error-msg {
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* ======================== */
/*  ДОКУМЕНТЫ                */
/* ======================== */
.doc {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  color: var(--text);
  background: var(--bg-page);
  min-height: 100vh;
}
.doc h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.125rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.doc p  { margin: 0 0 1rem; color: var(--text-muted); line-height: 1.7; }

/* ======================== */
/*  АДАПТИВ                  */
/* ======================== */
/* field-row for register */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-features { align-items: center; }
  .hero-form-card { max-width: 420px; margin: 0 auto; }

  .auth-left { display: none; }
  .auth-right { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 1rem 1.25rem; }
  .hero-section { padding: 1.5rem 1rem; }
  .hero-form-card { padding: 1.75rem 1.25rem; }
  .how-section { padding: 2.5rem 1rem; }
}

/* ======================== */
/*  THEME TOGGLE              */
/* ======================== */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.125rem;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--primary-50);
  color: var(--primary);
  border-color: var(--primary-200);
}

/* ======================== */
/*  COUNTDOWN TIMER           */
/* ======================== */
.countdown {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.countdown-unit {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: 0.625rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
  min-width: 3.5rem;
}
.countdown-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.countdown-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.countdown-expired {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ======================== */
/*  SHARE SOCIALS             */
/* ======================== */
.share-socials {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}
.share-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.share-social-btn svg { width: 20px; height: 20px; }
.share-social-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.share-social-btn.tg { background: #2AABEE; }
.share-social-btn.vk { background: #0077FF; }
.share-social-btn.wa { background: #25D366; }
.share-social-btn.email-share { background: #64748b; }

/* ======================== */
/*  OAUTH BUTTONS              */
/* ======================== */
.oauth-divider { display:flex; align-items:center; gap:0.75rem; margin:1.25rem 0; color:var(--text-muted); font-size:0.8125rem; }
.oauth-divider::before, .oauth-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.oauth-buttons { display:flex; flex-direction:column; gap:0.5rem; }
.btn-oauth { display:flex; align-items:center; justify-content:center; gap:0.625rem; width:100%; padding:0.625rem 1rem; border-radius:0.625rem; border:1.5px solid var(--border); background:var(--bg-card); color:var(--text); font-size:0.875rem; font-weight:500; cursor:pointer; transition:all 0.2s; }
.btn-oauth:hover { border-color:var(--primary-200); background:var(--primary-50); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
.btn-oauth svg, .btn-oauth img { width:20px; height:20px; flex-shrink:0; }
.btn-oauth.yandex:hover { border-color:#fc0; }
.btn-oauth.telegram:hover { border-color:#27A7E7; }
.btn-oauth.google:hover { border-color:#4285f4; }

/* ======================== */
/*  SMOOTH TRANSITIONS        */
/* ======================== */
body, .sidebar, .main-header, .modal, .step-card, .hero-form-card,
.stat-card, .action-card, .poll-item, .profile-card, input, select {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* ======================== */
/*  TOAST NOTIFICATION        */
/* ======================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(8px); }
}
