/* ===========================================
   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;
}

/* ===========================================
   Members List
   =========================================== */
.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;
}

/* ===========================================
   Invite step
   =========================================== */
.invite-list {
  margin-bottom: 24px;
}

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

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

.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;
}

/* ===========================================
   Memory step
   =========================================== */
.tree-found-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: #FEF3E7;
  color: #B45F06;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.tree-found-banner[hidden] {
  display: none;
}

.tree-found-banner .mdi {
  font-size: 20px;
}

.tree-found-banner .mdi-arrow-right {
  margin-left: auto;
}

.memory-prompts {
  margin-bottom: 16px;
}

.memory-prompts__label {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 10px;
}

.memory-prompts__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memory-prompt-chip {
  padding: 8px 14px;
  border: 2px solid #E0E0E0;
  border-radius: 20px;
  background: white;
  color: #666666;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.memory-prompt-chip.active {
  border-color: #F5841F;
  background: #FEF3E7;
  color: #B45F06;
}

/* Line the photo button up with the text box (posts.css insets it) */
#memory-form .media-upload-section {
  padding: 0;
  background: none;
}

.memory-error {
  margin: 0 0 16px;
  color: #D92D20;
  font-size: 14px;
  font-weight: 500;
}

.memory-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 0;
  color: #666666;
  font-size: 13px;
}

/* ===========================================
   Invite step: share panel
   =========================================== */
.invite-item__form {
  margin: 0;
}

.invite-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: #999999;
  font-size: 13px;
}

.invite-divider::before,
.invite-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E0E0E0;
}

.input-hint {
  margin: 8px 0 0;
  color: #666666;
  font-size: 13px;
  line-height: 1.4;
}

.invite-share__message {
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  background: #FAFAFA;
}

.invite-share__text {
  margin: 0 0 8px;
  color: #1A1A1A;
  font-size: 15px;
  line-height: 1.5;
}

.invite-share__link {
  margin: 0;
  color: #B45F06;
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

.invite-share__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.invite-share__actions [hidden] {
  display: none;
}

.btn-secondary-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  color: #1A1A1A;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-outline:hover {
  border-color: #F5841F;
  color: #F5841F;
}

.invite-share__note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: #666666;
  font-size: 13px;
}

/* ===========================================
   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;
}

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

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

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