/**
 * 🎨 src/styles/family-sync.css
 * 온 가족 3대 양방향 무계정 안심 연동 모달 및 QR 카드 스타일시트
 */

/* ── 모달 컨테이너 ── */
.sync-modal-container {
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-app, #f8fafc);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
}

/* ── 3대 서브탭 네비게이션 ── */
.sync-tabs-nav {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200, #e2e8f0);
  padding: 0 16px;
  gap: 8px;
}

.sync-tab-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sync-tab-btn.active {
  color: var(--sage-deep, #1b4332);
}

.sync-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--sage-primary, #40916c);
  border-radius: 3px 3px 0 0;
}

/* ── 본문 콘텐츠 패널 ── */
.sync-tab-panel {
  display: none;
  padding: 18px 16px 28px;
  animation: syncFadeIn 0.2s ease-out;
}

.sync-tab-panel.active {
  display: block;
}

@keyframes syncFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 역할 선택 토글 세그먼트 (환자 폰 vs 가족 폰) ── */
.sync-role-segment {
  display: flex;
  background: var(--slate-100, #f1f5f9);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
  gap: 4px;
}

.sync-role-btn {
  flex: 1;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.18s ease;
}

.sync-role-btn.active {
  background: #ffffff;
  color: var(--sage-deep, #1b4332);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ── QR 코드 캔버스 카드 ── */
.sync-qr-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px 16px;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--slate-100, #f1f5f9);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
}

.sync-qr-svg-wrap {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 14px;
  background: #ffffff;
  padding: 6px;
  border-radius: 16px;
  border: 1.5px solid var(--slate-100, #f1f5f9);
}

.sync-qr-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
}

.sync-qr-guide {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
  margin-bottom: 12px;
}

.sync-family-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-bg, #e8f5e9);
  border: 1px solid var(--sage-pale, #c8e6c9);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sage-deep, #1b4332);
}

/* ── 카카오톡 공유 버튼 ── */
.btn-kakao-share {
  width: 100%;
  height: 48px;
  border: none;
  background: #fee500;
  color: #191919;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.btn-kakao-share:active {
  transform: scale(0.985);
}

/* ── 서브 액션 버튼 그리드 (문자 전송 & 링크 복사) ── */
.sync-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.btn-sub-action {
  height: 42px;
  border: 1.5px solid var(--slate-200, #e2e8f0);
  background: #ffffff;
  color: var(--text-primary, #0f172a);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sub-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sub-action:active {
  transform: scale(0.98);
}

/* ── 메시지 미리보기 카드 ── */
.sync-preview-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--slate-200, #e2e8f0);
  margin-bottom: 16px;
}

.sync-preview-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.sync-preview-text {
  font-size: 12.5px;
  color: var(--text-primary, #0f172a);
  line-height: 1.55;
  white-space: pre-line;
  background: var(--slate-100, #f1f5f9);
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
}

/* ── 안심 원리 가이드 카드 ── */
.sync-security-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--slate-100, #f1f5f9);
  margin-bottom: 10px;
}

.sync-security-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.sync-security-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 3px;
}

.sync-security-desc {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

/* ── 알약형 토스트 알림 ── */
.sync-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 10000;
  max-width: 90%;
  text-align: center;
}

.sync-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
