/*
 * Shared styles for the accounts/progress feature: the records bubble on
 * every menu page, the end-screen widgets (saved-note, new-best badge,
 * five-session conversion prompt) rendered by shared/account-ui.js, and
 * the cuenta/ auth forms (register/login/verify/reset). Kept separate
 * from shell.css / menu.css since this is one cohesive feature, not base
 * scaffolding.
 */

.account-widget { width: 100%; }

/* ---- records bubble: top-right on every menu page, just left of the
   language switcher (shell.css's .lang-switcher sits at right: 12px,
   44px wide) - same round-button look as .lang-current/.home-nav-btn. ---- */
.records-switcher {
  position: absolute;
  top: 12px;
  right: 64px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
  -webkit-tap-highlight-color: transparent;
  transition: transform .05s;
}
.records-switcher:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.records-switcher svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--purple-dark);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- identity badge: shared/identity-ui.js repurposes the same bubble
   (.records-switcher) once logged in, swapping the icon for an initial
   letter. .records-switcher-initial-child gets the pink "this is a kid
   profile" accent so it reads differently from the parent's own badge. ---- */
.records-switcher-badge { background: var(--key); }
.records-switcher-initial {
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
  color: var(--purple-dark);
  line-height: 1;
}
.records-switcher-initial-child { color: var(--pink); }

/* ---- guest login CTA: a real button (shares .am-role-btn's look), shown
   in an opt-in container each page provides next to its header. Pinned
   top-right like .records-switcher/.lang-switcher (same #game-relative
   .screen ancestor) so it reads as a real "Log in" action rather than a
   buried sentence link - left of both bubbles, same 12px top edge. ---- */
.identity-login {
  position: absolute;
  top: 12px;
  right: 116px;
  z-index: 20;
}
.identity-login-btn {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 1rem;
  font-size: .82rem;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

/* ---- "¡Bienvenido/a, Marc!" greeting - index.html only. One line: the
   active child's name when there is one, else the parent's. ---- */
.identity-greeting {
  margin: .3rem 0 0;
  font-size: 1rem;
  color: var(--purple-dark);
  font-weight: bold;
}

/* ---- progreso/index.html's compact top strip: a guest-account CTA (a
   real button, not a sentence link) or the child-picker pills, with no
   explanatory prose above either any more - see .board-compact in
   shared/menu.css for why this whole area is now small. ---- */
.progreso-inline-row { margin-top: .6rem; }
.progreso-inline-row .am-role-btn {
  display: inline-block;
  padding: .6rem 1.4rem;
  font-size: .9rem;
}

/* ---- end-screen widgets ---- */

.account-saved-note {
  font-size: .8rem;
  opacity: .75;
  margin: .2rem 0;
}

/* ---- lightweight "log in to save your progress" nudge, shown after every
   guest game end (not just the five-session milestone) - see
   .conversion-prompt below for the bigger, periodic version of this ask. ---- */
.account-login-nudge {
  font-size: .82rem;
  margin: .3rem 0 0;
}
.account-login-nudge a {
  color: var(--purple-dark);
  font-weight: bold;
  text-decoration: underline;
}

.account-new-best {
  display: inline-block;
  font-size: .85rem;
  font-weight: bold;
  color: #fff;
  background: var(--green);
  padding: .25rem .8rem;
  border-radius: 999px;
  box-shadow: 0 3px 0 #298c34;
  margin: .3rem 0;
  animation: newBestPop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes newBestPop {
  0%   { opacity: 0; transform: scale(.5); }
  70%  { opacity: 1; transform: scale(1.12); }
  100% { transform: scale(1); }
}

.conversion-prompt {
  margin-top: .8rem;
  padding: .9rem 1.1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .85);
  max-width: 360px;
}

.conversion-title {
  margin: 0 0 .3rem;
  font-size: 1rem;
  color: var(--purple-dark);
}

.conversion-body {
  margin: 0 0 .6rem;
  font-size: .82rem;
  color: var(--ink);
}

.conversion-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.conversion-btn {
  font-family: inherit;
  font-size: .82rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.conversion-create {
  background: var(--purple);
  color: #fff;
}

.conversion-keep {
  background: transparent;
  color: var(--purple-dark);
  text-decoration: underline;
}

.conversion-teacher {
  background: var(--key);
  color: var(--key-text);
}

/* ---- cuenta/ auth forms (register, login, verify, reset) - live inside
   menu.css's .board (teal, white text), so fields need their own white
   background for contrast. ---- */

.am-role-choice {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  max-width: 360px;
  margin: 1.2rem auto 0;
}

.am-role-btn {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: #fff;
  color: var(--purple-dark);
  text-decoration: none;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  transition: transform .05s;
}
.am-role-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.am-role-btn small { display: block; margin-top: .3rem; font-size: .78rem; opacity: .75; font-weight: normal; }

.am-form {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  max-width: 360px;
  margin: 1.2rem auto 0;
  text-align: left;
}

.am-field { display: flex; flex-direction: column; gap: .3rem; }
.am-field label { color: #fff; font-size: .82rem; }
.am-field input {
  font-family: inherit;
  font-size: 1rem;
  padding: .6rem .8rem;
  border-radius: 12px;
  border: none;
  background: #fff;
  color: var(--ink);
}

.am-consent { flex-direction: row; align-items: flex-start; gap: .5rem; }
.am-consent input { width: 18px; height: 18px; margin-top: .15rem; flex: none; }
.am-consent label { color: #fff; font-size: .78rem; line-height: 1.4; }
.am-consent label a { color: #fff; text-decoration: underline; }

.am-submit {
  font-family: inherit;
  font-size: 1.1rem;
  padding: .7rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 #b5323f;
  transition: transform .05s;
}
.am-submit:active { transform: translateY(3px); box-shadow: 0 1px 0 #b5323f; }
.am-submit:disabled { opacity: .6; cursor: default; }

.am-status {
  margin: 0;
  font-size: .85rem;
  color: #fff;
  text-align: center;
}
.am-status.am-status-error { color: #ffe1e1; font-weight: bold; }
.am-status.am-status-ok { color: #d9ffe6; font-weight: bold; }

.am-links {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  text-align: center;
  margin-top: .4rem;
}
.am-links a { color: #fff; font-size: .82rem; text-decoration: underline; }
.am-links-btn {
  font-family: inherit;
  background: none;
  border: none;
  color: #fff;
  font-size: .82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ---- first-visit "who are you?" welcome modal (shared/onboarding-modal.js)
   Shown once per device on the site's entry pages (home + the five section
   menus), remembered via localStorage["am-onboarding-seen"]. Same teal
   "pizarra" + white pill look as .board/.am-role-btn above, just packaged
   as its own fixed-position dialog instead of living inside a .board. ---- */
.onboarding-scrim {
  position: fixed;
  inset: 0;
  z-index: 970;
  background: rgba(20, 18, 26, .55);
}
.onboarding-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 971;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: #27a7bb;
  border: 3px solid rgba(255, 255, 255, .35);
  border-radius: 26px;
  box-shadow: 0 12px 0 #1c8496, 0 18px 30px rgba(0, 0, 0, .25);
  padding: clamp(20px, 4vw, 30px) clamp(18px, 4vw, 26px) clamp(22px, 4vw, 28px);
  text-align: center;
}
.onboarding-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: 20px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}
.onboarding-x:hover { background: rgba(255, 255, 255, .3); }
.onboarding-title {
  margin: 4px 30px 2px 0;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: normal;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.onboarding-subtitle {
  margin: 0;
  font-size: .9rem;
  color: #fff;
  opacity: .9;
}
.onboarding-cards {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-top: 1.1rem;
}
.onboarding-card {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  border-radius: 16px;
  background: #fff;
  color: var(--purple-dark);
  text-decoration: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
  transition: transform .05s;
}
.onboarding-card:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.onboarding-card-title { display: block; font-size: 1rem; font-weight: bold; }
.onboarding-card-desc { display: block; margin-top: .25rem; font-size: .78rem; opacity: .8; font-weight: normal; }
.onboarding-card-parent { box-shadow: 0 4px 0 var(--purple); }
.onboarding-card-parent:active { box-shadow: 0 1px 0 var(--purple); }
.onboarding-card-teacher { box-shadow: 0 4px 0 var(--pink); }
.onboarding-card-teacher:active { box-shadow: 0 1px 0 var(--pink); }

/* ---- child-profile cards (shared/child-picker.js) ----
   Written for familia/index.html's dashboard; progreso/ renders the same
   cards in the component's "light" mode, so these are keyed off the
   .child-picker class the component adds to its container rather than
   familia's own #children-list id. */

.child-picker {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-width: 420px;
  margin: 1rem auto;
  text-align: left;
}

/* progreso/'s "light" mode: a horizontal, wrapping row of simple colour
   "paint blob" badges instead of familia's stacked cards above - plain
   flat circles of colour with the name on them, not a button (no 3D
   bevel, no shadow ledge, no hover-bounce - shared/menu.css's .pill is
   the wrong reference here, that's a nav button, this is a name tag). */
.child-picker-pills {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  max-width: none;
  margin: .6rem auto 0;
}
.child-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: bold;
  font-size: clamp(14px, 2vw, 16px);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--purple);
  transition: transform .12s ease;
}
.child-pill:hover, .child-pill:focus-visible { transform: scale(1.06); outline: none; }
.child-pill:active { transform: scale(.96); }
/* one flat colour per blob, cycling - a handful of children reads like a
   handful of different paint colours, not a numbered list */
.child-pill:nth-of-type(5n+1) { background: var(--purple); }
.child-pill:nth-of-type(5n+2) { background: var(--pink); }
.child-pill:nth-of-type(5n+3) { background: var(--green); }
.child-pill:nth-of-type(5n+4) { background: var(--orange); }
.child-pill:nth-of-type(5n+5) { background: #4c8fc4; }
.child-pill-active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0,0,0,.15);
}
.child-pill-add {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7);
}
.child-pill-add:hover, .child-pill-add:focus-visible {
  background: rgba(255,255,255,.15);
}

.familia-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  background: rgba(255, 255, 255, .92);
  border-radius: 14px;
  padding: .7rem .9rem;
}
.familia-card-archived { opacity: .65; }
.familia-card-active { border: 2px solid var(--pink); }

.familia-card-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.familia-name {
  font-size: .95rem;
  color: var(--purple-dark);
  font-weight: bold;
}
.familia-name em { font-weight: normal; font-style: normal; opacity: .7; font-size: .78rem; }
.familia-active-tag { color: var(--pink) !important; font-weight: bold !important; opacity: 1 !important; }

.familia-stats {
  font-size: .8rem;
  color: var(--purple-dark);
  opacity: .7;
}

.familia-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.familia-btn {
  font-family: inherit;
  font-size: .72rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--key);
  color: var(--key-text);
}
.familia-btn-primary { background: var(--pink); color: #fff; }
.familia-delete-btn { background: transparent; color: var(--red); text-decoration: underline; }

.familia-rename-form {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  width: 100%;
}
.familia-rename-input {
  font-family: inherit;
  font-size: .9rem;
  padding: .35rem .6rem;
  border-radius: 10px;
  border: 1px solid var(--key);
  flex: 1 1 140px;
}

.familia-add-child { margin-top: .8rem; }
.familia-add-child .am-role-btn {
  display: inline-block;
  max-width: 280px;
  margin: 0 auto;
}
/* `.am-links a { color: #fff }` (one class + one element) was out-
   specificity-ing `.am-role-btn`'s own colour, so an .am-role-btn inside
   an .am-links wrapper rendered white-on-white - invisible. That's how
   familia/'s "Añadir un perfil" button had been shipping; progreso/'s
   picker renders the same markup, so fix it for both here. */
.am-links .am-role-btn { color: var(--purple-dark); }
