/* ===========================================
   KinPatch Onboarding Styles
   Component-specific styles for the onboarding flow.
   Layout is handled by authenticated.css (split-layout, content-card, sidebar-widget).
   =========================================== */

/* ===========================================
   Form Inputs (onboarding-specific)
   =========================================== */
.authenticated-page .input-group {
  margin-bottom: 20px;
}

.authenticated-page .input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.authenticated-page .input-wrapper {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 0 16px;
  height: 52px;
  transition: all 0.2s ease;
}

.authenticated-page .input-wrapper:focus-within {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245, 132, 31, 0.1);
}

.authenticated-page .input-icon {
  color: var(--text-light);
  margin-right: 12px;
  font-size: 20px;
}

.authenticated-page .input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.authenticated-page .input-field {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  height: 100%;
  font-family: inherit;
}

.authenticated-page .input-field::placeholder {
  color: var(--text-light);
}

/* ===========================================
   Card Subtitle (within content_card)
   =========================================== */
.onboarding-card-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ===========================================
   Family Type Selection (Step 2)
   =========================================== */
.family-type-section {
  margin-bottom: 24px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 12px;
}

.family-type-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.family-type-option {
  cursor: pointer;
}

.family-type-option input {
  display: none;
}

.type-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  transition: all 0.2s ease;
}

.type-card:hover {
  border-color: #CCCCCC;
}

.family-type-option input:checked + .type-card {
  border-color: #F5841F;
  background: #FEF3E7;
}

.type-card > .mdi {
  font-size: 28px;
  color: #666666;
  transition: color 0.2s ease;
}

.family-type-option input:checked + .type-card > .mdi {
  color: #F5841F;
}

.type-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #D0D0D0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: all 0.2s ease;
}

.type-check .mdi {
  font-size: 14px;
  color: transparent;
  transition: color 0.2s ease;
}

.family-type-option input:checked + .type-card .type-check {
  background-color: #F5841F;
  border-color: #F5841F;
}

.family-type-option input:checked + .type-card .type-check .mdi {
  color: white;
}

.type-label {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
}

.type-description {
  font-size: 13px;
  color: #999999;
  margin-top: 2px;
}

.type-card > div {
  display: flex;
  flex-direction: column;
}

/* ===========================================
   Members List (Step 3)
   =========================================== */
.members-list {
  margin-bottom: 20px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #F8F6F6;
  margin-bottom: 8px;
}

.member-item-self {
  background: #FEF3E7;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.member-avatar.small {
  width: 36px;
  height: 36px;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-size: 18px;
  font-weight: 600;
  color: #F5841F;
}

.member-avatar.small .avatar-initials {
  font-size: 14px;
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.member-name {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
}

.member-role {
  font-size: 13px;
  color: #666666;
}

.member-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #999999;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.member-remove:hover {
  background: #FEE2E2;
  color: #DC3545;
}

/* ===========================================
   Import Section (from Free Family Tree Builder)
   =========================================== */
.import-description {
  margin-bottom: 12px;
}

.import-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.import-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #E0E0E0;
}

.import-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F5841F;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.import-member-info {
  display: flex;
  flex-direction: column;
}

.import-member-name {
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
}

.import-member-relationship {
  font-size: 12px;
  color: #666666;
}

.import-actions {
  display: flex;
  gap: 12px;
}

.btn-import {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #F5841F;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-import:hover {
  background: #E5740F;
}

.btn-import .mdi {
  font-size: 20px;
}

.btn-dismiss {
  padding: 12px 20px;
  background: transparent;
  color: #666666;
  border: 1px solid #D0D0D0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dismiss:hover {
  background: #F5F5F5;
  border-color: #999999;
}

/* ===========================================
   Add Member Section
   =========================================== */
.add-member-section {
  margin-bottom: 24px;
}

.btn-add-member {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed #D0D0D0;
  border-radius: 12px;
  background: transparent;
  color: #666666;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-member:hover {
  border-color: #F5841F;
  color: #F5841F;
  background: #FEF3E7;
}

.btn-add-member .mdi {
  font-size: 20px;
}

.add-member-form {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  background: #FAFAFA;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===========================================
   Relationship Options
   =========================================== */
.relationship-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relationship-option {
  cursor: pointer;
}

.relationship-option input {
  display: none;
}

.relationship-chip {
  display: inline-block;
  padding: 8px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #666666;
  background: white;
  transition: all 0.2s ease;
}

.relationship-chip:hover {
  border-color: #CCCCCC;
}

.relationship-option input:checked + .relationship-chip {
  border-color: #F5841F;
  background: #F5841F;
  color: white;
}

/* ===========================================
   Form Actions (onboarding-specific)
   =========================================== */
.content-card .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.btn-cancel {
  padding: 10px 20px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  background: white;
  color: #666666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: #F5F5F5;
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #F5841F;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:hover {
  background: #D9740A;
}

.onboarding-actions {
  margin-top: 24px;
}

/* ===========================================
   Invites (Step 4)
   =========================================== */
.invite-list {
  margin-bottom: 24px;
}

.invite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.invite-member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.invite-input {
  flex: 1;
}

.invite-actions {
  margin-bottom: 16px;
}

.invite-later {
  text-align: center;
  margin-top: 16px;
}

.btn-text {
  color: #666666;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-text:hover {
  color: #F5841F;
}

.no-members-message {
  text-align: center;
  padding: 24px;
  background: #F8F6F6;
  border-radius: 12px;
  margin-bottom: 24px;
}

.no-members-message p {
  color: #666666;
  margin: 0;
}

/* ===========================================
   Skip Button (sidebar version)
   =========================================== */
.onboarding-sidebar-skip {
  text-align: center;
  padding-top: 4px;
}

.btn-skip {
  background: none;
  border: none;
  color: #999999;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s ease;
}

.btn-skip:hover {
  color: #666666;
}

/* ===========================================
   Sidebar Progress Widget
   =========================================== */
.onboarding-progress-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.progress-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.progress-step-row:first-child {
  padding-top: 0;
}

.progress-step-row:last-child {
  padding-bottom: 0;
}

.progress-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F0F0F0;
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: #F5841F;
  color: white;
}

.progress-step.completed {
  background: #4CAF50;
  color: white;
}

.progress-step.completed .mdi {
  font-size: 16px;
}

.progress-step-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-step-row:has(.progress-step.active) .progress-step-label {
  color: var(--text);
  font-weight: 500;
}

.progress-step-row:has(.progress-step.completed) .progress-step-label {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: #ccc;
}

/* ===========================================
   Complete Screen
   =========================================== */
/* Family Preview Sidebar (complete page) */
.family-preview-sidebar {
  max-height: 280px;
  overflow-y: auto;
}

.family-preview-sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
}

.family-preview-sidebar__item:last-child {
  border-bottom: none;
}

.family-preview-sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.family-preview-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.family-preview-sidebar__avatar .avatar-initials {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.family-preview-sidebar__name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* Next Steps Section (complete page) */
.next-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.next-step-card {
  display: block;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.next-step-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(245, 132, 31, 0.12);
}

.next-step-card__icon {
  font-size: 32px;
  color: var(--primary);
  display: block;
  margin-bottom: 12px;
}

.next-step-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
}

.next-step-card__description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.next-step-card__how {
  font-size: 12px;
  color: var(--text-light);
  margin: 8px 0 0 0;
  font-style: italic;
}



/* ===========================================
   Confetti Animation
   =========================================== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .invite-item {
    flex-direction: column;
    align-items: stretch;
  }

  .invite-member {
    margin-bottom: 8px;
  }

  .next-steps-grid {
    grid-template-columns: 1fr;
  }
}
