/* ===========================================
   FamilyRack Onboarding Styles
   For logged-in onboarding flow
   =========================================== */

/* ===========================================
   Onboarding Container
   =========================================== */
.onboarding-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
}

.onboarding-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}

/* ===========================================
   Onboarding Header
   =========================================== */
.onboarding-header {
  text-align: center;
  margin-bottom: 32px;
}

.onboarding-icon {
  width: 72px;
  height: 72px;
  background: #FEF3E7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.onboarding-icon .mdi {
  font-size: 36px;
  color: var(--primary);
}

.onboarding-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.onboarding-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ===========================================
   Progress Indicator
   =========================================== */
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 0;
}

.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F0F0F0;
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  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: 18px;
}

.progress-line {
  width: 40px;
  height: 3px;
  background: #E0E0E0;
  transition: all 0.3s ease;
}

.progress-line.completed {
  background: #4CAF50;
}

/* ===========================================
   Form Inputs (standalone, not from auth)
   =========================================== */
.onboarding-container .input-group {
  margin-bottom: 20px;
}

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

.onboarding-container .input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  height: 52px;
  transition: all 0.2s ease;
}

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

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

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

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

.onboarding-container .input-field::placeholder {
  color: var(--text-light);
}

/* ===========================================
   Buttons
   =========================================== */
.onboarding-container .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(245, 132, 31, 0.25);
  transition: all 0.2s ease;
  text-decoration: none;
}

.onboarding-container .btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(245, 132, 31, 0.35);
  transform: translateY(-1px);
}

.onboarding-container .btn-primary .mdi {
  font-size: 18px;
}

/* ===========================================
   Role Selection (Step 1)
   =========================================== */
.role-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.role-option {
  cursor: pointer;
}

.role-option input {
  display: none;
}

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

.role-card:hover {
  border-color: #CCCCCC;
  background: #FAFAFA;
}

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

.role-card .mdi {
  font-size: 32px;
  color: #666666;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.role-option input:checked + .role-card .mdi {
  color: #F5841F;
}

.role-label {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 4px;
}

.role-description {
  font-size: 12px;
  color: #999999;
}

/* ===========================================
   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-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-section {
  background: linear-gradient(135deg, #FEF3E7 0%, #FFF8F0 100%);
  border: 2px solid #F5841F;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.import-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.import-header .mdi {
  font-size: 28px;
  color: #F5841F;
  flex-shrink: 0;
}

.import-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 4px;
}

.import-header p {
  font-size: 14px;
  color: #666666;
  margin: 0;
  line-height: 1.4;
}

.import-preview {
  display: flex;
  flex-wrap: wrap;
  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;
  flex: 0 0 calc(33.333% - 6px);
  min-width: 0;
}

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

.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
   =========================================== */
.onboarding-skip {
  margin-top: 24px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #EEEEEE;
}

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

/* ===========================================
   Complete Screen
   =========================================== */
.onboarding-complete .auth-header {
  margin-bottom: 24px;
}

.celebration-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #FFD700 0%, #F5841F 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: celebratePulse 2s ease-in-out infinite;
}

.celebration-icon .mdi {
  font-size: 40px;
  color: white;
}

@keyframes celebratePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Family Preview */
.family-preview {
  background: #F8F6F6;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.family-members-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.preview-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.preview-member .member-avatar {
  width: 56px;
  height: 56px;
}

.preview-name {
  font-size: 12px;
  color: #666666;
  font-weight: 500;
}

.preview-more .avatar-count {
  font-size: 16px;
  font-weight: 600;
  color: #F5841F;
}

.family-count {
  text-align: center;
  color: #999999;
  font-size: 14px;
  margin: 0;
}

/* Quick Tips */
.quick-tips {
  margin-bottom: 24px;
}

.quick-tips h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 12px;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tips-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: #666666;
  font-size: 14px;
}

.tips-list li .mdi {
  font-size: 20px;
  color: #F5841F;
}

.btn-celebrate {
  background: linear-gradient(135deg, #F5841F 0%, #FF6B35 100%);
}

.btn-celebrate:hover {
  background: linear-gradient(135deg, #D9740A 0%, #E55A2B 100%);
}

/* ===========================================
   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) {
  .role-options {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

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

  .family-members-grid {
    gap: 12px;
  }

  .preview-member .member-avatar {
    width: 48px;
    height: 48px;
  }
}
