/**
 * returning-user.css — the "welcome back" card shown to a student whose session
 * is still alive on this device.
 *
 * It paints before any Firebase code has loaded, so everything here is static CSS
 * with no dependency on JS-set classes beyond the initial markup. The fade is kept
 * short: this card sits between a returning student and their work, and an
 * animation they wait through defeats the point of adding it.
 */

.ru-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;                 /* above --z-top-bar (2000) and --z-nav (1000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ru-fade 160ms ease-out;
}

.ru-card {
  width: 100%;
  max-width: 380px;
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 18px;
  padding: 32px 26px 22px;
  text-align: center;
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.32);
  animation: ru-rise 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Brand rule: ClassMaster is always set in Instrument Serif. */
.ru-brand {
  margin: 0 0 20px;
  font-family: var(--font-serif, 'Instrument Serif', Georgia, serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--accent, #004643);
}

.ru-avatar {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;                /* clips a non-square profile picture to the circle */
  color: #FFFFFF;
  background: var(--accent, #004643);
  box-shadow: 0 0 0 4px rgba(0, 70, 67, 0.1);
}

.ru-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ru-avatar-letter {
  font-family: var(--font-main, 'Outfit', system-ui, sans-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

/* The nameless case. Slightly softened so it reads as a placeholder rather than
   as a letter someone forgot to set. */
.ru-avatar-icon { color: rgba(255, 255, 255, 0.85); }

.ru-title {
  margin: 0 0 6px;
  font-family: var(--font-main, 'Outfit', system-ui, sans-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: #0F172A;
}

.ru-sub {
  margin: 0 0 24px;
  font-family: var(--font-main, 'Outfit', system-ui, sans-serif);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted, #64748B);
}

.ru-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-main, 'Outfit', system-ui, sans-serif);
  font-size: 15.5px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--accent, #004643);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ru-primary:hover { background: #00302E; }
.ru-primary:active { transform: translateY(1px); }

.ru-secondary,
.ru-tertiary {
  width: 100%;
  margin-top: 10px;
  padding: 11px 18px;
  border-radius: 10px;
  background: none;
  font-family: var(--font-main, 'Outfit', system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ru-secondary {
  border: 1px solid var(--border, #E2E8F0);
  font-size: 14.5px;
  font-weight: 500;
  color: #334155;
}

.ru-secondary:hover { background: #F8FAFC; }

.ru-tertiary {
  border: none;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted, #64748B);
}

.ru-tertiary:hover { color: #334155; }

.ru-primary:focus-visible,
.ru-secondary:focus-visible,
.ru-tertiary:focus-visible {
  outline: 2px solid var(--accent, #004643);
  outline-offset: 2px;
}

@keyframes ru-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ru-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* The card takes focus on open so a screen reader lands inside the dialog. It is
   a container, not a control, so it should not draw a ring for doing so. The real
   controls keep theirs above. */
.ru-card:focus,
.ru-card:focus-visible { outline: none; }

/* A student who has asked for less motion gets the card with none of it. */
@media (prefers-reduced-motion: reduce) {
  .ru-backdrop,
  .ru-card { animation: none; }
  .ru-primary:active { transform: none; }
}

@media (max-width: 400px) {
  .ru-card { padding: 26px 20px 18px; }
  .ru-title { font-size: 20px; }
}
