/* =========================================================================
   Eva Mobile — аккаунт (Фаза 3): секция Профиля + модалка входа/регистрации.
   Использует токены дизайн-системы Eva (mobile.css) и .lrn-* кнопки/инпуты.
   ========================================================================= */

/* ---- Секция «Аккаунт» в Профиле: переключение logged-out / logged-in ---- */
#profile-account[data-authed="0"] .auth-in { display: none; }
#profile-account[data-authed="1"] .auth-out { display: none; }

.auth-email-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-sync-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.auth-sync-badge[data-state="ok"] { color: #22c55e; }
.auth-sync-badge[data-state="syncing"] { color: var(--m-accent); }
.auth-sync-badge[data-state="error"] { color: #ef4444; }

/* ---- Модалка ---- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
}
.auth-modal.open { visibility: visible; }

.auth-scrim {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 28, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.auth-modal.open .auth-scrim { opacity: 1; }

.auth-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--m-app-bg);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.35);
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-modal.open .auth-sheet { transform: translateY(0); }

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.auth-x {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--sidebar-item-hover);
  color: var(--text-main);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--sidebar-item-hover);
  border-radius: 14px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.auth-tab.is-active {
  background: var(--m-surface);
  color: var(--m-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--input-border);
  background: var(--m-surface);
  color: var(--text-main);
  font-size: 1rem;
  padding: 13px 14px;
  border-radius: 14px;
  outline: none;
}
.auth-form input:focus { border-color: var(--m-accent); }
.auth-err {
  min-height: 18px;
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 500;
}
.auth-note {
  margin: 14px 2px 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .auth-scrim, .auth-sheet { transition: none; }
}
