/* =========================================================
   MATERIAL 3 EXPRESSIVE — ТОКЕНЫ (СВЕТЛАЯ / ТЁМНАЯ ТЕМА)
   ========================================================= */
:root,
[data-theme="light"] {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-low: #f9fbff;
  --surface-container: #edf2fb;
  --surface-high: #e2eaf8;
  --surface-highest: #d6e1f4;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --on-primary: #ffffff;
  --primary-container: #dbeafe;
  --on-primary-container: #1e3a8a;

  --secondary-container: #e0e7ff;
  --on-secondary-container: #312e81;

  --tertiary-container: #d1fae5;
  --on-tertiary-container: #065f46;

  --error: #dc2626;
  --error-container: #fee2e2;
  --on-error-container: #7f1d1d;

  --success: #16a34a;
  --success-container: #dcfce7;
  --on-success-container: #14532d;

  --outline-variant: rgba(15, 23, 42, 0.09);

  --nav-glass: rgba(255, 255, 255, 0.74);
  --nav-border: rgba(37, 99, 235, 0.14);
  --nav-shadow: 0 12px 32px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.04);

  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  --fab-shadow: 0 12px 28px rgba(37, 99, 235, 0.26);

  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ease-m3: cubic-bezier(0.2, 0, 0, 1);
  --content-width: 1040px;
}

[data-theme="dark"] {
  --bg: #090d16;
  --surface: #111827;
  --surface-low: #121a2a;
  --surface-container: #172135;
  --surface-high: #1e2b45;
  --surface-highest: #263656;

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --on-primary: #091a38;
  --primary-container: #1d3a6e;
  --on-primary-container: #dbeafe;

  --secondary-container: #273255;
  --on-secondary-container: #e0e7ff;

  --tertiary-container: #0c3b32;
  --on-tertiary-container: #a7f3d0;

  --error: #f87171;
  --error-container: rgba(239, 68, 68, 0.18);
  --on-error-container: #fecaca;

  --success: #4ade80;
  --success-container: rgba(34, 197, 94, 0.18);
  --on-success-container: #bbf7d0;

  --outline-variant: rgba(255, 255, 255, 0.09);

  --nav-glass: rgba(16, 24, 42, 0.7);
  --nav-border: rgba(147, 197, 253, 0.18);
  --nav-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --card-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  --fab-shadow: 0 14px 32px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI Variable', system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s var(--ease-m3), color 0.25s var(--ease-m3);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================================================
   ШАПКА С МНОГОСЛОЙНЫМ ПАРАЛЛАКСОМ И ПЛАВНЫМ ПЕРЕХОДОМ В ФОН
   ========================================================= */
.hero-header {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 104px;
  color: #f8fafc;
  contain: layout paint;
}

.hero-parallax-bg {
  position: absolute;
  inset: -64px 0 -40px;
  background:
    radial-gradient(ellipse 68% 72% at 22% 22%, rgba(59, 130, 246, 0.68) 0%, rgba(30, 64, 175, 0.42) 38%, transparent 72%),
    radial-gradient(ellipse 56% 62% at 82% 36%, rgba(99, 102, 241, 0.42) 0%, transparent 64%),
    linear-gradient(155deg, #1d3c8c 0%, #102047 48%, #0a1226 100%);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  z-index: 0;
}

.hero-parallax-grid {
  position: absolute;
  inset: -40px 0;
  background-image: radial-gradient(rgba(191, 219, 254, 0.22) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 68%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.15) 68%, transparent 100%);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  will-change: transform;
  z-index: 0;
}

.hero-glow-1 {
  width: 360px;
  height: 360px;
  top: -110px;
  left: 8%;
  background: rgba(56, 189, 248, 0.28);
}

.hero-glow-2 {
  width: 320px;
  height: 320px;
  top: 20px;
  right: 8%;
  background: rgba(99, 102, 241, 0.26);
}

/* Плавное растворение низа шапки прямо в цвет фона страницы */
.hero-bottom-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--bg) 28%, transparent) 38%,
    color-mix(in srgb, var(--bg) 76%, transparent) 72%,
    var(--bg) 100%
  );
  pointer-events: none;
  z-index: 2;
  transition: background 0.25s var(--ease-m3);
}

.hero-custom-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--content-width);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 54px;
}

/* Переключатель темы в верхнем правом углу */
.theme-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  flex-shrink: 0;
}

.theme-top-right {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 20;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.theme-seg-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-m3), color 0.2s var(--ease-m3), transform 0.25s var(--spring);
}

.theme-top-right .theme-seg-btn {
  color: rgba(226, 232, 240, 0.78);
}

.theme-top-right .theme-seg-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.theme-top-right .theme-seg-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.theme-seg-btn:active {
  transform: scale(0.92);
}

/* Макеты смартфона и планшета (только кругляшки и док-бар) */
.devices-showcase {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
  flex-shrink: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.device-phone {
  width: 118px;
  height: 232px;
  background: rgba(15, 23, 42, 0.92);
  border: 3px solid rgba(148, 163, 184, 0.36);
  border-radius: 26px;
  padding: 10px 10px;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.45s var(--spring);
}

.device-phone:hover {
  transform: translateY(-6px);
}

.device-phone::before {
  content: "";
  width: 34px;
  height: 4px;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 99px;
  margin: 0 auto 6px;
}

.device-tablet {
  width: 326px;
  height: 220px;
  background: rgba(15, 23, 42, 0.92);
  border: 4px solid rgba(148, 163, 184, 0.36);
  border-radius: 24px;
  padding: 16px 18px 14px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.45s var(--spring);
}

.device-tablet:hover {
  transform: translateY(-6px);
}

.mock-apps {
  display: grid;
  align-content: center;
  flex: 1;
}

.mock-apps-phone {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.mock-apps-tablet {
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.mock-icon {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mock-icon.blue { background: rgba(59, 130, 246, 0.56); }
.mock-icon.purple { background: rgba(139, 92, 246, 0.54); }
.mock-icon.green { background: rgba(16, 185, 129, 0.5); }
.mock-icon.amber { background: rgba(245, 158, 11, 0.5); }
.mock-icon.cyan { background: rgba(56, 189, 248, 0.5); }

.mock-dock {
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}

.mock-dock-tablet {
  width: 62%;
  margin: 0 auto;
}

.mock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.hero-text {
  max-width: 440px;
  text-align: left;
}

.hero-text-centered {
  text-align: center;
  max-width: 640px;
}

.hero-text h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(8, 13, 26, 0.35);
}

.hero-text p {
  color: rgba(226, 232, 240, 0.92);
  font-size: 16.5px;
  line-height: 1.55;
}

/* =========================================================
   ПЛАВАЮЩЕЕ ПОЛУПРОЗРАЧНОЕ МЕНЮ M3E ПО ШИРИНЕ НИЖНЕЙ ФОРМЫ
   ========================================================= */
.nav-shell {
  position: sticky;
  top: 14px;
  z-index: 60;
  width: 100%;
  padding: 0 20px;
  margin-top: -54px;
  margin-bottom: 14px;
  pointer-events: none;
}

.main-nav {
  pointer-events: auto;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: var(--nav-glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  contain: layout style;
  transition: background-color 0.25s var(--ease-m3), border-color 0.25s var(--ease-m3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background-color 0.2s var(--ease-m3), color 0.2s var(--ease-m3), transform 0.25s var(--spring);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-high);
}

.nav-link:active {
  transform: scale(0.96);
}

.nav-link.active {
  color: var(--on-primary);
  background: var(--primary);
  font-weight: 700;
}

/* =========================================================
   ОСНОВНОЙ КОНТЕЙНЕР И КАРТОЧКИ MATERIAL 3 EXPRESSIVE
   ========================================================= */
.container {
  width: 100%;
  max-width: calc(var(--content-width) + 40px);
  margin: 0 auto;
  padding: 16px 20px 72px;
  flex: 1;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--card-shadow);
  transition: background-color 0.25s var(--ease-m3), border-color 0.25s var(--ease-m3);
}

#auth-section {
  scroll-margin-top: 90px;
}

/* =========================================================
   ГЛАВНАЯ: КРАТКИЙ ОБЗОР ЭКОСИСТЕМЫ
   ========================================================= */
.eco-intro-head {
  max-width: 680px;
  margin-bottom: 22px;
}

.eco-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.eco-intro-head h2 {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 8px;
}

.eco-intro-head p {
  font-size: 15.5px;
  color: var(--text-secondary);
}

.eco-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pillar-card {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.3s var(--spring), background-color 0.2s var(--ease-m3);
}

.pillar-card:hover {
  transform: translateY(-3px);
  background: var(--surface-high);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar-card:nth-child(2) .pillar-icon {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.pillar-card:nth-child(3) .pillar-icon {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.pillar-card h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pillar-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* =========================================================
   КОМПАКТНЫЙ БЛОК РЕГИСТРАЦИИ / ВХОДА ("КАЧЕЛЬКА" M3E)
   ========================================================= */
.auth-card-inner {
  max-width: 520px;
  margin: 0 auto;
}

.auth-head {
  text-align: center;
  margin-bottom: 22px;
}

.auth-head h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-head p {
  color: var(--text-secondary);
  font-size: 14.5px;
}

.auth-box {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: 28px;
  padding: 24px;
}

.auth-rocker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-highest);
  padding: 5px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  gap: 4px;
}

.auth-rocker-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-m3), color 0.25s var(--ease-m3), box-shadow 0.25s;
}

.auth-rocker-btn:hover:not(.active) {
  color: var(--text);
}

.auth-rocker-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

/* Поля ввода M3E */
.m3-field {
  margin-bottom: 14px;
}

.m3-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-left: 4px;
}

.m3-field input,
.m3-field textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-low);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s var(--ease-m3), box-shadow 0.2s var(--ease-m3);
}

.m3-field textarea {
  resize: vertical;
  min-height: 86px;
}

.m3-field input:focus,
.m3-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-option {
  border: 1.5px solid var(--outline-variant);
  background: var(--surface-low);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease-m3);
}

.gender-option.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary);
}

.field-helper-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.avatar-upload-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-low);
  border: 1.5px dashed var(--outline-variant);
  margin-bottom: 16px;
}

.avatar-preview-sm {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-meta {
  flex: 1;
  min-width: 0;
}

.avatar-upload-meta strong {
  display: block;
  font-size: 13.5px;
}

.avatar-upload-meta span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Кнопки M3E */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--spring), background-color 0.2s var(--ease-m3), box-shadow 0.2s, opacity 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn-tonal {
  background: var(--surface-highest);
  color: var(--text);
}
.btn-tonal:hover:not(:disabled) {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.btn-google {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--outline-variant);
}
.btn-google:hover:not(:disabled) {
  background: var(--surface-high);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--error-container);
  color: var(--on-error-container);
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(0.96);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--outline-variant);
}

/* Уведомления */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--error-container);
  color: var(--on-error-container);
}

.alert-success {
  background: var(--success-container);
  color: var(--on-success-container);
}

.alert-warn {
  background: rgba(245, 158, 11, 0.16);
  color: var(--text);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================
   СТРАНИЦА ПРОФИЛЯ M3E (ПОСЛЕ ВХОДА)
   ========================================================= */
.profile-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary-container) 0%, var(--surface-container) 100%);
  border: 1px solid var(--outline-variant);
  margin-bottom: 22px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar-lg {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  border: 3px solid var(--surface);
}

.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name-wrap h2 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.profile-tile {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.profile-tile-wide {
  grid-column: 1 / -1;
}

.profile-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-tile-val {
  font-size: 15.5px;
  font-weight: 700;
  margin-top: 6px;
  word-break: break-word;
}

.profile-edit-panel {
  margin-top: 22px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
}

.profile-edit-panel h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

/* =========================================================
   СТРАНИЦЫ ПРИЛОЖЕНИЙ (ЛАУНЧЕР, ЗАМЕТКИ, НОВОСТИ, ЧАСЫ, КАЛЕНДАРЬ)
   ========================================================= */
.app-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.app-title-block {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 260px;
}

.app-icon-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.app-icon-box:has(img) {
  background: transparent;
}

.app-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-title-block h2 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-container);
  color: var(--text-secondary);
  border: 1px solid var(--outline-variant);
}

.pill-accent {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: transparent;
}

.pill-success {
  background: var(--success-container);
  color: var(--on-success-container);
  border-color: transparent;
}

.pill-soon {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-color: transparent;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.screenshots-strip {
  display: flex;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-highest) transparent;
}

.screenshots-strip::-webkit-scrollbar {
  height: 8px;
}

.screenshots-strip::-webkit-scrollbar-track {
  background: transparent;
}

.screenshots-strip::-webkit-scrollbar-thumb {
  background: var(--surface-highest);
  border-radius: 999px;
}

.screenshots-strip::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.shot-card {
  flex: 0 0 auto;
  height: 300px;
  min-width: 110px;
  scroll-snap-align: start;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s var(--spring), border-color 0.2s;
}

.shot-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.shot-card img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
}

.shot-placeholder {
  width: 155px;
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

.shot-placeholder code {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 10.5px;
  word-break: break-all;
}

.app-tagline-lead {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.5;
}

.app-description {
  color: var(--text-secondary);
  font-size: 15.5px;
  margin-bottom: 18px;
  line-height: 1.65;
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.features-list li {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.features-list li::before {
  content: "✓";
  color: var(--success);
  font-weight: 900;
  flex-shrink: 0;
}

.versions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.version-info-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.version-info strong {
  font-size: 16px;
  font-weight: 800;
}

.version-info p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.muted-note {
  color: var(--text-muted);
  font-size: 14.5px;
}

/* =========================================================
   КНОПКА «НАВЕРХ» (M3E FAB)
   ========================================================= */
.scroll-top-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: 56px;
  height: 56px;
  border-radius: 20px;
  border: 1px solid var(--nav-border);
  background: var(--primary-container);
  color: var(--on-primary-container);
  box-shadow: var(--fab-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.25s var(--ease-m3), transform 0.35s var(--spring), background-color 0.2s;
}

.scroll-top-fab.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-fab:hover {
  background: var(--primary);
  color: var(--on-primary);
  transform: translateY(-3px) scale(1.04);
}

.scroll-top-fab:active {
  transform: scale(0.94);
}

/* =========================================================
   LIGHTBOX И МОДАЛЬНОЕ ОКНО
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 8, 16, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden],
.lightbox-nav[hidden],
.m3-modal-backdrop[hidden] {
  display: none;
}

.lightbox-stage {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lightbox-caption {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.lightbox-close {
  top: 20px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 30px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 32px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.26);
}

.m3-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(5, 8, 16, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.m3-modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.m3-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.m3-modal-head h3 {
  font-size: 20px;
  font-weight: 800;
}

.icon-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-container);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.m3-modal-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.m3-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.site-footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
  border-top: 1px solid var(--outline-variant);
}

.loader {
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
  font-weight: 600;
}

/* =========================================================
   ВСТРОЕННЫЙ РЕЖИМ РЕГИСТРАЦИИ (ANDROID WEBVIEW)
   ========================================================= */
[data-embed="register"] .hero-header,
[data-embed="register"] .nav-shell,
[data-embed="register"] .eco-intro-card,
[data-embed="register"] .site-footer,
[data-embed="register"] .scroll-top-fab {
  display: none;
}

[data-embed="register"] .container {
  max-width: 560px;
  padding: 16px 14px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

[data-embed="register"] .auth-section-card {
  padding: 22px 18px;
  border-radius: 26px;
  box-shadow: none;
}

[data-embed="register"] .auth-head {
  margin-bottom: 16px;
}

[data-embed="register"] .auth-box {
  padding: 18px 16px;
  border-radius: 22px;
}

/* =========================================================
   АДАПТАЦИЯ И REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media (max-width: 900px) {
  .eco-pillars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero-header {
    padding: 68px 16px 86px;
    min-height: 360px;
  }
  .theme-top-right {
    top: 12px;
    right: 12px;
  }
  .hero-inner {
    flex-direction: column;
    gap: 24px;
  }
  .hero-text {
    text-align: center;
    max-width: 500px;
  }
  .nav-shell {
    top: 10px;
    padding: 0 12px;
    margin-top: -46px;
  }
  .main-nav {
    border-radius: 26px;
    padding: 8px;
    gap: 8px;
  }
  .nav-link {
    padding: 9px 13px;
    font-size: 13.5px;
  }
}

@media (max-width: 600px) {
  .device-tablet {
    width: 215px;
    height: 152px;
    padding: 10px 12px;
    border-radius: 18px;
  }
  .device-phone {
    width: 84px;
    height: 164px;
    padding: 8px 7px;
    border-radius: 18px;
  }
  .mock-apps-phone {
    gap: 6px;
    margin-bottom: 6px;
  }
  .mock-apps-tablet {
    gap: 8px;
    margin-bottom: 8px;
  }
  .mock-dock {
    height: 20px;
    gap: 7px;
  }
  .mock-dot {
    width: 7px;
    height: 7px;
  }
  .devices-showcase {
    gap: 14px;
  }
  .container {
    padding: 14px 12px 64px;
  }
  .card {
    padding: 20px 16px;
    border-radius: 26px;
  }
  .auth-box {
    padding: 18px 16px;
    border-radius: 22px;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .profile-banner-card {
    padding: 20px;
  }
  .shot-card {
    height: 245px;
    min-width: 96px;
  }
  .shot-placeholder {
    width: 130px;
  }
  .scroll-top-fab {
    right: 16px;
    bottom: 18px;
    width: 50px;
    height: 50px;
    border-radius: 18px;
  }
  .theme-seg-btn {
    width: 30px;
    height: 30px;
  }
}