/* ============================================================
   Learn — Account & Profiles pages (kids design)
   Nunito, purple/blue/cyan/orange palette — NO pink
   ============================================================ */

/* ── Login / Register page ──────────────────────────────── */

.lrn-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #e0f2fe 0%, #ede9fe 50%, #fef9f0 100%);
}

.lrn-auth-card {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 8px 40px rgba(124,58,237,.14), 0 2px 8px rgba(0,0,0,.08);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.lrn-auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lrn-auth-logo img {
  height: 48px;
  width: auto;
}

.lrn-auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e1b4b;
  text-align: center;
  margin: 0 0 .25rem;
}

.lrn-auth-sub {
  text-align: center;
  color: #6b7280;
  font-size: .95rem;
  margin: 0 0 1.5rem;
}

.lrn-auth-form .lrn-form-group {
  margin-bottom: 1rem;
}

.lrn-auth-form label {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  color: #374151;
  margin-bottom: .3rem;
}

.lrn-auth-form input[type="text"],
.lrn-auth-form input[type="email"],
.lrn-auth-form input[type="password"] {
  width: 100%;
  padding: .7rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: .75rem;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: #1f2937;
  transition: border-color .18s;
  box-sizing: border-box;
}

.lrn-auth-form input:focus {
  outline: none;
  border-color: #7c3aed;
}

.lrn-auth-error {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
  border-radius: .75rem;
  padding: .7rem 1rem;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: none;
}

.lrn-auth-error.visible { display: block; }

.lrn-auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .93rem;
  color: #6b7280;
}

.lrn-auth-switch a {
  color: #7c3aed;
  font-weight: 700;
  text-decoration: none;
}

.lrn-auth-switch a:hover { text-decoration: underline; }

/* ── Profiles page ──────────────────────────────────────── */

.lrn-profiles-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #e0f2fe 0%, #ede9fe 50%, #fef9f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem 3rem;
}

.lrn-profiles-title {
  font-size: 2rem;
  font-weight: 900;
  color: #1e1b4b;
  text-align: center;
  margin: 0 0 .4rem;
}

.lrn-profiles-sub {
  color: #6b7280;
  text-align: center;
  font-size: 1rem;
  margin: 0 0 2.5rem;
}

.lrn-profiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: 640px;
  width: 100%;
}

.lrn-profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  color: inherit;
}

.lrn-profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
  position: relative;
}

.lrn-profile-btn:hover .lrn-profile-avatar,
.lrn-profile-btn:focus .lrn-profile-avatar {
  transform: scale(1.12);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.lrn-profile-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e1b4b;
  text-align: center;
}

.lrn-profile-score {
  font-size: .82rem;
  font-weight: 600;
  color: #7c3aed;
}

/* Add child button */
.lrn-add-child-btn .lrn-profile-avatar {
  background: #f3f4f6;
  border: 3px dashed #d1d5db;
  font-size: 2.5rem;
  color: #9ca3af;
}

.lrn-add-child-btn:hover .lrn-profile-avatar {
  background: #e0e7ff;
  border-color: #7c3aed;
  color: #7c3aed;
}

.lrn-profiles-parent-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
  font-size: .95rem;
  color: #6b7280;
}

.lrn-profiles-parent-bar a {
  color: #7c3aed;
  font-weight: 700;
  text-decoration: none;
  font-size: .88rem;
}

/* ── Add-child modal ────────────────────────────────────── */

.lrn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 1rem;
}

.lrn-modal-overlay[hidden] { display: none; }

.lrn-modal-box {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
}

.lrn-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0 0 1.25rem;
  text-align: center;
}

.lrn-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

.lrn-emoji-option {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: .5rem;
  border: 2px solid transparent;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}

.lrn-emoji-option.selected,
.lrn-emoji-option:hover { border-color: #7c3aed; background: #ede9fe; }

.lrn-color-picker {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.lrn-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}

.lrn-color-swatch.selected,
.lrn-color-swatch:hover { transform: scale(1.2); border-color: #1e1b4b; }

/* ── Dashboard ──────────────────────────────────────────── */

.lrn-dash-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.lrn-dash-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: #1e1b4b;
  margin: 0 0 1.5rem;
}

.lrn-dash-children {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.lrn-dash-child-tab {
  padding: .5rem 1.25rem;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  color: #374151;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.lrn-dash-child-tab.active,
.lrn-dash-child-tab:hover {
  border-color: #7c3aed;
  background: #ede9fe;
  color: #5b21b6;
}

.lrn-dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 500px) { .lrn-dash-stats { grid-template-columns: 1fr 1fr; } }

.lrn-dash-stat {
  background: #fff;
  border-radius: 1rem;
  padding: 1.2rem 1rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.lrn-dash-stat-val {
  font-size: 2rem;
  font-weight: 900;
  color: #7c3aed;
  line-height: 1;
}

.lrn-dash-stat-label {
  font-size: .82rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: .25rem;
}

.lrn-dash-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 1.75rem 0 .75rem;
}

.lrn-dash-score-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.lrn-dash-score-item {
  background: #fff;
  border-radius: .9rem;
  padding: .8rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}

.lrn-dash-score-badge {
  width: 46px;
  height: 46px;
  border-radius: .75rem;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lrn-dash-score-info { flex: 1; min-width: 0; }

.lrn-dash-score-lesson {
  font-size: .9rem;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lrn-dash-score-mode {
  font-size: .78rem;
  color: #6b7280;
}

.lrn-dash-score-pct {
  font-size: 1.1rem;
  font-weight: 900;
  color: #059669;
  flex-shrink: 0;
}

.lrn-dash-score-pct.mid { color: #d97706; }
.lrn-dash-score-pct.low { color: #dc2626; }

/* Navbar child pill */
.lrn-nav-child-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: #ede9fe;
  border-radius: 999px;
  padding: .25rem .6rem .25rem .35rem;
  font-size: .88rem;
  font-weight: 700;
  color: #5b21b6;
  text-decoration: none;
  white-space: nowrap;
}

.lrn-nav-child-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.lrn-nav-child-avatar--img {
  overflow: hidden;
  background: #f3f4f6;
}
.lrn-nav-child-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ── Profile card (new layout with edit button) ─────── */

.lrn-profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lrn-profile-avatar-wrap {
  position: relative;
}

.lrn-profile-avatar--img {
  overflow: hidden;
  background: #f3f4f6;
}

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

.lrn-profile-pair-label {
  font-size: .75rem;
  font-weight: 600;
  color: #7c3aed;
  text-align: center;
  margin-top: -.1rem;
}

.lrn-profile-pair-label--unset {
  color: #f97316;
}

.lrn-profile-edit-btn {
  position: absolute;
  bottom: 32px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #7c3aed;
  color: #fff;
  font-size: .65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
  z-index: 2;
}

.lrn-profile-edit-btn:hover { background: #5b21b6; transform: scale(1.12); }

/* ── Modal form label (global — not scoped to auth form) ─ */

.lrn-modal-box label,
.lrn-form-group label {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: #374151;
  margin-bottom: .3rem;
}

/* ── Shared form helpers ─────────────────────────────── */

.lrn-text-input {
  width: 100%;
  padding: .65rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: .75rem;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: #1f2937;
  box-sizing: border-box;
  transition: border-color .15s;
}
.lrn-text-input:focus { outline: none; border-color: #7c3aed; }

.lrn-picker-label {
  font-weight: 700;
  font-size: .88rem;
  color: #374151;
  margin: 0 0 .4rem;
}

.lrn-modal-actions {
  display: flex;
  gap: .6rem;
  margin-top: 1.25rem;
}
.lrn-modal-actions .bws-btn { flex: 1; }

.lrn-btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 2px solid #fca5a5;
}
.lrn-btn-danger:hover { background: #fee2e2; }

/* ── Edit modal ─────────────────────────────────────── */

.lrn-modal-box--wide { max-width: 520px; }

.lrn-avatar-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: .85rem;
}

.lrn-avatar-tab {
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
}
.lrn-avatar-tab--active,
.lrn-avatar-tab:hover {
  border-color: #7c3aed;
  background: #ede9fe;
  color: #5b21b6;
}

.lrn-avatar-tab-panel { display: block; }
.lrn-avatar-tab-panel--hidden { display: none; }

/* ── Preset grid ────────────────────────────────────── */

.lrn-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: .5rem;
  max-height: 220px;
  overflow-y: auto;
  padding: .25rem;
}

.lrn-preset-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: .75rem;
  border: 3px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: #f3f4f6;
  padding: 0;
  transition: border-color .15s, transform .15s;
}
.lrn-preset-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lrn-preset-btn:hover { border-color: #c4b5fd; transform: scale(1.06); }
.lrn-preset-btn.selected { border-color: #7c3aed; transform: scale(1.06); }

/* ── Upload area ────────────────────────────────────── */

.lrn-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  position: relative;
  transition: border-color .15s;
}
.lrn-upload-area:hover { border-color: #7c3aed; }

.lrn-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  color: #6b7280;
  font-size: .93rem;
  font-weight: 600;
}
.lrn-upload-label i { font-size: 1.75rem; color: #7c3aed; }
.lrn-upload-label small { font-size: .78rem; font-weight: 400; }

.lrn-upload-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.lrn-upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto .5rem;
}
.lrn-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Select input ───────────────────────────────────── */

.lrn-select {
  width: 100%;
  padding: .6rem .9rem;
  border: 2px solid #e5e7eb;
  border-radius: .75rem;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.25rem;
  box-sizing: border-box;
  transition: border-color .15s;
}
.lrn-select:focus { outline: none; border-color: #7c3aed; }

/* ── Language pair section in edit modal ────────────── */

.lrn-lang-pair-section {
  margin-top: .25rem;
}

.lrn-lang-pair-note {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: .65rem;
  padding: .55rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: .85rem;
}
.lrn-lang-pair-note[hidden] { display: none; }
.lrn-lang-pair-note i { flex-shrink: 0; margin-top: .1rem; }

.lrn-lang-pair-row {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
}

.lrn-lang-pair-field {
  flex: 1;
  min-width: 0;
}

.lrn-lang-pair-arrow {
  font-size: 1.2rem;
  color: #7c3aed;
  font-weight: 900;
  padding-bottom: .55rem;
  flex-shrink: 0;
}

@media (max-width: 400px) {
  .lrn-lang-pair-row { flex-direction: column; align-items: stretch; }
  .lrn-lang-pair-arrow { text-align: center; padding-bottom: 0; }
}

/* ── Dashboard child tab image avatar ───────────────── */

.lrn-dash-child-avatar-img {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.lrn-dash-child-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
