/* Build tag */
.build-tag {
  position: fixed;
  bottom: 4px;
  right: 8px;
  font-size: 0.65rem;
  color: #bbb;
  font-family: monospace;
  pointer-events: none;
  z-index: 9999;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #faf9f7;
  color: #3d3d3d;
  line-height: 1.6;
}

/* Header — softened from dark navy */
header {
  background: #2d3748;
  padding: 0.75rem 1.5rem;
}

nav {
  max-width: 960px;
  margin: 0 auto;
}

.logo {
  color: #e8836b;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 1px;
}

/* Main */
main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Typography — calmer hierarchy */
h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  color: #2d3748;
  font-weight: 700;
}

h2 {
  font-size: 1.1rem;
  color: #4a5568;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.subtitle {
  color: #718096;
  margin-bottom: 1.5rem;
}

.subtitle a {
  color: #e8836b;
  text-decoration: none;
}

.subtitle a:hover {
  text-decoration: underline;
}

/* Cards — softer shadows and radius */
.card {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Buttons — muted coral accent, larger touch targets */
.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
  min-height: 44px;
  line-height: 1.4;
}

.btn-primary {
  background: #e8836b;
  color: #fff;
}

.btn-primary:hover {
  background: #d97259;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-back {
  background: #edf2f7;
  color: #4a5568;
  margin-top: 2rem;
}

.btn-back:hover {
  background: #e2e8f0;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  min-height: 36px;
}

/* Empty state */
.empty-state {
  color: #a0aec0;
  font-style: italic;
  padding: 1rem 0;
}

/* Forms */
.form {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  max-width: 560px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #e8836b;
  box-shadow: 0 0 0 2px rgba(232, 131, 107, 0.15);
}

.password-wrapper {
  position: relative;
}
.password-wrapper input {
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #718096;
  padding: 0.25rem;
  line-height: 1;
}
.password-toggle:hover {
  color: #4a5568;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-size: 3rem;
  color: #e8836b;
}

.error-page p {
  color: #718096;
  margin: 1rem 0;
}

.error-page a {
  color: #e8836b;
  text-decoration: none;
}

.error-page a:hover {
  text-decoration: underline;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #fed7d7;
}

.alert-success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #c6f6d5;
}

/* Page header with actions */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-invited { background: #fefcbf; color: #975a16; }
.badge-active { background: #f0fff4; color: #276749; }
.badge-inactive { background: #f7fafc; color: #a0aec0; }

/* Form footer text */
.form-footer {
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Invite URL display */
.invite-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.invite-url-input {
  flex: 1;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.85rem;
}

.invite-actions {
  margin-top: 0.75rem;
}

/* Student list */
.student-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.student-card {
  padding: 0.85rem 1.1rem;
}

.student-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.student-adherence {
  color: #718096;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.student-card-inactive {
  opacity: 0.6;
}

.student-list-inactive {
  border-top: 1px solid #edf2f7;
  padding-top: 1rem;
}

.section-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #a0aec0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-warning {
  background: #fefcbf;
  color: #975a16;
  font-size: 0.7rem;
}

.badge-partial {
  background: #faf5ff;
  color: #6b46c1;
  font-size: 0.7rem;
}

/* Commitment note */
.commitment-note {
  color: #4a5568;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Cycle display */
.cycle-progress {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.cycle-dates {
  color: #a0aec0;
  font-size: 0.85rem;
}

.cycle-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.cycle-table th,
.cycle-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
}

.cycle-table th {
  font-size: 0.8rem;
  color: #a0aec0;
  text-transform: uppercase;
}

/* Inline form (used inside flex containers) */
.inline-form {
  display: inline;
}

/* Info alert */
.alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

/* Action-first parent home */
.action-heading {
  font-size: 1.15rem;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.btn-mark-practice {
  display: block;
  width: 100%;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  min-height: 52px;
  border-radius: 10px;
}

.practiced-today {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.practiced-today-check {
  width: 34px;
  height: 34px;
  background: #48bb78;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.practiced-today h2 {
  color: #276749;
  font-size: 1.05rem;
  margin: 0;
}

/* Progress dots */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dot {
  font-size: 1.3rem;
  line-height: 1;
}

.dot-filled {
  color: #48bb78;
}

.dot-empty {
  color: #e2e8f0;
}

.progress-dots-label {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-left: 0.3rem;
}

/* Bonus dots (over-practice) */
.dot-bonus {
  color: #d69e2e;
  font-size: 1.3rem;
  line-height: 1;
}

/* Goal reached banner */
.goal-reached-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fffff0;
  border: 1px solid #fefcbf;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.75rem;
}

.goal-reached-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.goal-reached-text {
  color: #975a16;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Calendar strip */
.calendar-strip {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.calendar-day {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0;
  border-radius: 8px;
}

.calendar-day-today {
  background: #ebf8ff;
  font-weight: 600;
}

.calendar-day-label {
  display: block;
  font-size: 0.65rem;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day-marker {
  display: block;
  font-size: 1rem;
  color: #e2e8f0;
  margin-top: 0.15rem;
}

.calendar-check {
  color: #48bb78;
  font-weight: 700;
}

/* Tappable calendar day buttons */
.calendar-day-form {
  flex: 1;
  min-width: 0;
}

.calendar-day-btn {
  all: unset;
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.4rem 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}

.calendar-day-btn:hover {
  background: #edf2f7;
}

.calendar-day-btn:active {
  transform: scale(0.93);
}

.calendar-day-btn.calendar-day-today {
  background: #ebf8ff;
  font-weight: 600;
}

.calendar-day-btn.calendar-day-today:hover {
  background: #d6edf8;
}

.calendar-empty {
  color: #cbd5e0;
  font-size: 1rem;
}

.calendar-day-future {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0;
  border-radius: 8px;
  opacity: 0.45;
  cursor: default;
}

/* Mini progress bar */
.progress-bar-mini {
  margin-bottom: 0.75rem;
}

.progress-bar-track {
  display: flex;
  background: #edf2f7;
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  background: #48bb78;
  border-radius: 3px;
  animation: bar-grow 0.5s ease-out;
  transform-origin: left;
}

.progress-bar-complete {
  background: #38a169;
}

.progress-bar-bonus {
  background: #d69e2e;
}

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Calendar strip goal accent */
.calendar-strip-goal-reached {
  background: #fffff0;
  border: 1px solid #fefcbf;
  border-radius: 10px;
  padding: 0.3rem;
}

/* Streak badge */
.streak-badge {
  display: inline-block;
  background: #fffff0;
  color: #d69e2e;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  border: 1px solid #fefcbf;
}

/* Flash confirmation */
.flash-confirmation {
  animation: flash-pulse 0.4s ease-out;
}

@keyframes flash-pulse {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  70% { opacity: 1; transform: translateY(0) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Check pop animation */
.practiced-today-check {
  animation: check-pop 0.4s ease-out;
}

@keyframes check-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Dot fill animation */
.dot-filled {
  animation: dot-fill 0.3s ease-out;
}

@keyframes dot-fill {
  0% { transform: scale(0.5); opacity: 0.3; }
  100% { transform: scale(1); opacity: 1; }
}

/* Goal celebrate entrance */
.goal-reached-banner {
  animation: goal-celebrate 0.5s ease-out;
}

@keyframes goal-celebrate {
  0% { opacity: 0; transform: translateY(10px) scale(0.95); }
  70% { transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Accessibility: disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .flash-confirmation,
  .practiced-today-check,
  .dot-filled,
  .goal-reached-banner,
  .progress-bar-fill {
    animation: none;
  }
  .calendar-day-btn:active {
    transform: none;
  }
}

/* Empty state friendly */
.empty-state-friendly {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  color: #718096;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.empty-state-friendly p {
  margin-bottom: 0.5rem;
}

.empty-state-friendly p:last-child {
  margin-bottom: 0;
}

.empty-state-friendly a {
  color: #e8836b;
  text-decoration: none;
  font-weight: 500;
}

.empty-state-friendly a:hover {
  text-decoration: underline;
}

/* Summary block (teacher dashboard) */
.summary-block {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.summary-item {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

.summary-item strong {
  display: block;
  font-size: 1.4rem;
}

.summary-completed {
  background: #f0fff4;
  color: #276749;
}

.summary-on-track {
  background: #ebf8ff;
  color: #2b6cb0;
}

.summary-attention {
  background: #fffaf0;
  color: #c05621;
}

/* Group headers */
.group-header {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.group-header-completed { color: #276749; }
.group-header-on-track { color: #2b6cb0; }
.group-header-attention { color: #c05621; }

/* Lesson readiness badge */
.badge-ready {
  background: #f0fff4;
  color: #276749;
  font-size: 0.7rem;
}

.badge-attention {
  background: #fffaf0;
  color: #c05621;
  font-size: 0.7rem;
}

/* Version history */
.version-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.version-history-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f7fafc;
}

.version-history-item:last-child {
  border-bottom: none;
}

.version-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.version-history-date {
  color: #a0aec0;
  font-size: 0.8rem;
}

.version-history-note {
  color: #4a5568;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.version-history-meta {
  color: #a0aec0;
  font-size: 0.8rem;
}

/* Secondary actions (archive, etc.) */
.secondary-actions {
  margin-top: 2rem;
  text-align: center;
}

.btn-link-secondary {
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0.5rem;
}

.btn-link-secondary:hover {
  color: #718096;
}

/* Page header actions (settings + logout) */
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Student meta line (instrument + teacher name) */
.student-meta {
  color: #718096;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Child group heading (multi-track grouping) */
.child-group-heading {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #4a5568;
  font-size: 1rem;
  font-weight: 600;
}

/* Settings page */
.settings-section {
  margin-bottom: 2rem;
}

.settings-section h2 {
  margin-bottom: 0.75rem;
}

/* Mobile-first responsive for parent views at 375px */
@media (max-width: 480px) {
  main {
    padding: 0 1rem;
    margin: 1.25rem auto;
  }

  h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 0.85rem 1rem;
  }

  .btn-mark-practice {
    padding: 1rem;
    font-size: 1.15rem;
    min-height: 56px;
  }

  .calendar-day-label {
    font-size: 0.6rem;
  }

  .summary-block {
    gap: 0.5rem;
  }

  .summary-item {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .summary-item strong {
    font-size: 1.2rem;
  }

  .page-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .form {
    padding: 1.25rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
