/* Общий стиль сайта SleepApp — приблизительно повторяет тему приложения
   (Material 3, seed-цвет #5B6EE8, см. lib/services/theme.dart). Точный
   алгоритм M3-тонов на сайте не воспроизводим, берём близкие вручную
   подобранные оттенки. */

:root {
  color-scheme: light dark;

  --primary: #5b62c4;
  --primary-strong: #4a51b0;
  --on-primary: #ffffff;

  --bg: #f5f4fb;
  --surface: #ffffff;
  --surface-alt: #eeedf9;
  --text: #1a1a2e;
  --text-muted: rgba(26, 26, 46, 0.65);
  --border: rgba(26, 26, 46, 0.08);
  --shadow: rgba(26, 26, 46, 0.08);

  --error-bg: #fdeaea;
  --error-text: #a11;
  --success-bg: #e8f6ea;
  --success-text: #1e7a2e;

  --girl-color: #e1acd8;
  --boy-color: #4f9fea;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8890f0;
    --primary-strong: #a4abf5;
    --on-primary: #14141f;

    --bg: #14141f;
    --surface: #1c1c2a;
    --surface-alt: #23233444;
    --text: #f0f0f5;
    --text-muted: rgba(240, 240, 245, 0.65);
    --border: rgba(240, 240, 245, 0.1);
    --shadow: rgba(0, 0, 0, 0.4);

    --error-bg: #3a1616;
    --error-text: #ff8a8a;
    --success-bg: #163a1e;
    --success-text: #8ee29c;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--primary);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.page.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 0;
  font-weight: 700;
  font-size: 18px;
}

.nav a {
  text-decoration: none;
  color: inherit;
}

.nav .links {
  display: flex;
  gap: 18px;
  font-weight: 500;
  font-size: 14px;
}

h1 {
  font-size: 26px;
  margin: 8px 0 8px;
}

h2 {
  font-size: 18px;
  margin: 28px 0 10px;
}

p.subtitle {
  color: var(--text-muted);
  margin: 0 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:hover {
  background: var(--primary-strong);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn.danger {
  background: transparent;
  border: 1px solid var(--error-text);
  color: var(--error-text);
}

.btn.small {
  width: auto;
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  margin: 0;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  /* 16px, не меньше — иначе Safari на iPhone зумит страницу при фокусе. */
  font-size: 16px;
}

.note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.banner.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.banner.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
  flex-shrink: 0;
}

.avatar.girl {
  box-shadow: 0 0 0 3px var(--girl-color);
}

.avatar.boy {
  box-shadow: 0 0 0 3px var(--boy-color);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.footer-links {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-muted);
  margin: 0 8px;
}
