/* Yoga Guru v2 – account, sign-in, consent, paywall and history UI (public/js/ui/account.js).
 * Loaded after styles.css and before responsive.css. Everything here is fluid (no fixed widths
 * above 320 px), finger-sized (44 px+ targets) and scrolls inside the modal card, so the mobile
 * overrides in responsive.css only ever have to touch the shared classes. */

/* ---------------------------------------------------------------- shared bits */
.input {
  font: inherit; width: 100%; max-width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid #d6dcea; background: #fff; color: var(--ink);
}
.input:focus-visible { outline: 4px solid rgba(42, 157, 143, 0.35); outline-offset: 1px; border-color: var(--primary); }
.btn--danger { background: var(--bad); box-shadow: 0 6px 0 #c94444, var(--shadow); color: #fff; }
.btn--danger.btn--small { box-shadow: 0 3px 0 #c94444; }
.btn--danger:active { box-shadow: 0 2px 0 #c94444; }
.btn.btn--small { min-height: 44px; }
a.btn { text-decoration: none; }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(31, 42, 68, 0.15); object-fit: cover; overflow: hidden; }
.avatar--sm { width: 36px; height: 36px; font-size: 1rem; }
.avatar--md { width: 48px; height: 48px; font-size: 1.3rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.7rem; }
.avatar--initial { background: var(--primary); color: #fff; font-weight: 800; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #eef1f7; color: var(--ink-soft); white-space: nowrap; }
.tag--partial { background: #fff1d6; color: #9a5b00; }
.tag--device { text-transform: capitalize; }

.signin__status { min-height: 1.2em; font-weight: 700; color: var(--ink-soft); margin-top: 10px; }
.signin__status.is-error { color: var(--bad); }
.signin__label { display: block; font-weight: 800; margin: 12px 0 6px; }

/* ---------------------------------------------------------------- home: account chip */
.account-chip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; }
.account-chip--pending { min-height: 44px; }
.account-chip__who {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 0 #d6dcea; font-weight: 800; max-width: 100%;
}
.account-chip__name { max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; max-width: 12em; }
.profile-chip > b, .profile-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip--add { min-width: 44px; justify-content: center; padding: 6px 12px; }
.plan-badge {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.2px; background: #eef1f7; color: var(--ink-soft);
}
button.plan-badge { min-height: 44px; }
.plan-badge--premium { background: var(--primary); color: #fff; }
.plan-badge--trial { background: var(--accent); color: #fff; }
.plan-badge--free { background: #fff; box-shadow: 0 2px 0 #d6dcea; color: var(--ink); }
.plan-badge--offline { background: #ffe9e9; color: #a33; font-size: 0.78rem; }

/* ---------------------------------------------------------------- home: locked cards + footer */
.session-card--locked { border-style: dashed; border-color: #e3d9ff; }
.session-card--locked .session-card__go { background: #9d8df1; }
.session-card--locked .session-card__strip { opacity: 0.75; }
.lock-ribbon {
  position: absolute; top: 14px; left: -6px; background: #9d8df1; color: #fff; font-weight: 800; font-size: 0.82rem;
  padding: 5px 12px 5px 14px; border-radius: 0 999px 999px 0; box-shadow: var(--shadow); z-index: 1;
}
.lock-tag { position: absolute; top: 10px; left: 12px; font-size: 0.78rem; font-weight: 800; background: #9d8df1; color: #fff; border-radius: 999px; padding: 3px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.btn--locked, .btn--accent.btn--locked { background: #9d8df1; box-shadow: 0 6px 0 #6f5fd0, var(--shadow); }
.btn--locked:active { box-shadow: 0 2px 0 #6f5fd0; }

.app-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin-top: 28px; padding-top: 16px; border-top: 2px solid rgba(31, 42, 68, 0.08); color: var(--ink-soft); font-size: 0.9rem; font-weight: 700; }
.app-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.app-footer__links a { color: var(--ink-soft); text-decoration: none; padding: 8px 2px; min-height: 44px; display: inline-flex; align-items: center; }
.app-footer__links a:hover { color: var(--primary-dark); text-decoration: underline; }
.app-footer__hint { flex-basis: 100%; text-align: center; }

/* ---------------------------------------------------------------- sign-in */
.signin { max-width: 560px; }
.signin h2 { margin-bottom: 8px; }
.signin__why { font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
.signin__who { font-size: 1.05rem; line-height: 1.4; color: var(--ink); margin-bottom: 16px; }
.signin__body { display: flex; flex-direction: column; gap: 14px; }
.signin__google { min-height: 44px; display: flex; justify-content: center; }
.signin__dev { background: #fff; border: 2px dashed #d6dcea; border-radius: 18px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.signin__dev-tag { align-self: flex-start; font-size: 0.72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #9a5b00; background: #fff1d6; padding: 3px 9px; border-radius: 999px; }
.signin__dev .signin__label { margin-top: 4px; }
.signin__dev .btn { align-self: flex-start; margin-top: 6px; }
.signin__fine { font-size: 0.86rem; color: var(--ink-soft); font-weight: 600; margin-top: 12px; line-height: 1.4; }
.signin__fine a { color: var(--primary-dark); }

/* ---------------------------------------------------------------- parental consent */
.consent { max-width: 760px; }
.consent__lead { font-size: 1.05rem; line-height: 1.45; margin: 8px 0 14px; }
.consent__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.consent__card { box-shadow: none; border: 2px solid #eee4d0; }
.consent__card ul { font-weight: 600; }
.consent__fine { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; margin: 14px 0 10px; line-height: 1.4; }
.consent__fine a { color: var(--primary-dark); }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; margin-top: 6px; border-radius: 14px; background: #fff; font-weight: 700; cursor: pointer; min-height: 48px; }
.check-row input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.check-row span { line-height: 1.35; }

/* ---------------------------------------------------------------- paywall */
.paywall { max-width: 860px; }
.paywall__reason { font-weight: 700; color: var(--primary-dark); margin: 6px 0 12px; font-size: 1.05rem; }
.paywall__perks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 6px 14px; font-weight: 700; color: var(--ink); }
.paywall__perks li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.paywall__perks li span { flex: none; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 22px; padding: 20px 16px 16px;
  box-shadow: var(--shadow); border: 3px solid transparent; text-align: center; min-width: 0;
}
.plan-card--featured { border-color: var(--accent); }
.plan-card--current { border-color: var(--primary); }
.plan-card__badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-weight: 800; font-size: 0.8rem; padding: 4px 12px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow); }
.plan-card__label { font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; font-size: 0.82rem; }
.plan-card__price { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.plan-card__price span { font-size: 0.95rem; color: var(--ink-soft); font-weight: 700; }
.plan-card__per-week { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }
.plan-card__note { font-size: 0.86rem; font-weight: 700; color: var(--primary-dark); }
.plan-card .btn { margin-top: auto; width: 100%; padding-left: 12px; padding-right: 12px; }
.paywall__empty { background: #fff; border-radius: 18px; padding: 16px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.paywall__fine { font-size: 0.86rem; color: var(--ink-soft); font-weight: 600; text-align: center; margin-top: 12px; }
.paywall__fine a { color: var(--primary-dark); }
.is-busy .plan-card { opacity: 0.7; }

.mock-pay { max-width: 520px; }
.mock-pay__tag { display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #fff; background: var(--bad); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.mock-pay p { margin: 8px 0; line-height: 1.4; }
.mock-pay__facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-weight: 700; }
.mock-pay__facts dt { color: var(--ink-soft); }
.mock-pay__facts dd { margin: 0; word-break: break-all; }
.mock-pay code { font-size: 0.85rem; }

.plan-card__renewal { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin: 4px 0 8px; line-height: 1.3; }
.paywall__renew { margin: 4px 0 8px; font-size: 0.92rem; }
.paywall__renew b { color: var(--primary-dark); }

/* ---------------------------------------------------------------- parent gate */
.gate { max-width: 440px; }
.gate__why { color: var(--ink-soft); font-weight: 700; margin: 0 0 14px; }
.gate__q { display: block; font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.gate__q b { color: var(--primary-dark); font-size: 1.4rem; white-space: nowrap; }
.gate__input { width: 100%; max-width: 200px; font-size: 1.4rem; font-weight: 800; text-align: center; letter-spacing: 2px; }

/* ---------------------------------------------------------------- account screen */
.account-page { display: flex; flex-direction: column; gap: 16px; }
.account-page .page-head { margin-bottom: 4px; }
.acct-card { background: #fff; border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.acct-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.acct-card h3 small { font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.acct-card ul:not(.profile-list):not(.history-list) { margin: 0 0 12px; padding-left: 20px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.acct-card__fine { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; line-height: 1.45; margin: 0 0 12px; }
.acct-card__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acct-card--invite { background: linear-gradient(135deg, #fff 0%, #f3ecff 100%); }
.acct-card--user { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acct-card__who { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 0; }
.acct-card__who b { font-size: 1.15rem; }
.acct-card__who span { color: var(--ink-soft); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.acct-card__who .btn { align-self: flex-start; margin-top: 6px; }
.acct-card--plan .plan-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.acct-card--plan .plan-status b { font-size: 1.15rem; }
.acct-card--plan .plan-status span { color: var(--ink-soft); font-weight: 600; line-height: 1.4; }
.acct-card--premium { border-top: 8px solid var(--primary); }
.acct-card--trial { border-top: 8px solid var(--accent); }

.profile-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px; border-radius: 16px; background: var(--sand); }
.profile-row.active { outline: 3px solid var(--primary); outline-offset: -3px; }
.profile-row__avatar { font-size: 1.7rem; width: 44px; height: 44px; display: grid; place-items: center; background: #fff; border-radius: 50%; flex: none; }
.profile-row__name { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; font-size: 1.05rem; }
.profile-row__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row__tag { font-size: 0.78rem; font-weight: 800; color: var(--primary-dark); }
.profile-row__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.profile-row__actions .btn--small { min-width: 44px; padding-left: 12px; padding-right: 12px; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.emoji-grid__item { font-size: 1.8rem; min-height: 56px; border-radius: 16px; background: #fff; box-shadow: 0 2px 0 #d6dcea; }
.emoji-grid__item.active { outline: 3px solid var(--primary); }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history-row { background: var(--sand); border-radius: 16px; overflow: hidden; }
.history-row--partial { background: #fff8ec; }
.history-row__main {
  display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; grid-template-areas: 'when what score' 'when tags tags';
  gap: 4px 14px; align-items: center; width: 100%; text-align: left; padding: 10px 14px; min-height: 56px;
}
.history-row.open .history-row__main { background: #fff; }
.history-row__when { grid-area: when; display: flex; flex-direction: column; font-size: 0.86rem; color: var(--ink-soft); font-weight: 700; }
.history-row__when b { color: var(--ink); font-size: 0.98rem; }
.history-row__what { grid-area: what; display: flex; flex-direction: column; min-width: 0; font-size: 1.02rem; }
.history-row__what > span:not(:first-child) { font-size: 0.86rem; color: var(--ink-soft); font-weight: 700; }
.history-row__score { grid-area: score; display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 0.86rem; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.history-row__score b { color: var(--ink); font-size: 1rem; }
.history-row__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 6px; }
.history-row__tags:empty { display: none; }
.history-row__detail { padding: 6px 12px 12px; overflow-x: auto; }
.history-detail { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: #fff; border-radius: 12px; overflow: hidden; }
.history-detail th, .history-detail td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #eef1f7; }
.history-detail th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); }
.history-detail small { color: var(--ink-soft); font-weight: 700; }
.history-detail__stars { letter-spacing: 2px; white-space: nowrap; }
.history-detail__tips { display: flex; flex-direction: column; gap: 4px; color: var(--ink-soft); font-weight: 600; min-width: 160px; }
.history-detail__none { color: #b7bfd0; }
.history-detail__empty { padding: 6px 4px 4px; color: var(--ink-soft); font-weight: 600; line-height: 1.4; }

.confirm__text { line-height: 1.45; margin: 10px 0 4px; }

/* ---------------------------------------------------------------- summary: sync note + upsell */
.sync-note { display: inline-flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 8px 16px; border-radius: 999px; background: #fff; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; box-shadow: 0 2px 0 #d6dcea; max-width: 100%; }
.sync-note--ok { color: var(--primary-dark); }
.sync-note .btn--small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.upsell-card { margin: 18px auto 0; max-width: 620px; text-align: left; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 3px solid #f3ecff; }
.upsell-card > div { flex: 1 1 260px; min-width: 0; }
.upsell-card p { color: var(--ink-soft); font-weight: 600; line-height: 1.4; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 600px) {
  .account-chip { margin-top: 8px; gap: 6px 8px; }
  .account-chip__name { max-width: 7em; }
  .profile-chip { padding: 6px 12px; font-size: 0.95rem; }
  .lock-ribbon { top: 10px; font-size: 0.76rem; }
  .app-footer { margin-top: 20px; font-size: 0.86rem; }
  .signin__body { gap: 10px; }
  .plan-cards { gap: 10px; }
  .plan-card { padding: 16px 12px 12px; }
  .plan-card__price { font-size: 1.7rem; }
  .acct-card { padding: 14px; border-radius: 18px; }
  .acct-card--user { gap: 10px; }
  .history-row__main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'when score' 'what what' 'tags tags'; gap: 2px 10px; padding: 10px 12px; }
  .history-row__when { flex-direction: row; gap: 6px; align-items: baseline; }
  .history-detail th:nth-child(4), .history-detail td:nth-child(4) { display: none; }
  .profile-row__actions { width: 100%; justify-content: flex-end; }
  .pose-detail__actions .btn--danger { order: 2; }
}
