/* Eclair ID — Material 3 Expressive: крупные скруглённые формы, тональные
   поверхности, насыщенный акцент и заметная типографика.
   Всё локальное: ни шрифтов, ни стилей из сети.

   Акцент и шкалы форм и движения — те же, что в @chat (web/src/app.css):
   два сервиса должны выглядеть одной семьёй, а не двумя разными продуктами. */

:root {
  color-scheme: light dark;

  --primary: #1a73e8;
  --on-primary: #ffffff;
  --primary-container: #d7e6fd;
  --on-primary-container: #072d63;

  --secondary-container: #e3e8ef;
  --on-secondary-container: #1a1f26;

  --tertiary-container: #d9ecf5;
  --on-tertiary-container: #10323f;

  --surface: #f8f9fa;
  --surface-container: #f1f3f4;
  --surface-container-high: #e8eaed;
  --on-surface: #202124;
  --on-surface-variant: #5f6368;
  --outline: #dadce0;

  --error: #b3261e;
  --error-container: #f9dedc;

  /* Выразительные формы: крупные скругления и «таблетки» */
  --shape-xl: 28px;
  --shape-l: 20px;
  --shape-m: 16px;
  --shape-s: 12px;
  --shape-xs: 8px;
  --shape-full: 999px;

  /* Движение — те же длительности и кривые, что в @chat. */
  --dur-short: 160ms;
  --dur-medium: 280ms;
  --motion-standard: cubic-bezier(.2, 0, 0, 1);
  --motion-emphasized: cubic-bezier(.3, 1.4, .4, 1);

  --elev-1: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 3px 1px rgba(0, 0, 0, .06);
  --elev-2: 0 1px 2px rgba(0, 0, 0, .1), 0 2px 6px 2px rgba(0, 0, 0, .08);

  font-family: Roboto, 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8ab4f8;
    --on-primary: #0b2b57;
    --primary-container: #1f3f6b;
    --on-primary-container: #d7e6fd;

    --secondary-container: #2f3237;
    --on-secondary-container: #e3e8ef;

    --tertiary-container: #22414d;
    --on-tertiary-container: #d9ecf5;

    --surface: #1b1c1e;
    --surface-container: #212225;
    --surface-container-high: #292a2d;
    --on-surface: #e8eaed;
    --on-surface-variant: #9aa0a6;
    --outline: #3c4043;

    --error: #f2b8b5;
    --error-container: #8c1d18;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--on-surface);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Шапка */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 8px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--on-surface);
}
.wordmark:hover { text-decoration: none; }

.wordmark .mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--shape-m);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.top .spacer { flex: 1; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--shape-full);
  background: var(--surface-container);
  font-size: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--shape-full);
  color: #fff;
  font-weight: 500;
}

/* Полотно */

main { max-width: 960px; margin: 0 auto; padding: 8px 20px 64px; }

.hero { padding: 24px 4px 20px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -.02em;
}
.hero p { margin: 0; color: var(--on-surface-variant); max-width: 60ch; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  padding: 24px;
  border-radius: var(--shape-xl);
  background: var(--surface-container);
}
.card.tonal { background: var(--primary-container); color: var(--on-primary-container); }
.card.narrow { max-width: 460px; margin: 0 auto; }

.card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.card .sub { margin: 0 0 20px; color: var(--on-surface-variant); font-size: 14px; }
.card.tonal .sub { color: inherit; opacity: .8; }

/* Поля ввода в стиле outlined */

.field { position: relative; margin-bottom: 16px; }

.field input {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--outline);
  border-radius: var(--shape-m);
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  outline: none;
}
.field input:focus { border-color: var(--primary); border-width: 2px; padding: 15px; }

.field label {
  position: absolute;
  top: -9px;
  left: 12px;
  padding: 0 6px;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 12px;
}
.field .hint { display: block; padding: 6px 16px 0; color: var(--on-surface-variant); font-size: 12px; }

/* Кнопки-таблетки */

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.actions .spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--shape-full);
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.text { background: transparent; color: var(--primary); padding: 12px 12px; }
.btn.text:hover { background: var(--surface-container-high); }
.btn.danger { background: var(--error-container); color: var(--error); }
.btn.small { padding: 8px 16px; font-size: 14px; }

/* Списки устройств и приложений */

.rows { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--shape-l);
  background: var(--surface-container-high);
}
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; }
.row .meta { color: var(--on-surface-variant); font-size: 13px; }

.badge {
  padding: 4px 12px;
  border-radius: var(--shape-full);
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  font-size: 12px;
}

.notice {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: var(--shape-l);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 14px;
}
.notice.error { background: var(--error-container); color: var(--error); }

.footnote { margin-top: 28px; color: var(--on-surface-variant); font-size: 13px; text-align: center; }

@media (max-width: 520px) {
  .hero h1 { font-size: 32px; }
  .card { padding: 20px; border-radius: var(--shape-l); }
}

/* Уважение к системной настройке «уменьшить движение» — как и в @chat. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-short: 0ms; --dur-medium: 0ms; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
