/* Littlest Dreamer — parent input UI (signup essentials, weekly check-in, edit sheet).
 *
 * Reuses lr-auth.css and lr-coach.css tokens. New rules below are
 * scoped under .lr-parent-input-* to avoid collisions.
 */

.lr-parent-input-q {
  margin-bottom: 18px;
}
.lr-parent-input-q-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.lr-parent-input-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lr-parent-input-chip {
  background: var(--warm-white);
  border: 1.5px solid var(--sage-light);
  color: var(--charcoal);
  padding: 10px 16px;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;  /* CLAUDE.md tap-target rule; was 36px pre-polish. */
  transition: background 0.12s, border-color 0.12s;
}
.lr-parent-input-chip:focus-visible {
  outline: 2px solid var(--sage-dark);
  outline-offset: 2px;
}
.lr-parent-input-chip:hover { border-color: var(--sage); }
.lr-parent-input-chip.is-selected {
  background: var(--sage-light);
  border-color: var(--sage-dark);
  font-weight: 600;
}
.lr-parent-input-freeform {
  width: 100%;
  min-height: 64px;
  border: 1.5px solid var(--sage-light);
  border-radius: 10px;
  padding: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  resize: vertical;
}
.lr-parent-input-counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  transition: color 0.15s;
}
/* Near-limit tint passes WCAG AA: light-mode #a87340 on warm-white is
 * ~4.7:1 (12px text needs ≥4.5:1). Dark-mode terracotta is already
 * lightened by --terracotta's html.lr-dark override (#d4a37e) which
 * reads ~8.5:1 on the dark surface — pass. */
.lr-parent-input-counter.is-near-limit { color: #a87340; }
html.lr-dark .lr-parent-input-counter.is-near-limit { color: var(--terracotta, #d4a37e); }

/* Weekly check-in card states (rendered into Coach via insertion adjacent
   to .coach-hub-card). Picks up coach-hub styling for free. */
.lr-weekly-card-edit {
  background: none;
  border: none;
  color: var(--sage-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
  /* 44px tap target via padding (a11y rule for one-handed 3am use). */
  padding: 12px 4px 12px 0;
  min-height: 44px;
}
.lr-weekly-card-dismiss {
  background: none;
  border: none;
  color: var(--sage-dark);  /* Promoted from --muted; muted on --cream ~4.4:1 borderline. */
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
  text-decoration: underline;
  padding: 12px 4px;
  min-height: 44px;
}

/* Weekly check-in bottom sheet — own class family per the lr-baby-sheet /
   lr-bill-modal / lr-auth-modal convention (each module owns its sheet). */
.lr-weekly-sheet {
  position: fixed;
  inset: 0;
  /* Must clear the bottom nav (z-9999) — at z-1100 the nav covered the
     Save button and intercepted touches in the sheet's lower region. */
  z-index: 10000;
  pointer-events: none;
}
.lr-weekly-sheet.is-open {
  pointer-events: auto;
}
.lr-weekly-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 36, 0);
  transition: background 0.2s ease;
}
.lr-weekly-sheet.is-open .lr-weekly-sheet-backdrop {
  background: rgba(20, 24, 36, 0.45);
}
.lr-weekly-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--warm-white);
  border-radius: 22px 22px 0 0;
  /* Bottom padding must clear the fixed bottom nav so the Save button at
     the tail of the scrollable body remains tappable. Fallback keeps the
     original 24px+safe-area for any page that doesn't define the token. */
  padding: 8px 20px var(--lr-nav-clear, calc(24px + env(safe-area-inset-bottom)));
  max-height: calc(92vh - var(--lr-nav-h, 0px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.22s ease;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
}
.lr-weekly-sheet.is-open .lr-weekly-sheet-panel {
  transform: translateY(0);
}

/* Tablet+ — float the sheet as a centered modal instead of an
 * edge-to-edge full-width strip. Mirrors lr-baby-sheet behavior. */
@media (min-width: 640px) {
  .lr-weekly-sheet-panel {
    left: 50%;
    right: auto;
    bottom: 50%;
    transform: translate(-50%, calc(50% + 40px));
    width: 480px;
    max-width: 92vw;
    border-radius: 18px;
    padding: 18px 22px 24px;
    max-height: min(80vh, 640px);
  }
  .lr-weekly-sheet.is-open .lr-weekly-sheet-panel {
    transform: translate(-50%, 50%);
  }
}

.lr-weekly-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto 10px;
}
html.lr-dark .lr-weekly-sheet-handle { background: var(--muted); }
@media (min-width: 640px) { .lr-weekly-sheet-handle { display: none; } }

.lr-weekly-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lr-weekly-sheet-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--charcoal);
  margin: 0;
}
.lr-weekly-sheet-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.lr-weekly-sheet-close:hover { background: rgba(0,0,0,0.05); }
html.lr-dark .lr-weekly-sheet-close:hover { background: rgba(255,255,255,0.05); }
.lr-weekly-sheet-close:focus-visible {
  outline: 2px solid var(--sage-dark);
  outline-offset: 2px;
}
.lr-weekly-sheet-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 12px;
}

/* Respect users who request reduced motion (vestibular conditions,
 * personal preference). Disables sheet entrance + chip hover animations
 * — the swipe-to-dismiss handler still works, just without the smooth
 * fade. Convention matches lr-auth.css's existing reduce-motion block. */
@media (prefers-reduced-motion: reduce) {
  .lr-weekly-sheet-backdrop,
  .lr-weekly-sheet.is-open .lr-weekly-sheet-panel,
  .lr-weekly-sheet-panel {
    transition: none !important;
  }
  .lr-parent-input-chip {
    transition: none !important;
  }
}
